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

2022-10-16 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 th

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 15

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 l

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 int

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 reaso

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 take

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 cod

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 We

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, Thom

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 switc

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 w

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 display_get_big

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 Ma

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, stru

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

2022-10-11 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-11 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 d

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 th

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 LE

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 ad

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 > l

[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: