Commit 841ef552 authored by Thomas Zimmermann's avatar Thomas Zimmermann Committed by Dmitry Baryshkov

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: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/530557/
Link: https://lore.kernel.org/r/20230403124538.8497-8-tzimmermann@suse.deSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 6479f5b4
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment