[igt-dev] [PATCH i-g-t v2 13/13] igt: tests: chamelium: Add YUV formats tests

Maxime Ripard
2019-01-08T15:20:06Z

The NV12, NV16, NV21, NV61, YUV420, YVU420, YUV422 and YVU422 are YUV
formats that are currently supported in IGT.

We'll want to test those formats in addition to the RGB formats, so
let's add some subtests. One thing worth noting is some hardware isn't
able to output a pixel-perfect image, so we do the same kind of
comparison than for VGA.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
tests/kms_chamelium.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index eaea9c18832a..64f87d3ae474 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -977,6 +977,38 @@ igt_main
test_display_one_mode(&data, port, DRM_FORMAT_XRGB1555,
CHAMELIUM_CHECK_CRC, 1);

+ connector_subtest("hdmi-cmp-nv12", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_NV12,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
+ connector_subtest("hdmi-cmp-nv16", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_NV16,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
+ connector_subtest("hdmi-cmp-nv21", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_NV21,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
+ connector_subtest("hdmi-cmp-nv61", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_NV61,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
+ connector_subtest("hdmi-cmp-yu12", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_YUV420,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
+ connector_subtest("hdmi-cmp-yu16", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_YUV422,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
+ connector_subtest("hdmi-cmp-yv12", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_YVU420,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
+ connector_subtest("hdmi-cmp-yv16", HDMIA)
+ test_display_one_mode(&data, port, DRM_FORMAT_YVU422,
+ CHAMELIUM_CHECK_ANALOG, 1);
+
connector_subtest("hdmi-frame-dump", HDMIA)
test_display_frame_dump(&data, port);
}
--
2.20.1