public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Xiandong Wang (王先冬)" <Xiandong.Wang@mediatek.com>
Cc: Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"markyacoub@chromium.org" <markyacoub@chromium.org>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"gildekel@google.com" <gildekel@google.com>
Subject: Re: [PATCH i-g-t v2 1/1] tests/kms_cursor_legacy: relax checks on MTK
Date: Mon, 27 Apr 2026 02:44:09 +0000	[thread overview]
Message-ID: <1e6ccd32af5254fd75eeb8c8eb3e0006ad970ee1.camel@mediatek.com> (raw)
In-Reply-To: <20260317084024.9036-2-xiandong.wang@mediatek.com>

Hi Xiandong,

On Tue, 2026-03-17 at 16:40 +0800, Xiandong Wang wrote:
> From: Xiandong Wang <Xiandong.Wang@mediatek.com>
> 
> kms_cursor_legacy uses tight vblank timing assertions that can be
> unstable
> on MTK under higher system load, leading to intermittent failures.
> 
> Use relaxed upper-bound checks for the MTK-specific path in the
> affected
> subtests, while preserving the existing assertions for other drivers.
> 
> This improves test robustness on MTK without changing expectations on
> non-MTK platforms.
> 
> Signed-off-by: Xiandong Wang <Xiandong.Wang@mediatek.com>
> ---
>  tests/kms_cursor_legacy.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
> index 5399ef481..e6ab33eca 100644
> --- a/tests/kms_cursor_legacy.c
> +++ b/tests/kms_cursor_legacy.c
> @@ -1038,12 +1038,17 @@ static void flip_vs_cursor(igt_display_t
> *display, enum flip_test mode, int nloo
>  		igt_set_timeout(1, "Stuck page flip");
>  		igt_ignore_warn(read(display->drm_fd, &vbl,
> sizeof(vbl)));
>  
> -		if (!mode_requires_extra_vblank(mode))
> -			igt_assert_eq(igt_crtc_get_vblank(crtc, 0),
> -				      vblank_start + 1);
> -		else
> +		if (!mode_requires_extra_vblank(mode)) {
> +			if (is_mtk_device(display->drm_fd))
> +				igt_assert_lte(igt_crtc_get_vblank(c
> rtc, 0),
> +					vblank_start + 1);

It seems you got a igt_crtc_get_vblank(crtc, 0) == vblank_start here.

Since changing from igt_assert_eq to igt_assert_lte is a relaxation of
the assertion condition and igt_crtc_get_vblank(crtc, 0) won't less
than vblank_start. It would not cause any regressions on other
platform. Therefore, there is no need to guard this relaxation
specifically for MTK devices.

> +			else
> +				igt_assert_eq(igt_crtc_get_vblank(cr
> tc, 0),
> +					vblank_start + 1);
> +		} else {
>  			igt_assert_lte(igt_crtc_get_vblank(crtc, 0),
>  				       vblank_start + 2);
> +		}

I think it could be simply replaced to:

if (!mode_requires_extra_vblank(mode))
	igt_assert_lte(igt_crtc_get_vblank(crtc, 0),
					   vblank_start + 1);
else
	igt_assert_lte(igt_crtc_get_vblank(crtc, 0),
 					   vblank_start + 2);

>  
>  		igt_reset_timeout();
>  	} while (nloops--);
> @@ -1442,8 +1447,12 @@ static void cursor_vs_flip(igt_display_t
> *display, enum flip_test mode, int nloo
>  			vblank_last = vbl.sequence;
>  		}
>  
> -		if (!cursor_slowpath(display, mode))
> -			igt_assert_lte(vbl.sequence, vblank_start +
> 5 * vrefresh / 8);
> +		if (!cursor_slowpath(display, mode)) {
> +			if (is_mtk_device(display->drm_fd))
> +				igt_assert_lte(vbl.sequence,
> vblank_start + ((5 * vrefresh / 8) * 4));
> +			else
> +				igt_assert_lte(vbl.sequence,
> vblank_start + 5 * vrefresh / 8);
> +		}

It's about the threshold. Maybe you can do something like this:

threshold = 5 * vrefresh / 8;

/* Add some comment for why we need this... */
if (is_mtk_device(display->drm_fd))
	threshold = 4 * threshold;

if (!cursor_slowpath(display, mode))
	igt_assert_lte(vbl.sequence, vblank_start + threshold);

Regards,
Jason-JH Lin

  reply	other threads:[~2026-04-27  2:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17  8:40 [PATCH i-g-t v2 0/1] tests/kms_cursor_legacy: relax checks on MTK Xiandong Wang
2026-03-17  8:40 ` [PATCH i-g-t v2 1/1] " Xiandong Wang
2026-04-27  2:44   ` Jason-JH Lin (林睿祥) [this message]
2026-04-30  1:46     ` 回复: " Xiandong Wang (王先冬)
2026-03-17 21:27 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-17 21:46 ` ✓ i915.CI.BAT: " Patchwork
2026-03-19  3:49 ` ✗ i915.CI.Full: failure " Patchwork
2026-03-20 15:06   ` Kamil Konieczny
2026-03-19  7:31 ` ✓ Xe.CI.FULL: success " 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=1e6ccd32af5254fd75eeb8c8eb3e0006ad970ee1.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=Xiandong.Wang@mediatek.com \
    --cc=gildekel@google.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=markyacoub@chromium.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