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] tests/kms_rotation_crc: Add MTK device support
Date: Fri, 10 Apr 2026 13:25:40 +0300 [thread overview]
Message-ID: <adjQJE8Ok5K_sNuc@intel.com> (raw)
In-Reply-To: <20260410100806.62906-1-jason-jh.lin@mediatek.com>
On Fri, Apr 10, 2026 at 06:07:31PM +0800, Jason-JH Lin wrote:
> Adapt rotation CRC tests for MTK devices by using Intel-like pipe CRC
> approach with explicit vblank synchronization.
> MTK devices require a vblank wait to ensure rotation completes before
> CRC capture.
Instead of adding these checks all over igt I think you should
try to fix you kernel CRC implementation to not hand out garbage
CRCs.
>
> Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> ---
> tests/kms_rotation_crc.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 4420053f1c6d..972fe9f56839 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -310,12 +310,12 @@ static void prepare_crtc(data_t *data, igt_output_t *output, igt_crtc_t *crtc,
> /* defer crtc cleanup + crtc active for later on amd - not valid
> * to enable CRTC without a plane active
> */
> - if (!is_amdgpu_device(data->gfx_fd))
> + if (is_intel_device(data->gfx_fd) || is_mtk_device(data->gfx_fd))
> igt_display_commit2(display, COMMIT_ATOMIC);
> data->pipe_crc = igt_crtc_crc_new(crtc,
> IGT_PIPE_CRC_SOURCE_AUTO);
>
> - if (!is_amdgpu_device(data->gfx_fd) && start_crc)
> + if ((is_intel_device(data->gfx_fd) || is_mtk_device(data->gfx_fd)) && start_crc)
> igt_pipe_crc_start(data->pipe_crc);
> }
>
> @@ -324,7 +324,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, igt_crtc_t *crtc,
> #define TEST_HEIGHT(km) \
> min_t((km)->vdisplay, (km)->vdisplay, TEST_MAX_HEIGHT)
>
> -static void prepare_fbs(data_t *data, igt_output_t *output,
> +static void prepare_fbs(data_t *data, igt_output_t *output, igt_crtc_t *crtc,
> igt_plane_t *plane, enum rectangle_type rect, uint32_t format)
> {
> drmModeModeInfo *mode;
> @@ -410,6 +410,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
> data->pipe_crc,
> &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
> } else {
> + if (is_mtk_device(data->gfx_fd))
> + igt_wait_for_vblank(crtc);
> igt_pipe_crc_get_current(
> display->drm_fd, data->pipe_crc,
> &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
> @@ -434,6 +436,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
> &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
> igt_remove_fb(data->gfx_fd, &data->fb_flip);
> } else {
> + if (is_mtk_device(data->gfx_fd))
> + igt_wait_for_vblank(crtc);
> igt_pipe_crc_get_current(
> display->drm_fd, data->pipe_crc,
> &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
> @@ -472,7 +476,7 @@ static void test_single_case(data_t *data, igt_crtc_t *crtc,
>
> igt_debug("Testing case %i on pipe %s, format %s\n", rect,
> igt_crtc_name(crtc), igt_format_str(format));
> - prepare_fbs(data, output, plane, rect, format);
> + prepare_fbs(data, output, crtc, plane, rect, format);
>
> igt_plane_set_rotation(plane, data->rotation);
> if (igt_rotation_90_or_270(data->rotation))
> @@ -499,6 +503,8 @@ static void test_single_case(data_t *data, igt_crtc_t *crtc,
> if (is_amdgpu_device(data->gfx_fd)) {
> igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
> } else {
> + if (is_mtk_device(data->gfx_fd))
> + igt_wait_for_vblank(crtc);
> igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
> &crc_output);
> }
> @@ -530,6 +536,8 @@ static void test_single_case(data_t *data, igt_crtc_t *crtc,
> if (is_amdgpu_device(data->gfx_fd)) {
> igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
> } else {
> + if (is_mtk_device(data->gfx_fd))
> + igt_wait_for_vblank(crtc);
> igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
> &crc_output);
> }
> @@ -701,7 +709,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
> data->override_fmt, test_bad_format);
> }
> }
> - if (is_intel_device(data->gfx_fd)) {
> + if (is_intel_device(data->gfx_fd) || is_mtk_device(data->gfx_fd)) {
> igt_pipe_crc_stop(data->pipe_crc);
> }
> }
> --
> 2.43.0
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2026-04-10 10:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 10:07 [PATCH i-g-t] tests/kms_rotation_crc: Add MTK device support Jason-JH Lin
2026-04-10 10:25 ` Ville Syrjälä [this message]
2026-04-10 18:27 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-04-10 18:33 ` ✓ i915.CI.BAT: " Patchwork
2026-04-11 6:35 ` ✓ Xe.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=adjQJE8Ok5K_sNuc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox