drm/format-helper: Split off byte swapping from drm_fb_xrgb8888_to_rgb565()
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 25 Jun 2025 11:48:22 +0000 (13:48 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Fri, 27 Jun 2025 13:59:23 +0000 (15:59 +0200)
commit8ad00a81d769ad81aac0ef65a4adbc2f53169b3c
tree5d3a66b6b3c28252f51248bfaaa421d1a5f5a764
parentb462b0ef4d788d56f0e575406e58450358dcbd96
drm/format-helper: Split off byte swapping from drm_fb_xrgb8888_to_rgb565()

Move big-endian support from drm_fb_xrgb8888_to_rgb565() into the new
helper drm_xrgb8888_to_rgb565be(). The functionality is required for
displays with big-endian byte order. Update all callers.

With the change applied, drm_fb_xrgb8888_to_rgb565() has the same
signature as the other conversion functions, which is required for
further updates to drm_fb_blit(). Also makes the format-conversion
helper available to panic handlers, if necessary.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250625114911.1121301-1-tzimmermann@suse.de
drivers/gpu/drm/drm_format_helper.c
drivers/gpu/drm/drm_format_internal.h
drivers/gpu/drm/drm_mipi_dbi.c
drivers/gpu/drm/gud/gud_pipe.c
drivers/gpu/drm/tests/drm_format_helper_test.c
include/drm/drm_format_helper.h