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 v2 3/8] drm/msm: Remove fb from struct msm_fbdev
Date: Mon, 3 Apr 2023 14:45:33 +0200 [thread overview]
Message-ID: <20230403124538.8497-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20230403124538.8497-1-tzimmermann@suse.de>
Fbdev's struct fb_helper stores a pointer to the framebuffer. Remove
struct msm_fbdev.fb, which contains thre same value. No functional
changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/msm/msm_fbdev.c | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index fc7d0406a9f9..323a79d9ef83 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -14,8 +14,6 @@
#include "msm_gem.h"
#include "msm_kms.h"
-static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma);
-
/*
* fbdev funcs, to implement legacy fbdev interface on top of drm driver
*/
@@ -24,9 +22,16 @@ static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma);
struct msm_fbdev {
struct drm_fb_helper base;
- struct drm_framebuffer *fb;
};
+static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
+{
+ struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
+ struct drm_gem_object *bo = msm_framebuffer_bo(helper->fb, 0);
+
+ return drm_gem_prime_mmap(bo, vma);
+}
+
static const struct fb_ops msm_fb_ops = {
.owner = THIS_MODULE,
DRM_FB_HELPER_DEFAULT_OPS,
@@ -42,19 +47,9 @@ static const struct fb_ops msm_fb_ops = {
.fb_mmap = msm_fbdev_mmap,
};
-static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
-{
- struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
- struct msm_fbdev *fbdev = to_msm_fbdev(helper);
- struct drm_gem_object *bo = msm_framebuffer_bo(fbdev->fb, 0);
-
- return drm_gem_prime_mmap(bo, vma);
-}
-
static int msm_fbdev_create(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{
- struct msm_fbdev *fbdev = to_msm_fbdev(helper);
struct drm_device *dev = helper->dev;
struct msm_drm_private *priv = dev->dev_private;
struct drm_framebuffer *fb = NULL;
@@ -101,7 +96,6 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
DBG("fbi=%p, dev=%p", fbi, dev);
- fbdev->fb = fb;
helper->fb = fb;
fbi->fbops = &msm_fb_ops;
@@ -118,7 +112,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
fbi->fix.smem_len = bo->size;
DBG("par=%p, %dx%d", fbi->par, fbi->var.xres, fbi->var.yres);
- DBG("allocated %dx%d fb", fbdev->fb->width, fbdev->fb->height);
+ DBG("allocated %dx%d fb", fb->width, fb->height);
return 0;
@@ -173,6 +167,7 @@ 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_framebuffer *fb = helper->fb;
struct msm_fbdev *fbdev;
DBG();
@@ -184,11 +179,10 @@ void msm_fbdev_free(struct drm_device *dev)
fbdev = to_msm_fbdev(priv->fbdev);
/* this will free the backing object */
- if (fbdev->fb) {
- struct drm_gem_object *bo =
- msm_framebuffer_bo(fbdev->fb, 0);
+ if (fb) {
+ struct drm_gem_object *bo = msm_framebuffer_bo(fb, 0);
msm_gem_put_vaddr(bo);
- drm_framebuffer_remove(fbdev->fb);
+ drm_framebuffer_remove(fb);
}
drm_fb_helper_unprepare(helper);
--
2.40.0
next prev parent reply other threads:[~2023-04-03 12:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 12:45 [PATCH v2 0/8] drm/msm: Convert fbdev to DRM client Thomas Zimmermann
2023-04-03 12:45 ` [PATCH v2 1/8] drm/msm: Include <linux/io.h> Thomas Zimmermann
2023-04-03 15:44 ` [v2,1/8] " Sui Jingfeng
2023-04-04 21:42 ` [PATCH v2 1/8] " Dmitry Baryshkov
2023-04-03 12:45 ` [PATCH v2 2/8] drm/msm: Clear aperture ownership outside of fbdev code Thomas Zimmermann
2023-04-04 21:43 ` Dmitry Baryshkov
2023-04-04 21:59 ` Dmitry Baryshkov
2023-04-03 12:45 ` Thomas Zimmermann [this message]
2023-04-03 12:45 ` [PATCH v2 4/8] drm/msm: Remove struct msm_fbdev Thomas Zimmermann
2023-04-04 21:43 ` Dmitry Baryshkov
2023-04-03 12:45 ` [PATCH v2 5/8] drm/msm: Remove fbdev from struct msm_drm_private Thomas Zimmermann
2023-04-03 12:45 ` [PATCH v2 6/8] drm/msm: Move module parameter 'fbdev' to fbdev code Thomas Zimmermann
2023-04-04 21:44 ` Dmitry Baryshkov
2023-04-03 12:45 ` [PATCH v2 7/8] drm/msm: Initialize fbdev DRM client Thomas Zimmermann
2023-04-03 12:45 ` [PATCH v2 8/8] drm/msm: Implement fbdev emulation as in-kernel client Thomas Zimmermann
2023-04-04 21:46 ` Dmitry Baryshkov
2023-04-05 1:35 ` [PATCH v2 0/8] drm/msm: Convert fbdev to DRM client Dmitry Baryshkov
2023-04-05 7:13 ` Thomas Zimmermann
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=20230403124538.8497-4-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;
as well as URLs for NNTP newsgroup(s).