From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Jay Liu <jay.liu@mediatek.com>, <igt-dev@lists.freedesktop.org>
Cc: Jason-JH Lin <jason-jh.lin@mediatek.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 v1] tests/kms_color: Add 10-bit color depth support to gamma test for MediaTek
Date: Thu, 26 Mar 2026 01:06:05 +0530 [thread overview]
Message-ID: <40842d8b-519d-4bca-8c18-2f800d438f69@intel.com> (raw)
In-Reply-To: <20260320073409.17337-1-jay.liu@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 3805 bytes --]
Hi Liu,
Change is functionally is correct but the commit message and code need
more clarity and justification, especially around:
-10-bit requirement
-4092 LUT value
On 20-03-2026 01:03 pm, Jay Liu wrote:
> 1.Add 10-bit color depth flow to gamma test for MediaTek devices, which only
> support bit-true results with 10-bit data. The test now selects 8-bit or
> 10-bit color depth and framebuffer format based on device type.
>
> 2. Change the maximum gamma LUT value from 4095 to 4092 for MediaTek devices.
The commit message mentions changing LUT values from 4095 to 4092, but
the code updates values from 0xffff to 0xffd0.
Since the LUT is programmed using 16-bit values, the commit message
should reflect that.
>
> Signed-off-by: Jay Liu<jay.liu@mediatek.com>
> ---
> tests/kms_color.c | 28 +++++++++++++++++++++-------
> 1 file changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 565edb2dc..27fc08ab9 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -288,7 +288,7 @@ static bool test_pipe_legacy_gamma(data_t *data,
> fb_id = igt_create_fb(data->drm_fd,
> mode->hdisplay,
> mode->vdisplay,
> - DRM_FORMAT_XRGB8888,
> + data->drm_format,
> DRM_FORMAT_MOD_LINEAR,
> &fb);
> igt_assert(fb_id);
> @@ -296,7 +296,7 @@ static bool test_pipe_legacy_gamma(data_t *data,
> fb_modeset_id = igt_create_fb(data->drm_fd,
> mode->hdisplay,
> mode->vdisplay,
> - DRM_FORMAT_XRGB8888,
> + data->drm_format,
> DRM_FORMAT_MOD_LINEAR,
> &fb_modeset);
> igt_assert(fb_modeset_id);
> @@ -322,8 +322,16 @@ static bool test_pipe_legacy_gamma(data_t *data,
> igt_plane_set_fb(primary, &fb);
>
> red_lut[0] = green_lut[0] = blue_lut[0] = 0;
> - for (i = 1; i < legacy_lut_size; i++)
> - red_lut[i] = green_lut[i] = blue_lut[i] = 0xffff;
> + for (i = 1; i < legacy_lut_size; i++) {
> + /*
> + * Use 4092 for mtk gamma LUT to remap all values
> + * to max red/green/blue.
> + */
This comment can be improved stating why MTK gamma doesn't map to 0xffff?
> + if (is_mtk_device(data->drm_fd))
> + red_lut[i] = green_lut[i] = blue_lut[i] = 0xffd0;
> + else
> + red_lut[i] = green_lut[i] = blue_lut[i] = 0xffff;
> + }
> igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, primary->crtc->crtc_id,
> legacy_lut_size, red_lut, green_lut, blue_lut), 0);
> igt_display_commit(&data->display);
> @@ -752,14 +760,20 @@ static void
> run_gamma_degamma_tests_for_crtc(data_t *data, igt_crtc_t *crtc,
> bool (*test_t)(data_t*, igt_plane_t*))
> {
> + bool depth_10bit = false;
> +
> test_setup(data, crtc);
>
> + /* MediaTek can only support bit-ture in 10-bit depth pre color */
Typo: probably meant**bit-true. May be rephrased to
/* MediaTek requires 10-bit pipeline for accurate (bit-true) color
processing */
> + if (is_mtk_device(data->drm_fd))
> + depth_10bit = true;
Instead of setting depth_10bit to false
May be we can do
bool is_mtk = is_mtk_device(data->drm_fd);
> +
> /*
> - * We assume an 8bits depth per color for degamma/gamma LUTs
> + * We assume an 8bits or 10bits depth per color for degamma/gamma LUTs
> * for CRC checks with framebuffer references.
> */
> - data->color_depth = 8;
> - data->drm_format = DRM_FORMAT_XRGB8888;
> + data->color_depth = depth_10bit ? 10 : 8;
> + data->drm_format = depth_10bit ? DRM_FORMAT_XRGB2101010 : DRM_FORMAT_XRGB8888;
> data->mode = igt_output_get_mode(data->output);
/* MTK requires 10-bit pipeline for correct color processing */
data->color_depth=is_mtk?10: 8;
data->drm_format=is_mtk?DRM_FORMAT_XRGB2101010: DRM_FORMAT_XRGB8888;
>
> igt_require(crtc_output_combo_valid(data, crtc));
[-- Attachment #2: Type: text/html, Size: 5757 bytes --]
next prev parent reply other threads:[~2026-03-25 19:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 7:33 [PATCH i-g-t v1] tests/kms_color: Add 10-bit color depth support to gamma test for MediaTek Jay Liu
2026-03-20 8:45 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-20 9:10 ` ✓ i915.CI.BAT: " Patchwork
2026-03-20 20:28 ` ✗ i915.CI.Full: failure " Patchwork
2026-03-21 4:37 ` ✗ Xe.CI.FULL: " Patchwork
2026-03-25 19:36 ` Sharma, Swati2 [this message]
2026-04-09 13:02 ` [PATCH i-g-t v1] " Jay Liu (刘博)
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=40842d8b-519d-4bca-8c18-2f800d438f69@intel.com \
--to=swati2.sharma@intel.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=gildekel@google.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jason-jh.lin@mediatek.com \
--cc=jay.liu@mediatek.com \
--cc=markyacoub@chromium.org \
--cc=nancy.lin@mediatek.com \
--cc=paul-pl.chen@mediatek.com \
--cc=singo.chang@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox