Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-17 Thread Benjamin Herrenschmidt
On Thu, 2022-10-13 at 09:39 +0200, Javier Martinez Canillas wrote: > > In absence of such test results I think the most reasonable thing is to > > keep the logic that nobody complained about for 10+ years. > > > > I agree with Michal and Thomas on this. I don't see a strong reason to not > use

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-13 Thread Ville Syrjälä
On Wed, Oct 12, 2022 at 04:31:14PM +0200, Thomas Zimmermann wrote: > Hi > > Am 12.10.22 um 15:12 schrieb Arnd Bergmann: > > On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote: > >> > >> Could well be. But ofdrm intents to replace offb and this test has > >> worked well in offb for almost

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-13 Thread Javier Martinez Canillas
Hello, On 10/12/22 16:27, Michal Suchánek wrote: [...] >> >> If you are using the framebuffer code from vga.c, I would guess that >> that you can run a big-endian kernel with qemu-system-ppc64, >> or a little-endian kernel with qemu-system-ppc64le and get the >> correct colors, while running a

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Michal Suchánek
On Wed, Oct 12, 2022 at 05:59:45PM +0300, Ville Syrjälä wrote: > On Wed, Oct 12, 2022 at 04:31:14PM +0200, Thomas Zimmermann wrote: > > Hi > > > > Am 12.10.22 um 15:12 schrieb Arnd Bergmann: > > > On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote: > > >> > > >> Could well be. But ofdrm

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Thomas Zimmermann
Hi Am 12.10.22 um 15:12 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote: Could well be. But ofdrm intents to replace offb and this test has worked well in offb for almost 15 yrs. If there are bug reports, I'm happy to take patches, but until then I see no

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Michal Suchánek
Hello, On Wed, Oct 12, 2022 at 03:12:35PM +0200, Arnd Bergmann wrote: > On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote: > > > > Could well be. But ofdrm intents to replace offb and this test has > > worked well in offb for almost 15 yrs. If there are bug reports, I'm > > happy to

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Arnd Bergmann
On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote: > > Could well be. But ofdrm intents to replace offb and this test has > worked well in offb for almost 15 yrs. If there are bug reports, I'm > happy to take patches, but until then I see no reason to change it. I wouldn't change the

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Michal Suchánek
On Wed, Oct 12, 2022 at 10:38:29AM +0200, Arnd Bergmann wrote: > On Wed, Oct 12, 2022, at 10:27 AM, Thomas Zimmermann wrote: > > Am 12.10.22 um 09:44 schrieb Arnd Bergmann: > >> On Wed, Oct 12, 2022, at 9:40 AM, Thomas Zimmermann wrote: > >>> Am 12.10.22 um 09:17 schrieb Arnd Bergmann: > On

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Thomas Zimmermann
Hi Am 12.10.22 um 10:38 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 10:27 AM, Thomas Zimmermann wrote: Am 12.10.22 um 09:44 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 9:40 AM, Thomas Zimmermann wrote: Am 12.10.22 um 09:17 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 8:46 AM,

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Arnd Bergmann
On Wed, Oct 12, 2022, at 10:27 AM, Thomas Zimmermann wrote: > Am 12.10.22 um 09:44 schrieb Arnd Bergmann: >> On Wed, Oct 12, 2022, at 9:40 AM, Thomas Zimmermann wrote: >>> Am 12.10.22 um 09:17 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 8:46 AM, Thomas Zimmermann wrote: >>> Does qemu

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Thomas Zimmermann
Hi Am 12.10.22 um 09:44 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 9:40 AM, Thomas Zimmermann wrote: Am 12.10.22 um 09:17 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 8:46 AM, Thomas Zimmermann wrote: Does qemu mark the device has having a particular endianess then, or does it

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Arnd Bergmann
On Wed, Oct 12, 2022, at 9:40 AM, Thomas Zimmermann wrote: > Am 12.10.22 um 09:17 schrieb Arnd Bergmann: >> On Wed, Oct 12, 2022, at 8:46 AM, Thomas Zimmermann wrote: > >> Does qemu mark the device has having a particular endianess then, or >> does it switch the layout of the framebuffer to match

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Thomas Zimmermann
Hi Am 12.10.22 um 09:17 schrieb Arnd Bergmann: On Wed, Oct 12, 2022, at 8:46 AM, Thomas Zimmermann wrote: Am 11.10.22 um 22:06 schrieb Arnd Bergmann: On Tue, Oct 11, 2022, at 1:30 PM, Thomas Zimmermann wrote: Am 11.10.22 um 09:46 schrieb Javier Martinez Canillas: +static bool

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Michal Suchánek
On Wed, Oct 12, 2022 at 08:29:39AM +0200, Arnd Bergmann wrote: > On Tue, Oct 11, 2022, at 11:38 PM, Michal Suchánek wrote: > > On Tue, Oct 11, 2022 at 10:06:59PM +0200, Arnd Bergmann wrote: > >> On Tue, Oct 11, 2022, at 1:30 PM, Thomas Zimmermann wrote: > >> > Am 11.10.22 um 09:46 schrieb Javier

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Arnd Bergmann
On Wed, Oct 12, 2022, at 8:46 AM, Thomas Zimmermann wrote: > Am 11.10.22 um 22:06 schrieb Arnd Bergmann: >> On Tue, Oct 11, 2022, at 1:30 PM, Thomas Zimmermann wrote: >>> Am 11.10.22 um 09:46 schrieb Javier Martinez Canillas: > +static bool display_get_big_endian_of(struct drm_device *dev,

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Thomas Zimmermann
Hi Am 11.10.22 um 22:06 schrieb Arnd Bergmann: On Tue, Oct 11, 2022, at 1:30 PM, Thomas Zimmermann wrote: Am 11.10.22 um 09:46 schrieb Javier Martinez Canillas: +static bool display_get_big_endian_of(struct drm_device *dev, struct device_node *of_node) +{ + bool big_endian; + +#ifdef

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-12 Thread Arnd Bergmann
On Tue, Oct 11, 2022, at 11:38 PM, Michal Suchánek wrote: > On Tue, Oct 11, 2022 at 10:06:59PM +0200, Arnd Bergmann wrote: >> On Tue, Oct 11, 2022, at 1:30 PM, Thomas Zimmermann wrote: >> > Am 11.10.22 um 09:46 schrieb Javier Martinez Canillas: >> >>> +static bool display_get_big_endian_of(struct

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-11 Thread Michal Suchánek
On Tue, Oct 11, 2022 at 10:06:59PM +0200, Arnd Bergmann wrote: > On Tue, Oct 11, 2022, at 1:30 PM, Thomas Zimmermann wrote: > > Am 11.10.22 um 09:46 schrieb Javier Martinez Canillas: > >>> +static bool display_get_big_endian_of(struct drm_device *dev, struct > >>> device_node *of_node) > >>> +{ >

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-11 Thread Arnd Bergmann
On Tue, Oct 11, 2022, at 1:30 PM, Thomas Zimmermann wrote: > Am 11.10.22 um 09:46 schrieb Javier Martinez Canillas: >>> +static bool display_get_big_endian_of(struct drm_device *dev, struct >>> device_node *of_node) >>> +{ >>> + bool big_endian; >>> + >>> +#ifdef __BIG_ENDIAN >>> + big_endian

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-11 Thread Thomas Zimmermann
Hi Am 11.10.22 um 09:46 schrieb Javier Martinez Canillas: Hello Thomas, On 9/28/22 12:50, Thomas Zimmermann wrote: All DRM formats assume little-endian byte order. On big-endian systems, it is likely that the scanout buffer is in big endian as well. Update You say it is likely, not always

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-11 Thread Javier Martinez Canillas
Hello Thomas, On 9/28/22 12:50, Thomas Zimmermann wrote: > All DRM formats assume little-endian byte order. On big-endian systems, > it is likely that the scanout buffer is in big endian as well. Update You say it is likely, not always then? Does it depend on whether the Open Firmware is BE or

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-09-28 Thread Thomas Zimmermann
Hi Am 28.09.22 um 13:12 schrieb Michal Suchánek: Hello, On Wed, Sep 28, 2022 at 12:50:10PM +0200, Thomas Zimmermann wrote: All DRM formats assume little-endian byte order. On big-endian systems, it is likely that the scanout buffer is in big endian as well. Update the format accordingly and

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-09-28 Thread Michal Suchánek
Hello, On Wed, Sep 28, 2022 at 12:50:10PM +0200, Thomas Zimmermann wrote: > All DRM formats assume little-endian byte order. On big-endian systems, > it is likely that the scanout buffer is in big endian as well. Update > the format accordingly and add endianess conversion to the format-helper >

[PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-09-28 Thread Thomas Zimmermann
All DRM formats assume little-endian byte order. On big-endian systems, it is likely that the scanout buffer is in big endian as well. Update the format accordingly and add endianess conversion to the format-helper library. Also opt-in to allocated buffers in host format by default. Suggested-by: