Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-17 Thread Javier Martinez Canillas
Thomas Zimmermann writes: [...] >> >> stride = DIV_ROUND_UP(si->lfb_width * bits_per_pixel, 8) > > I'd rather keep the code as-is until we get an actual bug report. > Ok. After all if the pixel format is chosen correctly, the reported line length should match anyways. So is really a corner

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-17 Thread Thomas Zimmermann
Hi Am 17.04.23 um 10:58 schrieb Javier Martinez Canillas: Thomas Zimmermann writes: Hi, thanks a lot to both of you for this bug fix. Am 13.04.23 um 03:34 schrieb Pierre Asselin: (not tested) Tested. It fixes the regression on my laptop. diff --git a/drivers/firmware/sysfb_simplefb.c

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-17 Thread Javier Martinez Canillas
Thomas Zimmermann writes: > Hi, > > thanks a lot to both of you for this bug fix. > > Am 13.04.23 um 03:34 schrieb Pierre Asselin: >>> (not tested) >> >> Tested. It fixes the regression on my laptop. >> >>> diff --git a/drivers/firmware/sysfb_simplefb.c >>> b/drivers/firmware/sysfb_simplefb.c

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-17 Thread Thomas Zimmermann
Hi, thanks a lot to both of you for this bug fix. Am 13.04.23 um 03:34 schrieb Pierre Asselin: (not tested) Tested. It fixes the regression on my laptop. diff --git a/drivers/firmware/sysfb_simplefb.c b/drivers/firmware/sysfb_simplefb.c index 82c64cb9f531..9f5299d54732 100644 --- a/drivers

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-13 Thread Javier Martinez Canillas
"Pierre Asselin" writes: >> diff --git a/drivers/firmware/sysfb_simplefb.c >> b/drivers/firmware/sysfb_simplefb.c >> index 82c64cb9f531..0ab8c542b1f5 100644 >> --- a/drivers/firmware/sysfb_simplefb.c >> +++ b/drivers/firmware/sysfb_simplefb.c >> @@ -55,14 +55,10 @@ __init bool sysfb_parse_mode(co

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-13 Thread Pierre Asselin
> diff --git a/drivers/firmware/sysfb_simplefb.c > b/drivers/firmware/sysfb_simplefb.c > index 82c64cb9f531..0ab8c542b1f5 100644 > --- a/drivers/firmware/sysfb_simplefb.c > +++ b/drivers/firmware/sysfb_simplefb.c > @@ -55,14 +55,10 @@ __init bool sysfb_parse_mode(const struct screen_info > *si, >

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-13 Thread Javier Martinez Canillas
"Pierre Asselin" writes: >> p...@panix.com (Pierre Asselin) writes: [...] >>> - bits_per_pixel = max(max3(si->red_size + si->red_pos, >>> + bits_per_pixel = max3(max3(si->red_size + si->red_pos, >>> si->green_size + si->green_pos, >>>

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-13 Thread Pierre Asselin
> p...@panix.com (Pierre Asselin) writes: > >> After careful reading of the comments in f35cd3fa7729, would this >> be an appropriate fix ? Does it still address all the issues raised >> by Thomas ? >> >> (not tested) >> >> diff --git a/drivers/firmware/sysfb_simplefb.c >> b/drivers/firmware/sysfb

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-13 Thread Javier Martinez Canillas
p...@panix.com (Pierre Asselin) writes: > After careful reading of the comments in f35cd3fa7729, would this > be an appropriate fix ? Does it still address all the issues raised > by Thomas ? > > (not tested) > > diff --git a/drivers/firmware/sysfb_simplefb.c > b/drivers/firmware/sysfb_simplefb.

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Javier Martinez Canillas
"Pierre Asselin" writes: [...] > [3.343433] sysfb: si->rsvd_size 0 si->rsvd_pos 0 Thanks for confirming this. I was expected that as mentioned since it was the only reasonable explanation for your problem. [...] > What if _depth is low but the rsvd_ are right ? > Then _width and _lineleng

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Pierre Asselin
> (not tested) Tested. It fixes the regression on my laptop. > diff --git a/drivers/firmware/sysfb_simplefb.c > b/drivers/firmware/sysfb_simplefb.c > index 82c64cb9f531..9f5299d54732 100644 > --- a/drivers/firmware/sysfb_simplefb.c > +++ b/drivers/firmware/sysfb_simplefb.c > @@ -56,10 +56,11 @@

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Pierre Asselin
After careful reading of the comments in f35cd3fa7729, would this be an appropriate fix ? Does it still address all the issues raised by Thomas ? (not tested) diff --git a/drivers/firmware/sysfb_simplefb.c b/drivers/firmware/sysfb_simplefb.c index 82c64cb9f531..9f5299d54732 100644 --- a/drivers

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Pierre Asselin
(Okay, can't back out *all* of the first patch, just the assignment to mode->stride.) Anyway, here you go: grub: gfxpayload=keep [0.00] Console: colour dummy device 128x48 [0.00] printk: console [tty0] enabled [0.419983] fbcon: Taking over console [0.516198] pci :01:05

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Javier Martinez Canillas
"Pierre Asselin" writes: >> Javier Martinez Canillas writes: >> >> I still don't understand why this particular configuration didn't work... >> >> The framebuffer starts at 0xd800 and has a size of 0x24 bytes, so > > Says who ? It's the same grub, same video mode as before the regressio

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Pierre Asselin
> Javier Martinez Canillas writes: > > I still don't understand why this particular configuration didn't work... > > The framebuffer starts at 0xd800 and has a size of 0x24 bytes, so Says who ? It's the same grub, same video mode as before the regression, so the size is probably 0x30

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Javier Martinez Canillas
Javier Martinez Canillas writes: [...] >> == Bad after patch, typing blind to log in !== >> grub: gfxpayload=keep >> [0.00] Console: colour dummy device 128x48 >> [0.00] printk: console [tty0] enabled >> [0.423925] fbcon: Taking over console >> [0.

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Javier Martinez Canillas
"Pierre Asselin" writes: >> And can you share the "linelength=" print out from simplefb ? > > Okay. Three cases, see below. > > Your patch tries to fix the stride, but what if it's the _depth_ > that's wrong ? Grub sets the mode, the pre-regression kernel picks this: > format=x8r8g8b8, mode

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Pierre Asselin
> And can you share the "linelength=" print out from simplefb ? Okay. Three cases, see below. Your patch tries to fix the stride, but what if it's the _depth_ that's wrong ? Grub sets the mode, the pre-regression kernel picks this: format=x8r8g8b8, mode=1024x768x32, linelength=4096 ===

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Javier Martinez Canillas
On Wed, Apr 12, 2023 at 8:12 PM Pierre Asselin wrote: > > > > Interesting. So you don't have the simplefb output that you had before ? > > I do now, after a 'make clean' and "make bzImage'. > > In between, I had tried CONFIG_SYSFB_SIMPLEFB=n . That "works", by > falling back to vesafb in every ca

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Pierre Asselin
> Interesting. So you don't have the simplefb output that you had before ? I do now, after a 'make clean' and "make bzImage'. In between, I had tried CONFIG_SYSFB_SIMPLEFB=n . That "works", by falling back to vesafb in every case. I restored the .config before testing the patch, but there mus

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Javier Martinez Canillas
"Pierre Asselin" writes: >> The commit f35cd3fa7729 ("firmware/sysfb: Fix EFI/VESA format selection") >> fixed format selection, by calculating the bits-per-pixel instead of just >> using the reported color depth. >> >> But unfortunately this broke some modes because the stride is always set >> t

Re: [PATCH] firmware/sysfb: Fix wrong stride when bits-per-pixel is calculated

2023-04-12 Thread Pierre Asselin
> The commit f35cd3fa7729 ("firmware/sysfb: Fix EFI/VESA format selection") > fixed format selection, by calculating the bits-per-pixel instead of just > using the reported color depth. > > But unfortunately this broke some modes because the stride is always set > to the reported line length (in by