All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: pranay.samala@intel.com, Karthik B S <karthik.b.s@intel.com>,
	S Sebinraj <s.sebinraj@intel.com>,
	Krzysztof Karas <krzysztof.karas@intel.com>
Subject: [PATCH i-g-t] tests/kms_explicit_fence: Replace fixed sleep with vblank wait
Date: Mon, 11 May 2026 13:41:17 +0530	[thread overview]
Message-ID: <20260511081117.2315474-1-karthik.b.s@intel.com> (raw)

The premature-update detection window between the NONBLOCK atomic
commit and the CRC sample used a fixed 100ms sleep. On
high-refresh-rate panels this 100ms wait covers many vblank
intervals (~24 at 240 Hz vs ~6 at 60 Hz) and is long enough to let
the display engine enter PSR/DC5. A subsequent CRC read then comes
back as 0xffffffff (read from a powered-down well), causing the
test to fail spuriously on these panels.

Replace the fixed sleep with 2-vblank wait:

 - It is the minimum wait that guarantees one full vblank boundary
   has elapsed past the commit, so a same-vblank-latch bug in the
   driver still has a deterministic window to manifest before the
   CRC is sampled.
 - It scales with the panel refresh rate, keeping the wait short
   on high-refresh panels (~8 ms at 240 Hz, ~33 ms at 60 Hz).

Cc: S Sebinraj <s.sebinraj@intel.com>
Cc: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
 tests/kms_explicit_fence.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/kms_explicit_fence.c b/tests/kms_explicit_fence.c
index 2ec9bf39d..d50a5af63 100644
--- a/tests/kms_explicit_fence.c
+++ b/tests/kms_explicit_fence.c
@@ -283,10 +283,10 @@ static void multiplane_atomic_fence_wait(data_t *data)
 		     "driver did not wait for all IN_FENCEs!");
 
 	/*
-	 * Wait briefly and verify display hasn't updated via CRC check.
-	 * In a buggy implementation, the display might update prematurely.
+	 * Wait 2 vblanks to catch premature latch bugs while
+	 * avoiding long idle windows that trigger PSR/DC power states.
 	 */
-	usleep(100000); /* 100ms */
+	igt_wait_for_vblank_count(data->crtc, 2);
 
 	/* Check if out fence signaled prematurely */
 	ret = sync_fence_status(out_fence);
-- 
2.43.0


             reply	other threads:[~2026-05-11  8:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  8:11 Karthik B S [this message]
2026-05-11 13:23 ` [PATCH i-g-t] tests/kms_explicit_fence: Replace fixed sleep with vblank wait Samala, Pranay
2026-05-12  1:46 ` ✓ i915.CI.BAT: success for " Patchwork
2026-05-12  3:03 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-12  7:06 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-12 13:00 ` ✗ i915.CI.Full: " Patchwork
2026-05-15  4:12   ` Karthik B S
2026-05-14  6:05 ` [PATCH i-g-t] " Krzysztof Karas
2026-05-14  6:12   ` Karthik B S
2026-05-14  6:24     ` Krzysztof Karas

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=20260511081117.2315474-1-karthik.b.s@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=krzysztof.karas@intel.com \
    --cc=pranay.samala@intel.com \
    --cc=s.sebinraj@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.