Skip to content

fix(drm): Default to XRGB8888 framebuffer #5851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

marex
Copy link
Contributor

@marex marex commented Mar 13, 2024

The ARGB8888 framebuffer format for base canvas makes little sense as the base canvas is unlikely to be transparent and require alpha. Use XRGB8888 framebuffer format which is more widely supported by DRM drivers as base plane pixel format.

This makes e.g. i.MX8M Nano work by default.


This is identical fix to lv_drivers lvgl/lv_drivers#282

The ARGB8888 framebuffer format for base canvas makes little sense
as the base canvas is unlikely to be transparent and require alpha.
Use XRGB8888 framebuffer format which is more widely supported by
DRM drivers as base plane pixel format.

This makes e.g. i.MX8M Nano work by default.

Signed-off-by: Marek Vasut <marex@denx.de>
---
This is identical fix to lv_drivers lvgl/lv_drivers#282
@marex marex force-pushed the drm_pixel_format_again branch from 6171cca to 73c941f Compare March 14, 2024 17:17
@marex marex requested review from PGNetHun and W-Mai March 14, 2024 20:41
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It really makes sense. And it's faster too!

@kisvegabor kisvegabor merged commit 765aac8 into lvgl:master Mar 16, 2024
kisvegabor pushed a commit to kisvegabor/lvgl_fork that referenced this pull request Mar 16, 2024
Co-authored-by: Marek Vasut <marex@denx.de>
@marex
Copy link
Contributor Author

marex commented Mar 17, 2024

It really makes sense. And it's faster too!

In the meantime, I can imagine one use case where base plane with alpha would make sense, chroma keying (single color background with some object in front), but in that case, I think the user would configure the library accordingly.

On which platform is XRGB8888 base plane faster than ARGB8888 ? Base plane alpha should be resolved in the CRTC only, since that would be the chroma key . Unless, on this platform where it is now faster, the alpha is handled by reading in two planes unconditionally , while without alpha only one plane is read , that might explain why it is faster without alpha .

@kisvegabor
Copy link
Member

Note that v9 doesn't support chroma keying. We have dropped it as it wasn't really used.

Rendering to ARGB8888 is slower in LVGL because when 2 colors are mixed LVGL needs to mix both the RGB colors and the alpha channel. As a reference this function mixes colors with and ARGB destination. And this is for an XRGRB8888.

@marex
Copy link
Contributor Author

marex commented Mar 19, 2024

Note that v9 doesn't support chroma keying. We have dropped it as it wasn't really used.

OK

Rendering to ARGB8888 is slower in LVGL because when 2 colors are mixed LVGL needs to mix both the RGB colors and the alpha channel.

I was writing about hardware variant of this, where the CRTC samples multiple input planes and does the mixing for you, this stuff:

There you can usually turn the input planes on/off , so the CRTC wouldn't sample them and waste DRAM bandwidth.

As a reference this function mixes colors with and ARGB destination. And this is for an XRGRB8888.

Right, sure, software blending is obviously going to be more expensive.

@kisvegabor
Copy link
Member

Yeah, I see. Blending the final ARGB layer is really done by the hardware. I mean only the process of LVGL rendering.

HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
Co-authored-by: Marek Vasut <marex@denx.de>
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
Co-authored-by: Marek Vasut <marex@denx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants