drm/format-helper: Simplify drm_fb_build_fourcc_list()
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 2 Jan 2023 11:29:26 +0000 (12:29 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 3 Jan 2023 13:27:39 +0000 (14:27 +0100)
commit29fca6d56d76363368d012e18b5631340cfcd69c
treef5490dfb6df45c62d313b9784a5d343797089b58
parent37c90d589dc06c1ae19b5eb4ed79e7a70ccc21bf
drm/format-helper: Simplify drm_fb_build_fourcc_list()

The DRM helper drm_fb_build_fourcc_list() creates a list of color
formats for primary planes of the generic drivers. Simplify the helper:

 - It used to mix and filter native and emulated formats as provided
   by the driver. Now the only emulated format is XRGB8888, which is
   required as fallback by legacy software. Drop support for emulating
   any other formats.
 - Also convert alpha formats to their non-alpha counterparts. Generic
   drivers don't support primary planes with alpha formats and some
   DTs incorrectly advertise alpha channels for non-alpha hardware. So
   only export non-alpha formats for primary planes.

With the simplified helper, scrap format lists of the affected generic
drivers. All they need is the firmware buffer's native format, from which
the helper creates the list of color formats.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102112927.26565-13-tzimmermann@suse.de
drivers/gpu/drm/drm_format_helper.c
drivers/gpu/drm/tiny/ofdrm.c
drivers/gpu/drm/tiny/simpledrm.c
include/drm/drm_format_helper.h