drm/format-helper: Fix test on big endian architectures
authorJosé Expósito <jose.exposito89@gmail.com>
Tue, 26 Jul 2022 23:09:13 +0000 (01:09 +0200)
committerJosé Expósito <jose.exposito89@gmail.com>
Thu, 28 Jul 2022 16:36:43 +0000 (18:36 +0200)
commit18c8485236a5e3f491b670c018ae391c9cb84dfa
treecfe7b52dbbb4708db42bff7535cdb6708aea0592
parent8e61cbd483aee6ac6be9f5821e1bf22bed0710ff
drm/format-helper: Fix test on big endian architectures

The tests fail on big endian architectures, like PowerPC:

 $ ./tools/testing/kunit/kunit.py run \
   --kunitconfig=drivers/gpu/drm/tests \
   --arch=powerpc --cross_compile=powerpc64-linux-gnu-

Transform the XRGB8888 buffer from little endian to the CPU endian
before calling the conversion function to avoid this error.

Fixes: 8f456104915f ("drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb332()")
Reported-by: David Gow <davidgow@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220726230916.390575-2-jose.exposito89@gmail.com
drivers/gpu/drm/tests/drm_format_helper_test.c