Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/tegra: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()

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: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: linux-tegra@vger.kernel.org
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-17-ville.syrjala@linux.intel.com

+7 -3
+1
drivers/gpu/drm/tegra/drm.h
··· 185 185 int tegra_fb_get_tiling(struct drm_framebuffer *framebuffer, 186 186 struct tegra_bo_tiling *tiling); 187 187 struct drm_framebuffer *tegra_fb_alloc(struct drm_device *drm, 188 + const struct drm_format_info *info, 188 189 const struct drm_mode_fb_cmd2 *mode_cmd, 189 190 struct tegra_bo **planes, 190 191 unsigned int num_planes);
+3 -2
drivers/gpu/drm/tegra/fb.c
··· 102 102 }; 103 103 104 104 struct drm_framebuffer *tegra_fb_alloc(struct drm_device *drm, 105 + const struct drm_format_info *info, 105 106 const struct drm_mode_fb_cmd2 *mode_cmd, 106 107 struct tegra_bo **planes, 107 108 unsigned int num_planes) ··· 115 114 if (!fb) 116 115 return ERR_PTR(-ENOMEM); 117 116 118 - drm_helper_mode_fill_fb_struct(drm, fb, NULL, mode_cmd); 117 + drm_helper_mode_fill_fb_struct(drm, fb, info, mode_cmd); 119 118 120 119 for (i = 0; i < fb->format->num_planes; i++) 121 120 fb->obj[i] = &planes[i]->gem; ··· 167 166 planes[i] = to_tegra_bo(gem); 168 167 } 169 168 170 - fb = tegra_fb_alloc(drm, cmd, planes, i); 169 + fb = tegra_fb_alloc(drm, info, cmd, planes, i); 171 170 if (IS_ERR(fb)) { 172 171 err = PTR_ERR(fb); 173 172 goto unreference;
+3 -1
drivers/gpu/drm/tegra/fbdev.c
··· 106 106 return PTR_ERR(info); 107 107 } 108 108 109 - fb = tegra_fb_alloc(drm, &cmd, &bo, 1); 109 + fb = tegra_fb_alloc(drm, 110 + drm_get_format_info(drm, cmd.pixel_format, cmd.modifier[0]), 111 + &cmd, &bo, 1); 110 112 if (IS_ERR(fb)) { 111 113 err = PTR_ERR(fb); 112 114 dev_err(drm->dev, "failed to allocate DRM framebuffer: %d\n",