Re: [PATCH 5/6] drm/omapdrm: Initialize fbdev DRM client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 30.03.23 um 14:13 schrieb Tomi Valkeinen:
On 30/03/2023 11:32, Thomas Zimmermann wrote:
Initialize the fbdev client in the fbdev code with empty helper
functions. Also clean up the client. The helpers will later
implement various functionality of the DRM client. No functional
changes.

I don't see this doing any cleanups.

Yeah, that's really not well phrased in my commit message. I wanted to say that we now clean up by calling drm_client_release() in _fini and the error-handling code.


I think this could be as well merged to the next patch, as this is such a short one.

Sure not problem. They both belong together, but I thought it's easier for reviewers to see what's happening if they are separate.

Best regards
Thomas


Reviewed-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>

  Tomi

Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
---
  drivers/gpu/drm/omapdrm/omap_fbdev.c | 33 +++++++++++++++++++++++++++-
  1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 79e417b391bf..f0e35f4764a7 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -221,6 +221,30 @@ static struct drm_fb_helper *get_fb(struct fb_info *fbi)
      return fbi->par;
  }
+/*
+ * struct drm_client
+ */
+
+static void omap_fbdev_client_unregister(struct drm_client_dev *client)
+{ }
+
+static int omap_fbdev_client_restore(struct drm_client_dev *client)
+{
+    return 0;
+}
+
+static int omap_fbdev_client_hotplug(struct drm_client_dev *client)
+{
+    return 0;
+}
+
+static const struct drm_client_funcs omap_fbdev_client_funcs = {
+    .owner        = THIS_MODULE,
+    .unregister    = omap_fbdev_client_unregister,
+    .restore    = omap_fbdev_client_restore,
+    .hotplug    = omap_fbdev_client_hotplug,
+};
+
  /* initialize fbdev helper */
  void omap_fbdev_init(struct drm_device *dev)
  {
@@ -242,10 +266,14 @@ void omap_fbdev_init(struct drm_device *dev)
      drm_fb_helper_prepare(dev, helper, 32, &omap_fb_helper_funcs);
-    ret = drm_fb_helper_init(dev, helper);
+    ret = drm_client_init(dev, &helper->client, "fbdev", &omap_fbdev_client_funcs);
      if (ret)
          goto fail;
+    ret = drm_fb_helper_init(dev, helper);
+    if (ret)
+        goto err_drm_client_release;
+
      ret = drm_fb_helper_initial_config(helper);
      if (ret)
          goto fini;
@@ -254,6 +282,8 @@ void omap_fbdev_init(struct drm_device *dev)
  fini:
      drm_fb_helper_fini(helper);
+err_drm_client_release:
+    drm_client_release(&helper->client);
  fail:
      drm_fb_helper_unprepare(helper);
      kfree(fbdev);
@@ -291,6 +321,7 @@ void omap_fbdev_fini(struct drm_device *dev)
      if (fb)
          drm_framebuffer_remove(fb);
+    drm_client_release(&helper->client);
      drm_fb_helper_unprepare(helper);
      kfree(fbdev);


--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux