[PATCH i-g-t 1/2] lib/igt_kms: Add Colorspace connector property support

Swati Sharma
2026-04-27T10:46:59Z

Add IGT_CONNECTOR_COLORSPACE enum and its property name mapping, so
that tests can get/set the Colorspace connector property via the
standard IGT property helpers.

Also reset Colorspace to "Default" in igt_output_reset(), preventing
state leaks between subtests when a test changes the colorspace. The
reset is placed after HDR_OUTPUT_METADATA, consistent with the existing
property ordering.

Update the igt_display_reset() doc comment to list the new property.

Co-developed-by: Claude Opus 4.6 (Anthropic AI)
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
lib/igt_kms.c | 6 ++++++
lib/igt_kms.h | 1 +
2 files changed, 7 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 913116cd8..d92a10586 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -749,6 +749,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
[IGT_CONNECTOR_WRITEBACK_FB_ID] = "WRITEBACK_FB_ID",
[IGT_CONNECTOR_WRITEBACK_OUT_FENCE_PTR] = "WRITEBACK_OUT_FENCE_PTR",
[IGT_CONNECTOR_DITHERING_MODE] = "dithering mode",
+ [IGT_CONNECTOR_COLORSPACE] = "Colorspace",
};

const char * const igt_rotation_names[] = {
@@ -2761,6 +2762,10 @@ static void igt_output_reset(igt_output_t *output)
igt_output_set_prop_value(output,
IGT_CONNECTOR_HDR_OUTPUT_METADATA, 0);

+ if (igt_output_has_prop(output, IGT_CONNECTOR_COLORSPACE))
+ igt_output_set_prop_enum(output, IGT_CONNECTOR_COLORSPACE,
+ "Default");
+
if (igt_output_has_prop(output, IGT_CONNECTOR_WRITEBACK_FB_ID))
igt_output_set_prop_value(output, IGT_CONNECTOR_WRITEBACK_FB_ID, 0);
if (igt_output_has_prop(output, IGT_CONNECTOR_WRITEBACK_OUT_FENCE_PTR)) {
@@ -2784,6 +2789,7 @@ static void igt_output_reset(igt_output_t *output)
* - %IGT_CONNECTOR_BROADCAST_RGB (if applicable)
* %IGT_CONNECTOR_CONTENT_PROTECTION (if applicable)
* %IGT_CONNECTOR_HDR_OUTPUT_METADATA (if applicable)
+ * - %IGT_CONNECTOR_COLORSPACE (if applicable)
* - %IGT_CONNECTOR_DITHERING_MODE (if applicable)
* - igt_output_override_mode() to default.
*
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 5f9bdda45..3eda6fdc4 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -191,6 +191,7 @@ enum igt_atomic_connector_properties {
IGT_CONNECTOR_WRITEBACK_FB_ID,
IGT_CONNECTOR_WRITEBACK_OUT_FENCE_PTR,
IGT_CONNECTOR_DITHERING_MODE,
+ IGT_CONNECTOR_COLORSPACE,
IGT_NUM_CONNECTOR_PROPS
};

--
2.25.1