]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/vkms: Create KUnit tests for YUV conversions
authorArthur Grillo <arthurgrillo@riseup.net>
Tue, 15 Apr 2025 13:55:37 +0000 (15:55 +0200)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Wed, 28 May 2025 14:19:14 +0000 (16:19 +0200)
commit3e897853debde269ab01f0d3d28c3e7b37bf2c39
tree64b4a674de3b77055707fb1519c72dd02a39baec
parent11d435b81e5dd2cc48daa2d3d71a19bcbc46e807
drm/vkms: Create KUnit tests for YUV conversions

Create KUnit tests to test the conversion between YUV and RGB. Test each
conversion and range combination with some common colors.

The code used to compute the expected result can be found in comment.

[Louis Chauvet:
- fix minor formating issues (whitespace, double line)
- change expected alpha from 0x0000 to 0xffff
- adapt to the new get_conversion_matrix usage
- apply the changes from Arthur
- move struct pixel_yuv_u8 to the test itself]

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250415-yuv-v18-6-f2918f71ec4b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
drivers/gpu/drm/vkms/tests/Makefile
drivers/gpu/drm/vkms/tests/vkms_format_test.c [new file with mode: 0644]
drivers/gpu/drm/vkms/vkms_formats.c
drivers/gpu/drm/vkms/vkms_formats.h