From: Harry Wentland <harry.wentland@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>
Subject: [RFC PATCH v2 03/11] tests/kms_colorop_helper: Add helpers to get encoding/range from CSC FF name
Date: Mon, 30 Mar 2026 11:35:10 -0400 [thread overview]
Message-ID: <20260330153518.99898-4-harry.wentland@amd.com> (raw)
In-Reply-To: <20260330153518.99898-1-harry.wentland@amd.com>
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
tests/kms_colorop_helper.c | 30 ++++++++++++++++++++++++++++++
tests/kms_colorop_helper.h | 4 ++++
2 files changed, 34 insertions(+)
diff --git a/tests/kms_colorop_helper.c b/tests/kms_colorop_helper.c
index 4832c0f4eb23..4e9205a291a7 100644
--- a/tests/kms_colorop_helper.c
+++ b/tests/kms_colorop_helper.c
@@ -473,3 +473,33 @@ void reset_colorops(kms_colorop_t *colorops[])
for(i = 0; colorops[i]; i++)
reset_colorop(colorops[i]);
}
+
+static const struct {
+ const char *name;
+ enum igt_color_encoding encoding;
+ enum igt_color_range range;
+} csc_ff_type_map[] = {
+ { "YUV601 to RGB601", IGT_COLOR_YCBCR_BT601, IGT_COLOR_YCBCR_FULL_RANGE },
+ { "YUV709 to RGB709", IGT_COLOR_YCBCR_BT709, IGT_COLOR_YCBCR_FULL_RANGE },
+ { "YUV2020 to RGB2020", IGT_COLOR_YCBCR_BT2020, IGT_COLOR_YCBCR_FULL_RANGE },
+ { "YUV601 Limited to RGB601", IGT_COLOR_YCBCR_BT601, IGT_COLOR_YCBCR_LIMITED_RANGE },
+ { "YUV709 Limited to RGB709", IGT_COLOR_YCBCR_BT709, IGT_COLOR_YCBCR_LIMITED_RANGE },
+ { "YUV2020 Limited to RGB2020", IGT_COLOR_YCBCR_BT2020, IGT_COLOR_YCBCR_LIMITED_RANGE },
+};
+
+void csc_ff_type_to_encoding_range(const char *csc_ff_type_name,
+ enum igt_color_encoding *encoding,
+ enum igt_color_range *range)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(csc_ff_type_map); i++) {
+ if (!strcmp(csc_ff_type_name, csc_ff_type_map[i].name)) {
+ *encoding = csc_ff_type_map[i].encoding;
+ *range = csc_ff_type_map[i].range;
+ return;
+ }
+ }
+
+ igt_assert_f(false, "Unknown CSC FF type: %s\n", csc_ff_type_name);
+}
diff --git a/tests/kms_colorop_helper.h b/tests/kms_colorop_helper.h
index 6e8843b7b651..23b9b7eecca8 100644
--- a/tests/kms_colorop_helper.h
+++ b/tests/kms_colorop_helper.h
@@ -115,4 +115,8 @@ void set_color_pipeline(igt_display_t *display,
void set_color_pipeline_bypass(igt_plane_t *plane);
void reset_colorops(kms_colorop_t *colorops[]);
+void csc_ff_type_to_encoding_range(const char *csc_ff_type_name,
+ enum igt_color_encoding *encoding,
+ enum igt_color_range *range);
+
#endif /* __KMS_COLOROP_HELPER_H__ */
--
2.53.0
next prev parent reply other threads:[~2026-03-30 15:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 15:35 [RFC PATCH v2 00/11] YUV Conversion Colorop tests Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 01/11] include/drm-uapi: Add DRM_COLOROP_CSC_FF and drm_colorop_csc_ff_type Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 02/11] lib/igt_kms, tests/kms_colorop_helper: Add CSC FF colorop infrastructure Harry Wentland
2026-03-30 15:35 ` Harry Wentland [this message]
2026-03-30 15:35 ` [RFC PATCH v2 04/11] lib/igt_fb: Add YUV color pattern framebuffer support Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 05/11] lib/igt_color_encoding: Add XRGB2101010 format support Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 06/11] lib/igt_color: Add YUV pixel reading support Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 07/11] lib/igt_color: Refactor transform_pixels for input/output FBs and CSC Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 08/11] tests/kms_colorop: Add CSC FF colorop tests Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 09/11] tests/kms_colorop: Keep CRTC active between YUV tests with temp FB Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 10/11] tests/kms_colorop: Add bypass transition tests Harry Wentland
2026-03-30 15:35 ` [RFC PATCH v2 11/11] tests/kms_colorop: Increase VKMS bracket to 3 up Harry Wentland
2026-03-31 3:38 ` ✓ Xe.CI.BAT: success for YUV Conversion Colorop tests Patchwork
2026-03-31 3:57 ` ✓ i915.CI.BAT: " Patchwork
2026-03-31 13:21 ` ✓ i915.CI.Full: " 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=20260330153518.99898-4-harry.wentland@amd.com \
--to=harry.wentland@amd.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