drm/gud: Fix endianness in gud_xrgb8888_to_color() helper
authorGeert Uytterhoeven <geert@linux-m68k.org>
Fri, 8 Jul 2022 18:21:09 +0000 (20:21 +0200)
committerNoralf Trønnes <noralf@tronnes.org>
Tue, 19 Jul 2022 14:17:31 +0000 (16:17 +0200)
commitfa2a87e4c5cea2beba9deabcbaf54d1979fff419
treefd33792fc8f8f1beeb9ac73544521830fab0b189
parent4d9db10576ff51afa8cf7727fbad55ada299359b
drm/gud: Fix endianness in gud_xrgb8888_to_color() helper

DRM formats are defined to be little-endian, unless the
DRM_FORMAT_BIG_ENDIAN flag is set.  Hence when converting from one
format to another, multi-byte pixel values loaded from memory must be
converted from little-endian to host-endian.  Conversely, multi-byte
pixel values written to memory must be converted from host-endian to
little-endian.  Currently only drm_fb_xrgb8888_to_rgb332_line() includes
endianness handling.

Fix gud_xrgb8888_to_color() on big-endian platforms by adding the
missing endianness handling.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/b47589ed5d8ca44e0956684412e3f16f3227f887.1657300532.git.geert@linux-m68k.org
drivers/gpu/drm/gud/gud_pipe.c