summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-04-03 14:45:35 +0200
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-04-06 20:29:40 +0300
commite13446341f9750198592a337bf87e8f0519ecd87 (patch)
tree93c4733325ab424cc3779c239da28690efaab26e
parentb0b3d253eb7fb7bce8fbbf2384b4085c260dc133 (diff)
drm/msm: Remove fbdev from struct msm_drm_private
The DRM device stores a pointer to the fbdev helper. Remove struct msm_drm_private.fbdev, which contains the same value. No functional changes. v2: * test for fb_helper->fb in debugfs code Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/530559/ Link: https://lore.kernel.org/r/20230403124538.8497-6-tzimmermann@suse.de Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-rw-r--r--drivers/gpu/drm/msm/msm_debugfs.c5
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c4
-rw-r--r--drivers/gpu/drm/msm/msm_drv.h2
-rw-r--r--drivers/gpu/drm/msm/msm_fbdev.c8
4 files changed, 6 insertions, 13 deletions
diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
index d6ecff0ab618..7de9e39f051e 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -241,12 +241,11 @@ static int msm_fb_show(struct seq_file *m, void *arg)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct drm_device *dev = node->minor->dev;
- struct msm_drm_private *priv = dev->dev_private;
struct drm_framebuffer *fb, *fbdev_fb = NULL;
- if (priv->fbdev) {
+ if (dev->fb_helper && dev->fb_helper->fb) {
seq_printf(m, "fbcon ");
- fbdev_fb = priv->fbdev->fb;
+ fbdev_fb = dev->fb_helper->fb;
msm_framebuffer_describe(fbdev_fb, m);
}
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 2119060ae1fe..856e436f2418 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -243,7 +243,7 @@ static int msm_drm_uninit(struct device *dev)
msm_rd_debugfs_cleanup(priv);
#ifdef CONFIG_DRM_FBDEV_EMULATION
- if (fbdev && priv->fbdev)
+ if (fbdev && ddev->fb_helper)
msm_fbdev_free(ddev);
#endif
@@ -551,7 +551,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
#ifdef CONFIG_DRM_FBDEV_EMULATION
if (kms && fbdev)
- priv->fbdev = msm_fbdev_init(ddev);
+ msm_fbdev_init(ddev);
#endif
ret = msm_debugfs_late_init(ddev);
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 7936aa6cad03..ddb681a104bb 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -129,8 +129,6 @@ struct msm_drm_private {
bool is_a2xx;
bool has_cached_coherent;
- struct drm_fb_helper *fbdev;
-
struct msm_rd_state *rd; /* debugfs to dump all submits */
struct msm_rd_state *hangrd; /* debugfs to dump hanging submits */
struct msm_perf_state *perf;
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index 81a4ae189a44..0bd0cb85c538 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -122,7 +122,6 @@ static const struct drm_fb_helper_funcs msm_fb_helper_funcs = {
/* initialize fbdev helper */
struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
{
- struct msm_drm_private *priv = dev->dev_private;
struct drm_fb_helper *helper;
int ret;
@@ -142,8 +141,6 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
if (ret)
goto fini;
- priv->fbdev = helper;
-
return helper;
fini:
@@ -156,8 +153,7 @@ fail:
void msm_fbdev_free(struct drm_device *dev)
{
- struct msm_drm_private *priv = dev->dev_private;
- struct drm_fb_helper *helper = priv->fbdev;
+ struct drm_fb_helper *helper = dev->fb_helper;
struct drm_framebuffer *fb = helper->fb;
DBG();
@@ -176,5 +172,5 @@ void msm_fbdev_free(struct drm_device *dev)
drm_fb_helper_unprepare(helper);
kfree(helper);
- priv->fbdev = NULL;
+ dev->fb_helper = NULL;
}