mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices
@ 2024-07-02 12:17 Thomas Huth
  2024-07-02 12:29 ` Thomas Zimmermann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Huth @ 2024-07-02 12:17 UTC (permalink / raw)
  To: dri-devel, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Geert Uytterhoeven
  Cc: linux-kernel, David Airlie, Daniel Vetter,
	Javier Martinez Canillas, Thomas Huth

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>
---
 Note: Patch has only been compile-tested since I lack an environment
       for testing it. But it's the same fix as I required for the
       drm_mode_legacy_fb_format() in drm_fbdev_generic.c / drm_fbdev_ttm.c
       so I think this should be fine.

 drivers/gpu/drm/drm_fbdev_dma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index 97ef6300d47e..fdef4a2f883f 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -101,7 +101,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))
-- 
2.45.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices
  2024-07-02 12:17 [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices Thomas Huth
@ 2024-07-02 12:29 ` Thomas Zimmermann
  2024-07-02 12:34 ` Javier Martinez Canillas
  2024-07-08 14:31 ` Thomas Zimmermann
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2024-07-02 12:29 UTC (permalink / raw)
  To: Thomas Huth, dri-devel, Maarten Lankhorst, Maxime Ripard,
	Geert Uytterhoeven
  Cc: linux-kernel, David Airlie, Daniel Vetter, Javier Martinez Canillas

Hi

Am 02.07.24 um 14:17 schrieb Thomas Huth:
> 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>

Thank you for taking the time to make the patch for fbdev-dma. I'll take 
care of merging both patches into the correct branches.

Best regards
Thomas

> ---
>   Note: Patch has only been compile-tested since I lack an environment
>         for testing it. But it's the same fix as I required for the
>         drm_mode_legacy_fb_format() in drm_fbdev_generic.c / drm_fbdev_ttm.c
>         so I think this should be fine.
>
>   drivers/gpu/drm/drm_fbdev_dma.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
> index 97ef6300d47e..fdef4a2f883f 100644
> --- a/drivers/gpu/drm/drm_fbdev_dma.c
> +++ b/drivers/gpu/drm/drm_fbdev_dma.c
> @@ -101,7 +101,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))

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices
  2024-07-02 12:17 [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices Thomas Huth
  2024-07-02 12:29 ` Thomas Zimmermann
@ 2024-07-02 12:34 ` Javier Martinez Canillas
  2024-07-08 14:31 ` Thomas Zimmermann
  2 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2024-07-02 12:34 UTC (permalink / raw)
  To: Thomas Huth, dri-devel, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Geert Uytterhoeven
  Cc: linux-kernel, David Airlie, Daniel Vetter, Thomas Huth

Thomas Huth <thuth@redhat.com> writes:

Hello Thomas,

> 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>
> ---
>  Note: Patch has only been compile-tested since I lack an environment
>        for testing it. But it's the same fix as I required for the
>        drm_mode_legacy_fb_format() in drm_fbdev_generic.c / drm_fbdev_ttm.c
>        so I think this should be fine.
>
>  drivers/gpu/drm/drm_fbdev_dma.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
> index 97ef6300d47e..fdef4a2f883f 100644
> --- a/drivers/gpu/drm/drm_fbdev_dma.c
> +++ b/drivers/gpu/drm/drm_fbdev_dma.c
> @@ -101,7 +101,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))

Makes sense to me.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices
  2024-07-02 12:17 [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices Thomas Huth
  2024-07-02 12:29 ` Thomas Zimmermann
  2024-07-02 12:34 ` Javier Martinez Canillas
@ 2024-07-08 14:31 ` Thomas Zimmermann
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2024-07-08 14:31 UTC (permalink / raw)
  To: Thomas Huth, dri-devel, Maarten Lankhorst, Maxime Ripard,
	Geert Uytterhoeven
  Cc: linux-kernel, David Airlie, Daniel Vetter, Javier Martinez Canillas

Hi,

I've added a Fixes tag and merged the patch into drm-misc-next-fixes.

Best regards
Thomas

Am 02.07.24 um 14:17 schrieb Thomas Huth:
> 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>
> ---
>   Note: Patch has only been compile-tested since I lack an environment
>         for testing it. But it's the same fix as I required for the
>         drm_mode_legacy_fb_format() in drm_fbdev_generic.c / drm_fbdev_ttm.c
>         so I think this should be fine.
>
>   drivers/gpu/drm/drm_fbdev_dma.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
> index 97ef6300d47e..fdef4a2f883f 100644
> --- a/drivers/gpu/drm/drm_fbdev_dma.c
> +++ b/drivers/gpu/drm/drm_fbdev_dma.c
> @@ -101,7 +101,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))

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-08 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-02 12:17 [PATCH] drm/fbdev-dma: Fix framebuffer mode for big endian devices Thomas Huth
2024-07-02 12:29 ` Thomas Zimmermann
2024-07-02 12:34 ` Javier Martinez Canillas
2024-07-08 14:31 ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®