]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/fbdev-dma: Fix framebuffer mode for big endian devices
authorThomas Huth <thuth@redhat.com>
Tue, 2 Jul 2024 12:17:37 +0000 (14:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Aug 2024 07:00:43 +0000 (09:00 +0200)
commit cb31c58e8c294ff31ea842ee1fa2c06c9a9f1cc3 upstream.

The drm_mode_legacy_fb_format() function only generates formats suitable
for little endian devices. switch to drm_driver_legacy_fb_format() here
instead to take the device endianness into consideration, too.

Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 6ae2ff23aa43 ("drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2()")
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: <stable@vger.kernel.org> # v6.7+
Link: https://patchwork.freedesktop.org/patch/msgid/20240702121737.522878-1-thuth@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_fbdev_dma.c

index 13cd754af311d1e6d280bacb295679a78d56f52a..77695339e4d4cc8827adaed5ca46551b5b3f7dbf 100644 (file)
@@ -90,7 +90,8 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
                    sizes->surface_width, sizes->surface_height,
                    sizes->surface_bpp);
 
-       format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
+       format = drm_driver_legacy_fb_format(dev, sizes->surface_bpp,
+                                            sizes->surface_depth);
        buffer = drm_client_framebuffer_create(client, sizes->surface_width,
                                               sizes->surface_height, format);
        if (IS_ERR(buffer))