summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_fbdev.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-04-03 15:45:37 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-04-06 20:29:40 +0300
commit841ef552b1410f9a6aa5f399ce794c3b0d6b6559 (patch)
tree6bbeede1014eccf03f3ce00d0714bea90ad19450 /drivers/gpu/drm/msm/msm_fbdev.c
parent6479f5b4e5a84310748903e7dabd62c8a7d5e6e5 (diff)
downloadlinux-841ef552b1410f9a6aa5f399ce794c3b0d6b6559.tar.xz
drm/msm: Initialize fbdev DRM client
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. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/530557/ Link: https://lore.kernel.org/r/20230403124538.8497-8-tzimmermann@suse.de Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_fbdev.c')
-rw-r--r--drivers/gpu/drm/msm/msm_fbdev.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index 7d205632b165..77788c6c802d 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -123,6 +123,30 @@ static const struct drm_fb_helper_funcs msm_fb_helper_funcs = {
.fb_probe = msm_fbdev_create,
};
+/*
+ * struct drm_client
+ */
+
+static void msm_fbdev_client_unregister(struct drm_client_dev *client)
+{ }
+
+static int msm_fbdev_client_restore(struct drm_client_dev *client)
+{
+ return 0;
+}
+
+static int msm_fbdev_client_hotplug(struct drm_client_dev *client)
+{
+ return 0;
+}
+
+static const struct drm_client_funcs msm_fbdev_client_funcs = {
+ .owner = THIS_MODULE,
+ .unregister = msm_fbdev_client_unregister,
+ .restore = msm_fbdev_client_restore,
+ .hotplug = msm_fbdev_client_hotplug,
+};
+
/* initialize fbdev helper */
struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
{
@@ -138,10 +162,16 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
drm_fb_helper_prepare(dev, helper, 32, &msm_fb_helper_funcs);
+ ret = drm_client_init(dev, &helper->client, "fbdev", &msm_fbdev_client_funcs);
+ if (ret) {
+ drm_err(dev, "Failed to register client: %d\n", ret);
+ goto err_drm_fb_helper_unprepare;
+ }
+
ret = drm_fb_helper_init(dev, helper);
if (ret) {
DRM_DEV_ERROR(dev->dev, "could not init fbdev: ret=%d\n", ret);
- goto fail;
+ goto err_drm_client_release;
}
ret = drm_fb_helper_initial_config(helper);
@@ -152,7 +182,9 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
fini:
drm_fb_helper_fini(helper);
-fail:
+err_drm_client_release:
+ drm_client_release(&helper->client);
+err_drm_fb_helper_unprepare:
drm_fb_helper_unprepare(helper);
kfree(helper);
return NULL;
@@ -176,6 +208,7 @@ void msm_fbdev_free(struct drm_device *dev)
drm_framebuffer_remove(fb);
}
+ drm_client_release(&helper->client);
drm_fb_helper_unprepare(helper);
kfree(helper);