]> git.baikalelectronics.ru Git - kernel.git/commit
drm/format-helper: Add RGB888-to-XRGB8888 conversion
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 25 Apr 2022 07:59:38 +0000 (09:59 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 27 Apr 2022 06:51:57 +0000 (08:51 +0200)
commit2c0b5c69e2c97178fdf2aec4de0f8f542f8f2cbd
tree787a5a2a4558fe6c36e8dd2f4d10492c308c48bc
parenta2d73b7c2d149c99daef3956e1a520078266bd1d
drm/format-helper: Add RGB888-to-XRGB8888 conversion

Add a format helper that converts RGB888 to XRGB8888. Use this
function in drm_fb_blit_toio(). Fixes simpledrm output for this
combination of formats.

UEFI and/or Grub will usually set 32-bit output in XRGB8888 format.
The issue can be reproduced by enabling simpledrm and requesting a
console framebuffer of different format on the kernel command line;
for example

  nomodeset video=1024x768-24

In this case, conversion helpers will display nothing on the console.
The patch makes this work by implementing the rsp conversion helpers.
It also enables odd userspace configurations, such as running Xorg
with 24-bit color depth on a 32-bit output buffer.

v2:
* use helpers for struct drm_rect (Javier)
* improve commit message (Javier)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220425075939.30450-3-tzimmermann@suse.de
drivers/gpu/drm/drm_format_helper.c