]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/exynos: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_s...
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 1 Jul 2025 09:07:14 +0000 (12:07 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 16 Jul 2025 17:07:55 +0000 (20:07 +0300)
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.

For the fbdev case a manual drm_get_format_info() lookup
is needed.

Cc: Inki Dae <inki.dae@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-12-ville.syrjala@linux.intel.com
drivers/gpu/drm/exynos/exynos_drm_fb.c
drivers/gpu/drm/exynos/exynos_drm_fb.h
drivers/gpu/drm/exynos/exynos_drm_fbdev.c

index 7091d31835ec41043bf3a8fd33256600a5633ea4..ddd73e7f26a352f90cae47c53bab1d09a99d3c86 100644 (file)
@@ -56,6 +56,7 @@ static const struct drm_framebuffer_funcs exynos_drm_fb_funcs = {
 
 struct drm_framebuffer *
 exynos_drm_framebuffer_init(struct drm_device *dev,
+                           const struct drm_format_info *info,
                            const struct drm_mode_fb_cmd2 *mode_cmd,
                            struct exynos_drm_gem **exynos_gem,
                            int count)
@@ -76,7 +77,7 @@ exynos_drm_framebuffer_init(struct drm_device *dev,
                fb->obj[i] = &exynos_gem[i]->base;
        }
 
-       drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd);
+       drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd);
 
        ret = drm_framebuffer_init(dev, fb, &exynos_drm_fb_funcs);
        if (ret < 0) {
@@ -124,7 +125,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
                }
        }
 
-       fb = exynos_drm_framebuffer_init(dev, mode_cmd, exynos_gem, i);
+       fb = exynos_drm_framebuffer_init(dev, info, mode_cmd, exynos_gem, i);
        if (IS_ERR(fb)) {
                ret = PTR_ERR(fb);
                goto err;
index 2f841bbdddc55db9f6f4cf4a943283963d28d835..fdc6cb40cc9c97d54a19de18fad55dd6a89b6070 100644 (file)
@@ -14,6 +14,7 @@
 
 struct drm_framebuffer *
 exynos_drm_framebuffer_init(struct drm_device *dev,
+                           const struct drm_format_info *info,
                            const struct drm_mode_fb_cmd2 *mode_cmd,
                            struct exynos_drm_gem **exynos_gem,
                            int count);
index 9526a25e90ac710a767b7c717041c59731e57fb8..93de25b77e68616a759f6b6696f5ae13a69c011f 100644 (file)
@@ -116,7 +116,10 @@ int exynos_drm_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
                return PTR_ERR(exynos_gem);
 
        helper->fb =
-               exynos_drm_framebuffer_init(dev, &mode_cmd, &exynos_gem, 1);
+               exynos_drm_framebuffer_init(dev,
+                                           drm_get_format_info(dev, mode_cmd.pixel_format,
+                                                               mode_cmd.modifier[0]),
+                                           &mode_cmd, &exynos_gem, 1);
        if (IS_ERR(helper->fb)) {
                DRM_DEV_ERROR(dev->dev, "failed to create drm framebuffer.\n");
                ret = PTR_ERR(helper->fb);