diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-03-30 09:30:45 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-04-21 10:19:42 +0200 |
commit | 174c3c38e3a2a37bccf56e537e3703ce020a50ff (patch) | |
tree | cefb62b09c93dcd655ef50fb3ddd472d1b573fa0 /drivers/gpu/drm/armada | |
parent | 169c85edcabcc1a7f01b7b5bee1f918ca49ac14f (diff) | |
download | linux-174c3c38e3a2a37bccf56e537e3703ce020a50ff.tar.gz linux-174c3c38e3a2a37bccf56e537e3703ce020a50ff.tar.bz2 linux-174c3c38e3a2a37bccf56e537e3703ce020a50ff.zip |
drm/armada: 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: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230330073046.7150-4-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/armada')
-rw-r--r-- | drivers/gpu/drm/armada/armada_fbdev.c | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index 0e44f53e9fa4..303c55704225 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -117,6 +117,32 @@ static const struct drm_fb_helper_funcs armada_fb_helper_funcs = { .fb_probe = armada_fb_probe, }; +/* + * Fbdev client and struct drm_client_funcs + */ + +static void armada_fbdev_client_unregister(struct drm_client_dev *client) +{ } + +static int armada_fbdev_client_restore(struct drm_client_dev *client) +{ + drm_fb_helper_lastclose(client->dev); + + return 0; +} + +static int armada_fbdev_client_hotplug(struct drm_client_dev *client) +{ + return 0; +} + +static const struct drm_client_funcs armada_fbdev_client_funcs = { + .owner = THIS_MODULE, + .unregister = armada_fbdev_client_unregister, + .restore = armada_fbdev_client_restore, + .hotplug = armada_fbdev_client_hotplug, +}; + int armada_fbdev_init(struct drm_device *dev) { struct armada_private *priv = drm_to_armada_dev(dev); @@ -131,22 +157,30 @@ int armada_fbdev_init(struct drm_device *dev) drm_fb_helper_prepare(dev, fbh, 32, &armada_fb_helper_funcs); + ret = drm_client_init(dev, &fbh->client, "armada-fbdev", + &armada_fbdev_client_funcs); + if (ret) + goto err_drm_fb_helper_unprepare; + ret = drm_fb_helper_init(dev, fbh); if (ret) { DRM_ERROR("failed to initialize drm fb helper\n"); - goto err_fb_helper; + goto err_drm_client_release; } ret = drm_fb_helper_initial_config(fbh); if (ret) { DRM_ERROR("failed to set initial config\n"); - goto err_fb_setup; + goto err_drm_fb_helper_fini; } return 0; - err_fb_setup: + +err_drm_fb_helper_fini: drm_fb_helper_fini(fbh); - err_fb_helper: +err_drm_client_release: + drm_client_release(&fbh->client); +err_drm_fb_helper_unprepare: drm_fb_helper_unprepare(fbh); priv->fbdev = NULL; return ret; @@ -161,6 +195,7 @@ void armada_fbdev_fini(struct drm_device *dev) drm_fb_helper_unregister_info(fbh); drm_fb_helper_fini(fbh); + drm_client_release(&fbh->client); if (fbh->fb) fbh->fb->funcs->destroy(fbh->fb); |