From: Thomas Zimmermann <tzimmermann@suse.de>
To: robdclark@gmail.com, quic_abhinavk@quicinc.com,
dmitry.baryshkov@linaro.org, sean@poorly.run, javierm@redhat.com,
airlied@gmail.com, daniel@ffwll.ch
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 5/6] drm/msm: Initialize fbdev DRM client
Date: Thu, 30 Mar 2023 09:41:48 +0200 [thread overview]
Message-ID: <20230330074150.7637-6-tzimmermann@suse.de> (raw)
In-Reply-To: <20230330074150.7637-1-tzimmermann@suse.de>
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>
---
drivers/gpu/drm/msm/msm_fbdev.c | 38 +++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index 95b193a5e0d5..6c3665c5f4f6 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -119,6 +119,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)
{
@@ -131,10 +155,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);
@@ -145,8 +175,11 @@ 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;
}
@@ -168,6 +201,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);
--
2.40.0
next prev parent reply other threads:[~2023-03-30 7:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 7:41 [PATCH 0/6] drm/msm: Convert fbdev to DRM client Thomas Zimmermann
2023-03-30 7:41 ` [PATCH 1/6] drm/msm: Clear aperture ownership outside of fbdev code Thomas Zimmermann
2023-03-30 9:51 ` Dmitry Baryshkov
2023-04-03 11:19 ` Thomas Zimmermann
2023-03-30 7:41 ` [PATCH 2/6] drm/msm: Remove fb from struct msm_fbdev Thomas Zimmermann
2023-03-30 9:56 ` Dmitry Baryshkov
2023-03-30 7:41 ` [PATCH 3/6] drm/msm: Remove " Thomas Zimmermann
2023-03-30 9:57 ` Dmitry Baryshkov
2023-03-30 7:41 ` [PATCH 4/6] drm/msm: Remove fbdev from struct msm_drm_private Thomas Zimmermann
2023-03-30 10:01 ` Dmitry Baryshkov
2023-03-30 7:41 ` Thomas Zimmermann [this message]
2023-03-30 10:05 ` [PATCH 5/6] drm/msm: Initialize fbdev DRM client Dmitry Baryshkov
2023-03-30 7:41 ` [PATCH 6/6] drm/msm: Implement fbdev emulation as in-kernel client Thomas Zimmermann
2023-03-30 10:22 ` kernel test robot
2023-03-30 10:33 ` kernel test robot
2023-03-30 9:46 ` [PATCH 0/6] drm/msm: Convert fbdev to DRM client Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230330074150.7637-6-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox