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: [PATCH i-g-t, v5 3/7] tests/kms_colorop_helper: Add Fixed Matrix enum names table
Date: Tue, 1 Sep 2026 00:59:31 +0530 [thread overview]
Message-ID: <20260831192935.463134-4-swati2.sharma@intel.com> (raw)
In-Reply-To: <20260831192935.463134-1-swati2.sharma@intel.com>
Add kms_colorop_fixed_matrix_t enum and kms_colorop_fixed_matrix_names[]
lookup table for FIXED_MATRIX type strings, replacing raw string
literals in colorop instances.
This follows the same pattern used by kms_colorop_lut1d_tf_names[] for
1D LUT transfer functions.
Also, adds missing encoding/range to bt2020_limited instance.
Suggested-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Assisted-by: GitHub Copilot
---
tests/kms_colorop_helper.c | 24 ++++++++++++++++++------
tests/kms_colorop_helper.h | 14 +++++++++++++-
2 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/tests/kms_colorop_helper.c b/tests/kms_colorop_helper.c
index f58f629f5..2e97d6abf 100644
--- a/tests/kms_colorop_helper.c
+++ b/tests/kms_colorop_helper.c
@@ -19,6 +19,15 @@ const char * const kms_colorop_lut1d_tf_names[KMS_COLOROP_LUT1D_NUM_ENUMS] = {
[KMS_COLOROP_LUT1D_GAMMA_2_2_INV_OETF] = "Gamma 2.2 Inverse",
};
+const char * const kms_colorop_fixed_matrix_names[KMS_COLOROP_FIXED_MATRIX_NUM_ENUMS] = {
+ [KMS_COLOROP_FIXED_MATRIX_YCBCR601_FULL_RGB] = "YCbCr 601 Full to RGB",
+ [KMS_COLOROP_FIXED_MATRIX_YCBCR601_LIMITED_RGB] = "YCbCr 601 Limited to RGB",
+ [KMS_COLOROP_FIXED_MATRIX_YCBCR709_FULL_RGB] = "YCbCr 709 Full to RGB",
+ [KMS_COLOROP_FIXED_MATRIX_YCBCR709_LIMITED_RGB] = "YCbCr 709 Limited to RGB",
+ [KMS_COLOROP_FIXED_MATRIX_YCBCR2020_NC_FULL_RGB] = "YCbCr 2020 NC Full to RGB",
+ [KMS_COLOROP_FIXED_MATRIX_YCBCR2020_NC_LIMITED_RGB] = "YCbCr 2020 NC Limited to RGB",
+};
+
kms_colorop_t kms_colorop_srgb_eotf = {
.type = KMS_COLOROP_ENUMERATED_LUT1D,
.enumerated_lut1d_info = {
@@ -204,7 +213,7 @@ kms_colorop_t kms_colorop_3dlut_17_12_rgb = {
kms_colorop_t kms_colorop_bt709_limited_ycbcr_to_rgb = {
.type = KMS_COLOROP_FIXED_MATRIX,
.fixed_matrix_info = {
- .fixed_matrix_type_name = "YCbCr 709 Limited to RGB",
+ .fixed_matrix = KMS_COLOROP_FIXED_MATRIX_YCBCR709_LIMITED_RGB,
.encoding = IGT_COLOR_YCBCR_BT709,
.range = IGT_COLOR_YCBCR_LIMITED_RANGE,
},
@@ -215,7 +224,7 @@ kms_colorop_t kms_colorop_bt709_limited_ycbcr_to_rgb = {
kms_colorop_t kms_colorop_bt709_full_ycbcr_to_rgb = {
.type = KMS_COLOROP_FIXED_MATRIX,
.fixed_matrix_info = {
- .fixed_matrix_type_name = "YCbCr 709 Full to RGB",
+ .fixed_matrix = KMS_COLOROP_FIXED_MATRIX_YCBCR709_FULL_RGB,
.encoding = IGT_COLOR_YCBCR_BT709,
.range = IGT_COLOR_YCBCR_FULL_RANGE,
},
@@ -226,7 +235,7 @@ kms_colorop_t kms_colorop_bt709_full_ycbcr_to_rgb = {
kms_colorop_t kms_colorop_bt601_limited_ycbcr_to_rgb = {
.type = KMS_COLOROP_FIXED_MATRIX,
.fixed_matrix_info = {
- .fixed_matrix_type_name = "YCbCr 601 Limited to RGB",
+ .fixed_matrix = KMS_COLOROP_FIXED_MATRIX_YCBCR601_LIMITED_RGB,
.encoding = IGT_COLOR_YCBCR_BT601,
.range = IGT_COLOR_YCBCR_LIMITED_RANGE,
},
@@ -237,7 +246,9 @@ kms_colorop_t kms_colorop_bt601_limited_ycbcr_to_rgb = {
kms_colorop_t kms_colorop_bt2020_limited_ycbcr_to_rgb = {
.type = KMS_COLOROP_FIXED_MATRIX,
.fixed_matrix_info = {
- .fixed_matrix_type_name = "YCbCr 2020 Limited to RGB NC",
+ .fixed_matrix = KMS_COLOROP_FIXED_MATRIX_YCBCR2020_NC_LIMITED_RGB,
+ .encoding = IGT_COLOR_YCBCR_BT2020,
+ .range = IGT_COLOR_YCBCR_LIMITED_RANGE,
},
.name = "YCbCr BT.2020 Limited Range to RGB",
.transform = NULL,
@@ -263,7 +274,8 @@ 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_3D_LUT);
case KMS_COLOROP_FIXED_MATRIX:
if (igt_colorop_get_prop(display, colorop, IGT_COLOROP_TYPE) == DRM_COLOROP_FIXED_MATRIX &&
- igt_colorop_try_prop_enum(colorop, IGT_COLOROP_FIXED_MATRIX_TYPE, desired->fixed_matrix_info.fixed_matrix_type_name))
+ igt_colorop_try_prop_enum(colorop, IGT_COLOROP_FIXED_MATRIX_TYPE,
+ kms_colorop_fixed_matrix_names[desired->fixed_matrix_info.fixed_matrix]))
return true;
return false;
default:
@@ -412,7 +424,7 @@ static void set_colorop(igt_display_t *display, kms_colorop_t *colorop)
break;
case KMS_COLOROP_FIXED_MATRIX:
igt_colorop_set_prop_enum(colorop->colorop, IGT_COLOROP_FIXED_MATRIX_TYPE,
- colorop->fixed_matrix_info.fixed_matrix_type_name);
+ kms_colorop_fixed_matrix_names[colorop->fixed_matrix_info.fixed_matrix]);
break;
default:
igt_fail(IGT_EXIT_FAILURE);
diff --git a/tests/kms_colorop_helper.h b/tests/kms_colorop_helper.h
index 9a1477666..dd76e1991 100644
--- a/tests/kms_colorop_helper.h
+++ b/tests/kms_colorop_helper.h
@@ -51,8 +51,20 @@ typedef struct kms_colorop_lut3d_info {
enum drm_colorop_lut3d_interpolation_type interpolation;
} kms_colorop_lut3d_info_t;
+typedef enum kms_colorop_fixed_matrix {
+ KMS_COLOROP_FIXED_MATRIX_YCBCR601_FULL_RGB,
+ KMS_COLOROP_FIXED_MATRIX_YCBCR601_LIMITED_RGB,
+ KMS_COLOROP_FIXED_MATRIX_YCBCR709_FULL_RGB,
+ KMS_COLOROP_FIXED_MATRIX_YCBCR709_LIMITED_RGB,
+ KMS_COLOROP_FIXED_MATRIX_YCBCR2020_NC_FULL_RGB,
+ KMS_COLOROP_FIXED_MATRIX_YCBCR2020_NC_LIMITED_RGB,
+ KMS_COLOROP_FIXED_MATRIX_NUM_ENUMS
+} kms_colorop_fixed_matrix_t;
+
+extern const char * const kms_colorop_fixed_matrix_names[KMS_COLOROP_FIXED_MATRIX_NUM_ENUMS];
+
typedef struct kms_colorop_fixed_matrix_info {
- const char *fixed_matrix_type_name;
+ kms_colorop_fixed_matrix_t fixed_matrix;
enum igt_color_encoding encoding;
enum igt_color_range range;
} kms_colorop_fixed_matrix_info_t;
--
2.25.1
next prev parent reply other threads:[~2026-08-31 19:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 19:29 [PATCH i-g-t,v5 0/7] Add FIXED_MATRIX colorop tests Swati Sharma
2026-08-31 19:29 ` [PATCH i-g-t, v5 1/7] lib/igt_kms: Rename IGT_COLOROP_FIXED_MATRIX to IGT_COLOROP_FIXED_MATRIX_TYPE Swati Sharma
2026-09-09 10:27 ` Borah, Chaitanya Kumar
2026-08-31 19:29 ` [PATCH i-g-t, v5 2/7] lib/igt_kms: Order IGT_COLOROP_FIXED_MATRIX_TYPE before IGT_COLOROP_NEXT Swati Sharma
2026-09-09 10:27 ` [PATCH i-g-t,v5 " Borah, Chaitanya Kumar
2026-08-31 19:29 ` Swati Sharma [this message]
2026-09-09 10:28 ` [PATCH i-g-t,v5 3/7] tests/kms_colorop_helper: Add Fixed Matrix enum names table Borah, Chaitanya Kumar
2026-08-31 19:29 ` [PATCH i-g-t, v5 4/7] tests/kms_color_pipeline: Add FIXED_MATRIX colorop tests Swati Sharma
2026-09-09 10:29 ` [PATCH i-g-t,v5 " Borah, Chaitanya Kumar
2026-08-31 19:29 ` [PATCH i-g-t, v5 5/7] tests/kms_color_pipeline: Remove unused color_depth and drm_format Swati Sharma
2026-08-31 19:29 ` [PATCH i-g-t, v5 6/7] tests/kms_chamelium_color_pipeline: Add FIXED_MATRIX colorop tests Swati Sharma
2026-09-09 10:29 ` [PATCH i-g-t,v5 " Borah, Chaitanya Kumar
2026-08-31 19:29 ` [PATCH i-g-t, v5 7/7] tests/chamelium/kms_chamelium_color_pipeline: Fix CRTC naming Swati Sharma
2026-09-09 10:30 ` [PATCH i-g-t,v5 " Borah, Chaitanya Kumar
2026-09-01 19:21 ` ✓ Xe.CI.BAT: success for Add FIXED_MATRIX colorop tests (rev5) Patchwork
2026-09-01 19:51 ` ✓ i915.CI.BAT: " Patchwork
2026-09-02 5:27 ` ✗ 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=20260831192935.463134-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