drm/format-helper: Add generic conversion to 24-bit formats
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 28 Mar 2025 14:14:59 +0000 (15:14 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 1 Apr 2025 13:35:21 +0000 (15:35 +0200)
commitf46bf57299b0a8395263de0bcfcb72a600adaae9
tree0464fa5dbab7dd75c15700c534c94a68284c1388
parentd55d0b066f4eedf030c9c1a67a2a0abffece3abc
drm/format-helper: Add generic conversion to 24-bit formats

Add drm_fb_xfrm_line_32to24() to implement conversion from 32-bit
pixels to 24-bit pixels. The pixel-conversion is specified by the
given callback parameter. Mark the helper as always_inline to avoid
overhead from function calls.

Then implement all existing line-conversion functions with the new
generic call and the respective pixel-conversion helper.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250328141709.217283-4-tzimmermann@suse.de
drivers/gpu/drm/drm_format_helper.c
drivers/gpu/drm/drm_format_internal.h