drm/exynos: Remove exynos_gem from struct exynos_drm_fbdev
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 30 Mar 2023 07:36:31 +0000 (09:36 +0200)
committerInki Dae <inki.dae@samsung.com>
Mon, 17 Apr 2023 07:47:54 +0000 (16:47 +0900)
Fbdev's framebuffer stores a pointer to the GEM object. Remove
struct exynos_drm_fbdev.exynos_gem, which contains the same value.
No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_fbdev.c

index 4929ffe..f11895d 100644 (file)
@@ -16,6 +16,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
+#include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_prime.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/exynos_drm.h>
 
 struct exynos_drm_fbdev {
        struct drm_fb_helper    drm_fb_helper;
-       struct exynos_drm_gem   *exynos_gem;
 };
 
-static int exynos_drm_fb_mmap(struct fb_info *info,
-                       struct vm_area_struct *vma)
+static int exynos_drm_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
        struct drm_fb_helper *helper = info->par;
-       struct exynos_drm_fbdev *exynos_fbd = to_exynos_fbdev(helper);
-       struct exynos_drm_gem *exynos_gem = exynos_fbd->exynos_gem;
+       struct drm_gem_object *obj = drm_gem_fb_get_obj(helper->fb, 0);
 
-       return drm_gem_prime_mmap(&exynos_gem->base, vma);
+       return drm_gem_prime_mmap(obj, vma);
 }
 
 static const struct fb_ops exynos_drm_fb_ops = {
@@ -89,7 +87,6 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
 static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
                                    struct drm_fb_helper_surface_size *sizes)
 {
-       struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper);
        struct exynos_drm_gem *exynos_gem;
        struct drm_device *dev = helper->dev;
        struct drm_mode_fb_cmd2 mode_cmd = { 0 };
@@ -113,8 +110,6 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
        if (IS_ERR(exynos_gem))
                return PTR_ERR(exynos_gem);
 
-       exynos_fbdev->exynos_gem = exynos_gem;
-
        helper->fb =
                exynos_drm_framebuffer_init(dev, &mode_cmd, &exynos_gem, 1);
        if (IS_ERR(helper->fb)) {