public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: chaitanya.kumar.borah@intel.com, Swati Sharma <swati2.sharma@intel.com>
Subject: [RFC PATCH i-g-t 3/5] tests/kms_colorop_helper: Add CSC_FF colorop support
Date: Mon, 30 Mar 2026 17:20:55 +0530	[thread overview]
Message-ID: <20260330115057.963395-4-swati2.sharma@intel.com> (raw)
In-Reply-To: <20260330115057.963395-1-swati2.sharma@intel.com>

Add KMS_COLOROP_CSC_FF type and helpers for configuring fixed-function
CSC colorops. The CSC_FF block selects from predefined hardware modes
via the CSC_FF_TYPE enum property rather than programmable coefficients.

Supported CSC_FF modes:
  - YUV601 to RGB601
  - YUV709 to RGB709
  - YUV2020 to RGB2020
  - RGB709 to RGB2020

Extends can_use_colorop(), set_colorop(), and reset_colorop() to
handle the new CSC_FF type, and adds the CSC_FF enum name table.

Co-developed-by: Claude Opus 4.6
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_colorop_helper.c | 19 +++++++++++++++++++
 tests/kms_colorop_helper.h | 19 ++++++++++++++++++-
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/tests/kms_colorop_helper.c b/tests/kms_colorop_helper.c
index aaee4e567..5424645ef 100644
--- a/tests/kms_colorop_helper.c
+++ b/tests/kms_colorop_helper.c
@@ -200,6 +200,13 @@ kms_colorop_t kms_colorop_3dlut_17_12_rgb = {
 	.transform = &igt_color_3dlut_17_12_rgb,
 };
 
+const char * const kms_colorop_csc_ff_names[KMS_COLOROP_CSC_FF_NUM_ENUMS] = {
+	[KMS_COLOROP_CSC_FF_YUV601_RGB601] = "YUV601 to RGB601",
+	[KMS_COLOROP_CSC_FF_YUV709_RGB709] = "YUV709 to RGB709",
+	[KMS_COLOROP_CSC_FF_YUV2020_RGB2020] = "YUV2020 to RGB2020",
+	[KMS_COLOROP_CSC_FF_RGB709_RGB2020] = "RGB709 to RGB2020",
+};
+
 static bool can_use_colorop(igt_display_t *display, igt_colorop_t *colorop, kms_colorop_t *desired)
 {
 	switch (desired->type) {
@@ -218,6 +225,13 @@ static bool can_use_colorop(igt_display_t *display, igt_colorop_t *colorop, kms_
 		return (igt_colorop_get_prop(display, colorop, IGT_COLOROP_TYPE) == DRM_COLOROP_MULTIPLIER);
 	case KMS_COLOROP_LUT3D:
 		return (igt_colorop_get_prop(display, colorop, IGT_COLOROP_TYPE) == DRM_COLOROP_3D_LUT);
+	case KMS_COLOROP_CSC_FF:
+		if (igt_colorop_get_prop(display, colorop, IGT_COLOROP_TYPE) == DRM_COLOROP_CSC_FF &&
+		    igt_colorop_has_prop(colorop, IGT_COLOROP_CSC_FF_TYPE) &&
+		    igt_colorop_try_prop_enum(colorop, IGT_COLOROP_CSC_FF_TYPE,
+					    kms_colorop_csc_ff_names[desired->csc_ff_info.csc_ff]))
+			return true;
+		return false;
 	default:
 		return false;
 	}
@@ -362,6 +376,10 @@ static void set_colorop(igt_display_t *display, kms_colorop_t *colorop)
 
 		configure_3dlut(display, colorop, lut_size);
 		break;
+	case KMS_COLOROP_CSC_FF:
+		igt_colorop_set_prop_enum(colorop->colorop, IGT_COLOROP_CSC_FF_TYPE,
+					  kms_colorop_csc_ff_names[colorop->csc_ff_info.csc_ff]);
+		break;
 	default:
 		igt_fail(IGT_EXIT_FAILURE);
 	}
@@ -416,6 +434,7 @@ static void reset_colorop(kms_colorop_t *colorop)
 		igt_colorop_set_prop_value(colorop->colorop, IGT_COLOROP_MULTIPLIER, 1);
 		break;
 	case KMS_COLOROP_ENUMERATED_LUT1D:
+	case KMS_COLOROP_CSC_FF:
 	default:
 		return;
 	}
