[igt-dev] [PATCH] tests: Skip tests using LUTs when the driver doesn't support it.

Mark Yacoub markyacoub at chromium.org
Tue Nov 16 17:31:31 UTC 2021


From: Mark Yacoub <markyacoub at google.com>

[Why]
Some drivers such as msm do not support CTM and their CRTC doesn't have
LUT props. Tests should skip relevant tests when it's not supported.

[How]
Check for the LUT pipe prop before starting relevant subtest.

Tested on Trogdor (msm)

Signed-off-by: Mark Yacoub <markyacoub at chromium.org>
---
 tests/kms_color.c |  8 ++++++++
 tests/kms_plane.c | 52 ++++++++++++++++++++++++++++-------------------
 2 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 775f3596..99a59cd8 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -905,6 +905,14 @@ igt_main
 	}
 
 	for_each_pipe_static(pipe) {
+		igt_fixture {
+			igt_require_f(igt_pipe_has_prop(&data.display, pipe,
+											IGT_CRTC_GAMMA_LUT) &&
+								igt_pipe_has_prop(&data.display, pipe,
+												IGT_CRTC_DEGAMMA_LUT),
+							"Driver doesn't support CTM.\n");
+		}
+
 		igt_subtest_group
 			run_tests_for_pipe(&data, pipe);
 
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 405d4c21..d82214ed 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -1090,28 +1090,38 @@ run_tests_for_pipe_plane(data_t *data)
 		igt_require(data->display.pipes[pipe].n_planes > 0);
 	}
 
-	igt_describe("verify the pixel formats for given plane and pipe");
-	igt_subtest_with_dynamic_f("pixel-format") {
-		count = 0;
-		for_each_pipe(&data->display, pipe) {
-			igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe))
-				test_pixel_formats(data, pipe);
-			if (is_pipe_limit_reached(++count))
-				break;
-		}
-	}
-	igt_describe("verify the pixel formats for given plane and pipe with source clamping");
-	igt_subtest_with_dynamic_f("pixel-format-source-clamping") {
-		count = 0;
-		for_each_pipe(&data->display, pipe) {
-			igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe)) {
-				data->crop = 4;
-				test_pixel_formats(data, pipe);
+		igt_describe("Verify the pixel formats for given plane and pipe");
+		igt_subtest_group {
+			igt_fixture {
+				igt_require_f(igt_pipe_has_prop(&data->display, pipe,
+												IGT_CRTC_GAMMA_LUT) &&
+								  igt_pipe_has_prop(&data->display, pipe,
+													IGT_CRTC_DEGAMMA_LUT),
+							  "Driver doesn't support CTM.\n");
 			}
-			if (is_pipe_limit_reached(++count))
-				break;
-		}
-	}
+
+			igt_subtest_with_dynamic_f("pixel-format") {
+				count = 0;
+				for_each_pipe(&data->display, pipe) {
+					igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe))
+						test_pixel_formats(data, pipe);
+					if (is_pipe_limit_reached(++count))
+						break;
+				}
+			}
+		    igt_subtest_with_dynamic_f("pixel-format-source-clamping") {
+				count = 0;
+				for_each_pipe(&data->display, pipe) {
+				    igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe)) {
+						data->crop = 4;
+						test_pixel_formats(data, pipe);
+				    }
+				    if (is_pipe_limit_reached(++count))
+						break;
+				}
+		    }
+        }
+
 
 	data->crop = 0;
 	igt_describe("verify plane position using two planes to create a fully covered screen");
-- 
2.34.0.rc1.387.gb447b232ab-goog



More information about the igt-dev mailing list