drm/format-helper: Add conversion from XRGB8888 to 15-bit RGB555 formats
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 2 Jan 2023 11:29:23 +0000 (12:29 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 3 Jan 2023 13:26:05 +0000 (14:26 +0100)
commit10cd592e639edcea50d781a07edcf3470d1f222e
tree66b88126edfe640d988fe3845883cc7fd4bbf9a7
parent56119bfb39142090fb84ac08a3f14dd48410e961
drm/format-helper: Add conversion from XRGB8888 to 15-bit RGB555 formats

Add conversion from XRGB8888 to XRGB1555, ARGB1555 and RGBA5551, which
are the formats currently supported by the simplefb infrastructure. The
new helpers allow the output of XRGB8888 framebuffers to firmware
scanout buffers in one of the 15-bit formats.

v3:
* use __le* for destination buffers (Jose, kernel test robot)
v2:
* test 15-bit results with local endianness (Jose)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102112927.26565-10-tzimmermann@suse.de
drivers/gpu/drm/drm_format_helper.c
drivers/gpu/drm/tests/drm_format_helper_test.c
include/drm/drm_format_helper.h