From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jason-JH Lin <jason-jh.lin@mediatek.com>
Cc: igt-dev@lists.freedesktop.org,
Karthik B S <karthik.b.s@intel.com>,
Swati Sharma <swati2.sharma@intel.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
Bhanuprakash Modem <bhanuprakash.modem@gmail.com>,
Fei Shao <fshao@chromium.org>, Jani <jani.nikula@intel.com>,
Paul-PL Chen <paul-pl.chen@mediatek.com>,
Nancy Lin <nancy.lin@mediatek.com>,
Singo Chang <singo.chang@mediatek.com>,
Gil Dekel <gildekel@google.com>, Yacoub <markyacoub@chromium.org>,
Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH i-g-t 1/2] test/kms_color: Clamp CTM values to -2.0~2.0 for MediaTek devices
Date: Thu, 29 Jan 2026 13:15:13 +0200 [thread overview]
Message-ID: <aXtBQd_hHu3OgCG6@intel.com> (raw)
In-Reply-To: <20260128082517.920321-2-jason-jh.lin@mediatek.com>
On Wed, Jan 28, 2026 at 04:24:42PM +0800, Jason-JH Lin wrote:
> Use clamp to restrict CTM matrix values to the -2.0 to 2.0 range for
> MediaTek devices, ensuring tests do not exceed hardware limits.
>
> Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> ---
> tests/kms_color.c | 19 +++++++++++++++++--
> 1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index b2ca6975d6a5..c6cd35d74a2f 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -76,6 +76,8 @@
> * @gamma-lut: Gamma LUT
> */
>
> +#define CTM_SIZE (9)
> +
> IGT_TEST_DESCRIPTION("Test Color Features at Pipe level");
>
> static bool test_pipe_degamma(data_t *data,
> @@ -1025,7 +1027,7 @@ run_tests_for_pipe(data_t *data)
> const char *name;
> int iter;
> const color_t *fb_colors;
> - double ctm[9];
> + double ctm[CTM_SIZE];
> const char *desc;
> } ctm_tests[] = {
> { .name = "ctm-red-to-blue",
> @@ -1128,6 +1130,19 @@ run_tests_for_pipe(data_t *data)
> }
>
> for (i = 0; i < ARRAY_SIZE(ctm_tests); i++) {
> + double fixed_ctm[CTM_SIZE];
> + const double *ctm_ptr = ctm_tests[i].ctm;
> +
> + /* The valid value of MediaTek color matrix range is -2.0 ~ 2.0 */
> + if (is_mtk_device(data->drm_fd)) {
> + int j;
> +
> + for (j = 0; j < CTM_SIZE; j++)
> + fixed_ctm[j] = clamp(ctm_tests[i].ctm[j], -2.0, 2.0);
> +
> + ctm_ptr = fixed_ctm;
> + }
The kernel is supposed to clamp this.
> +
> igt_describe_f("%s", ctm_tests[i].desc);
> igt_subtest_with_dynamic_f("%s", ctm_tests[i].name) {
> for_each_pipe_with_valid_output(&data->display, pipe, data->output) {
> @@ -1135,7 +1150,7 @@ run_tests_for_pipe(data_t *data)
> igt_output_name(data->output))
> run_ctm_tests_for_pipe(data, pipe,
> ctm_tests[i].fb_colors,
> - ctm_tests[i].ctm,
> + ctm_ptr,
> ctm_tests[i].iter);
> if (igt_run_in_simulation())
> break;
> --
> 2.43.0
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2026-01-29 11:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 8:24 [PATCH i-g-t 0/2] Add MediaTek CTM color test support Jason-JH Lin
2026-01-28 8:24 ` [PATCH i-g-t 1/2] test/kms_color: Clamp CTM values to -2.0~2.0 for MediaTek devices Jason-JH Lin
2026-01-29 11:00 ` Kamil Konieczny
2026-01-29 11:15 ` Ville Syrjälä [this message]
2026-01-29 11:42 ` Kamil Konieczny
2026-01-30 13:32 ` Jason-JH Lin (林睿祥)
2026-01-30 15:19 ` Ville Syrjälä
2026-01-31 11:52 ` Jason-JH Lin (林睿祥)
2026-02-10 17:28 ` Ville Syrjälä
2026-02-11 10:51 ` Jason-JH Lin (林睿祥)
2026-02-11 12:44 ` Kamil Konieczny
2026-01-28 8:24 ` [PATCH i-g-t 2/2] tests/kms_color: Add 10-bit color depth support to CTM test for MediaTek Jason-JH Lin
2026-01-29 11:07 ` Kamil Konieczny
2026-01-28 9:50 ` ✓ Xe.CI.BAT: success for Add MediaTek CTM color test support Patchwork
2026-01-28 10:57 ` ✓ i915.CI.BAT: " Patchwork
2026-01-28 16:12 ` ✗ i915.CI.Full: failure " Patchwork
2026-01-29 11:09 ` Kamil Konieczny
2026-02-10 10:15 ` [PATCH i-g-t 0/2] " Jason-JH Lin (林睿祥)
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=aXtBQd_hHu3OgCG6@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=bhanuprakash.modem@gmail.com \
--cc=fshao@chromium.org \
--cc=gildekel@google.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=jason-jh.lin@mediatek.com \
--cc=juhapekka.heikkila@gmail.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=karthik.b.s@intel.com \
--cc=markyacoub@chromium.org \
--cc=nancy.lin@mediatek.com \
--cc=paul-pl.chen@mediatek.com \
--cc=singo.chang@mediatek.com \
--cc=swati2.sharma@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.