From: Jason-JH Lin <jason-jh.lin@mediatek.com>
To: <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>
Cc: Jani <jani.nikula@intel.com>,
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: [PATCH i-g-t] tests/kms_plane: Add vblank waits for MediaTek CRC timing
Date: Thu, 26 Feb 2026 00:04:18 +0800 [thread overview]
Message-ID: <20260225160428.4116800-1-jason-jh.lin@mediatek.com> (raw)
On MediaTek hardware, CRC generation requires additional time to
stabilize after certain operations. This patch adds targeted vblank
waits for two specific scenarios:
1. Pixel format changes: After a format change in
capture_format_crcs_single(), the CRC hardware needs at least one
vblank to generate valid CRC values for the new format. Without
this wait, tests may read stale or transitional CRC values.
2. Cursor plane updates: In test_plane_position_with_output(), cursor
plane updates are non-blocking on MediaTek hardware. A vblank wait
ensures the CRC reflects the updated plane configuration.
These waits are guarded by is_mtk_device() checks to avoid affecting
other platforms.
Fixes failures in:
- pixel-format: CRC mismatch due to reading before format stabilization
- plane-position-hole: pipe-A-plane-3 failures with cursor plane
Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
---
tests/kms_plane.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 8cef94a1f37e..e4539078c98e 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -351,6 +351,15 @@ test_plane_position_with_output(data_t *data, igt_crtc_t *crtc,
igt_display_commit(&data->display);
+ /*
+ * On MediaTek hardware, cursor plane updates are non-blocking and
+ * CRC needs time to reflect the new plane configuration. Wait for
+ * a vblank to ensure the update has taken effect.
+ */
+ if (is_mtk_device(data->drm_fd) && sprite->type == DRM_PLANE_TYPE_CURSOR)
+ igt_wait_for_vblank(data->drm_fd,
+ data->display.pipes[pipe].crtc_offset);
+
igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
igt_assert_crc_equal(reference_crc, &crc);
@@ -760,6 +769,15 @@ static void capture_format_crcs_single(data_t *data, igt_crtc_t *crtc,
igt_remove_fb(data->drm_fd, &old_fb);
+ /*
+ * On MediaTek hardware, CRC generation needs time to stabilize after
+ * a pixel format change. Wait for at least one vblank to ensure the
+ * CRC hardware has updated for the new format.
+ */
+ if (is_mtk_device(data->drm_fd))
+ igt_wait_for_vblank(data->drm_fd,
+ data->display.pipes[pipe].crtc_offset);
+
igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &crc[0]);
}
--
2.43.0
next reply other threads:[~2026-02-25 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 16:04 Jason-JH Lin [this message]
2026-03-06 6:03 ` [PATCH i-g-t] tests/kms_plane: Add vblank waits for MediaTek CRC timing Fei Shao
2026-03-09 3:22 ` 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=20260225160428.4116800-1-jason-jh.lin@mediatek.com \
--to=jason-jh.lin@mediatek.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=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