]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: 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:12 +0000 (12:07 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 16 Jul 2025 17:07:03 +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.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-10-ville.syrjala@linux.intel.com
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index 866e17fd76fd25bb70089d3ee2e7682c647c02c9..51bab32fd8c6fcd41378744668be0bc578b5714e 100644 (file)
@@ -1196,13 +1196,14 @@ static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb
 static int amdgpu_display_gem_fb_verify_and_init(struct drm_device *dev,
                                                 struct amdgpu_framebuffer *rfb,
                                                 struct drm_file *file_priv,
+                                                const struct drm_format_info *info,
                                                 const struct drm_mode_fb_cmd2 *mode_cmd,
                                                 struct drm_gem_object *obj)
 {
        int ret;
 
        rfb->base.obj[0] = obj;
-       drm_helper_mode_fill_fb_struct(dev, &rfb->base, NULL, mode_cmd);
+       drm_helper_mode_fill_fb_struct(dev, &rfb->base, info, mode_cmd);
        /* Verify that the modifier is supported. */
        if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format,
                                      mode_cmd->modifier[0])) {
@@ -1331,7 +1332,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
        }
 
        ret = amdgpu_display_gem_fb_verify_and_init(dev, amdgpu_fb, file_priv,
-                                                   mode_cmd, obj);
+                                                   info, mode_cmd, obj);
        if (ret) {
                kfree(amdgpu_fb);
                drm_gem_object_put(obj);