[PATCH i-g-t v1 3/5] tests/kms_flip: Add CTM testing support to kms_flip

Naladala Ramanaidu ramanaidu.naladala at intel.com
Thu Aug 7 07:31:47 UTC 2025


Adds a new test flag to enable color transformation matrix (CTM)
testing, including setup and cleanup logic during test execution.

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
 tests/kms_flip.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 74e0d1a89..231d8ffa5 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -260,6 +260,7 @@
 
 #define TEST_DEGAMMA		(1 << 17)
 #define TEST_GAMMA		(1 << 25)
+#define TEST_CTM		(1 << 27)
 
 #define EVENT_FLIP		(1 << 0)
 #define EVENT_VBLANK		(1 << 1)
@@ -1653,6 +1654,19 @@ restart:
 		}
 	}
 
+	if (o->flags & TEST_CTM) {
+		if (igt_pipe_obj_has_prop(pipe, IGT_CRTC_CTM)) {
+			static const double ctm_identity[] = {
+				1.0, 0.0, 0.0,
+				0.0, 1.0, 0.0,
+				0.0, 0.0, 1.0,
+			};
+
+			set_ctm(pipe, ctm_identity);
+			igt_display_commit(&display);
+		}
+	}
+
 	paint_flip_mode(&o->fb_info[0], false);
 	if (!(o->flags & TEST_BO_TOOBIG))
 		paint_flip_mode(&o->fb_info[1], true);
@@ -1724,6 +1738,10 @@ retry:
 				free_lut(gamma_full);
 			}
 
+			if (o->flags & TEST_CTM) {
+				disable_ctm(pipe);
+			}
+
 			igt_display_commit(&display);
 		}
 		igt_assert(!retried);
@@ -1785,6 +1803,10 @@ retry:
 				free_lut(gamma_full);
 			}
 
+			if (o->flags & TEST_CTM) {
+				disable_ctm(pipe);
+			}
+
 			igt_display_commit(&display);
 		}
 
@@ -1819,6 +1841,10 @@ out:
 		free_lut(gamma_full);
 	}
 
+	if (o->flags & TEST_CTM) {
+		disable_ctm(pipe);
+	}
+
 	igt_display_commit(&display);
 
 	last_connector = NULL;
-- 
2.43.0



More information about the Intel-gfx-trybot mailing list