diff --git a/tests/kms_colorop_helper.h b/tests/kms_colorop_helper.h
index a081fa02d..92e598ba6 100644
--- a/tests/kms_colorop_helper.h
+++ b/tests/kms_colorop_helper.h
@@ -22,7 +22,8 @@ typedef enum kms_colorop_type {
 	KMS_COLOROP_CUSTOM_LUT1D,
 	KMS_COLOROP_CTM_3X4,
 	KMS_COLOROP_MULTIPLIER,
-	KMS_COLOROP_LUT3D
+	KMS_COLOROP_LUT3D,
+	KMS_COLOROP_CSC_FF,
 } kms_colorop_type_t;
 
 typedef enum kms_colorop_lut1d_tf {
@@ -50,6 +51,18 @@ typedef struct kms_colorop_lut3d_info {
 	enum drm_colorop_lut3d_interpolation_type interpolation;
 } kms_colorop_lut3d_info_t;
 
+typedef enum kms_colorop_csc_ff {
+	KMS_COLOROP_CSC_FF_YUV601_RGB601,
+	KMS_COLOROP_CSC_FF_YUV709_RGB709,
+	KMS_COLOROP_CSC_FF_YUV2020_RGB2020,
+	KMS_COLOROP_CSC_FF_RGB709_RGB2020,
+	KMS_COLOROP_CSC_FF_NUM_ENUMS
+} kms_colorop_csc_ff_t;
+
+typedef struct kms_colorop_csc_ff_info {
+	kms_colorop_csc_ff_t csc_ff;
+} kms_colorop_csc_ff_info_t;
+
 typedef struct kms_colorop {
 	kms_colorop_type_t type;
 
@@ -61,6 +74,8 @@ typedef struct kms_colorop {
 		double multiplier;
 	};
 
+	kms_colorop_csc_ff_info_t csc_ff_info;
+
 	kms_colorop_lut3d_info_t lut3d_info;
 
 	const char *name;
@@ -95,6 +110,8 @@ extern kms_colorop_t kms_colorop_multiply_125;
 extern kms_colorop_t kms_colorop_multiply_inv_125;
 extern kms_colorop_t kms_colorop_3dlut_17_12_rgb;
 
+extern const char * const kms_colorop_csc_ff_names[KMS_COLOROP_CSC_FF_NUM_ENUMS];
+
 igt_colorop_t *get_color_pipeline(igt_display_t *display,
 			          igt_plane_t *plane,
 				  kms_colorop_t *colorops[]);
-- 
2.25.1


  parent reply	other threads:[~2026-03-30 11:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 11:50 [RFC PATCH i-g-t 0/5] Add CSC Fixed-Function (CSC_FF) colorop tests Swati Sharma
2026-03-30 11:50 ` [RFC PATCH i-g-t 1/5] include/drm-uapi: Add DRM_COLOROP_CSC_FF definition Swati Sharma
2026-03-30 11:50 ` [RFC PATCH i-g-t 2/5] lib/igt_kms: Add CSC_FF_TYPE colorop property Swati Sharma
2026-03-30 11:50 ` Swati Sharma [this message]
2026-03-30 11:50 ` [RFC PATCH i-g-t 4/5] tests/kms_color_pipeline: Add CSC_FF colorop tests Swati Sharma
2026-03-30 11:50 ` [RFC PATCH i-g-t 5/5] tests/kms_color_pipeline: Remove unused color_depth and drm_format Swati Sharma
2026-03-31  2:55 ` ✓ i915.CI.BAT: success for Add CSC Fixed-Function (CSC_FF) colorop tests Patchwork
2026-03-31  2:56 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-31  7:45 ` ✓ Xe.CI.FULL: " Patchwork
2026-03-31 11:35 ` ✗ i915.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260330115057.963395-4-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox