diff mbox series

[10/11] drm/tegra: Use drm_driver_legacy_fb_format() for fbdev

Message ID a40857fd77807f00b5c62c0fbe3f951e8bcb1099.1710698387.git.frej.drejhammar@gmail.com
State New
Headers show
Series drm: Only try to set formats supported by the hardware | expand

Commit Message

Frej Drejhammar March 17, 2024, 6:01 p.m. UTC
Switch to using drm_driver_legacy_fb_format() instead of
drm_mode_legacy_fb_format() to use the same logic as for the
DRM_IOCTL_MODE_ADDFB ioctl when selecting a framebuffer format.

Signed-off-by: Frej Drejhammar <frej.drejhammar@gmail.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: linux-tegra@vger.kernel.org

---

This is an evolved version of the changes proposed in "drm: Don't
return unsupported formats in drm_mode_legacy_fb_format" [1] following
the suggestions of Thomas Zimmermann.

[1] https://lore.kernel.org/all/20240310152803.3315-1-frej.drejhammar@gmail.com/
---
 drivers/gpu/drm/tegra/fbdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
index db6eaac3d30e..700ab02235f5 100644
--- a/drivers/gpu/drm/tegra/fbdev.c
+++ b/drivers/gpu/drm/tegra/fbdev.c
@@ -87,8 +87,9 @@  static int tegra_fbdev_probe(struct drm_fb_helper *helper,
 	cmd.pitches[0] = round_up(sizes->surface_width * bytes_per_pixel,
 				  tegra->pitch_align);
 
-	cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
-						     sizes->surface_depth);
+	cmd.pixel_format = drm_driver_legacy_fb_format(drm,
+						       sizes->surface_bpp,
+						       sizes->surface_depth);
 
 	size = cmd.pitches[0] * cmd.height;