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.
I think this could be as well merged to the next patch, as this is such
a short one.
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);