[PATCH v3 11/13] drm/fb-helper: Fix single-probe color-format selection

Thomas Zimmermann tzimmermann at suse.de
Mon May 15 09:26:38 UTC 2023


Hi

Am 15.05.23 um 10:59 schrieb Linus Walleij:
> On Mon, May 15, 2023 at 10:17 AM Thomas Zimmermann <tzimmermann at suse.de> wrote:
>> Am 15.05.23 um 10:01 schrieb Linus Walleij:
> 
>>> But the display is flickering like crazy so the updating frequency is
>>> totally off, which is because it does not scale down the resolution,
>>> the print used to be:
>>>
>>> Console: switching to colour frame buffer device 80x30
>>> drm-clcd-pl111 c1000000.display: [drm] fb0: pl111drmfb frame buffer device
>>>
>>> It is now:
>>>
>>> Console: switching to colour frame buffer device 100x37
>>> drm-clcd-pl111 c1000000.display: [drm] fb0: pl111drmfb frame buffer device
>>>
>>> 100x37! (i.e. 800x296), this display can only do 640x240.
>>> Any idea what else is going wrong here? Or is this another regression
>>> on top of the first regression ... I was under the impression that
>>> your change was only about formats not resolutions.
>>
>> If your display only supports 640x240, you should filter out all the
>> other modes in the driver, if necessary. To me, that seems fix-worthy in
>> any case.
> 
> I think I found this, the bandwidth limit calculation in
> drivers/gpu/drm/pl111/pl111_display.c was using the bpp from
> the config and this was decreased from 16 to 15 and as it determined
> cpp by dividing bpp/8 this decreased from 2 bytes to 1 byte.
> 
> Testing with DIV_ROUND_UP() in combination with the previous
> fix!

Great. It's the code in mode_valid, right? That fix should be good 
enough for now. In the long term, we could make some of the internal 
fb-helper code available to drivers. You'd then be able to use it to get 
the depth/bpp values for the color mode.

Best regards
Thomas

> 
> Yours,
> Linus Walleij

-- 
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230515/f25f8a59/attachment.sig>


More information about the dri-devel mailing list