Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Aditya Tipre <tipreaditya@gmail.com>
To: igt-dev@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org, louis.chauvet@bootlin.com,
	sowmiya.s@intel.com, kamil.konieczny@linux.intel.com,
	karthik.b.s@intel.com, swati2.sharma@intel.com,
	tipreaditya@gmail.com
Subject: [PATCH i-g-t v3 1/2] tests/kms_writeback: Wait for the valid FB ID writeback
Date: Thu,  5 Nov 2026 17:56:27 -0500	[thread overview]
Message-ID: <20261105225628.4123-1-tipreaditya@gmail.com> (raw)
In-Reply-To: <PH7PR11MB6796FA8DDA56651E65E018D2E5682@PH7PR11MB6796.namprd11.prod.outlook.com>

The positive WRITEBACK_FB_ID test submits a writeback to the common input
framebuffer without requesting or waiting for its completion fence. A
blocking atomic commit does not imply that writeback has finished.

The following pixel-output test fills the same buffer with its reference
color. The earlier writeback can still be modifying it, leaving a mixture
of the old and new contents and causing intermittent checksum failures.
On ARM64 VKMS, a diagnostic run observed the prior fence still unsignalled
and a black row in both the input and the captured output after the input
had been filled red.

Request a fence for the successful FB ID writeback and wait for it before
returning. Only require the returned fence descriptor to be -1 when the
commit fails, so the shared commit helper also accepts this successful
fenced operation. Keep all invalid-parameter checks intact.

Signed-off-by: Aditya Tipre <tipreaditya@gmail.com>
---
New prerequisite in v3:
- Wait for the existing valid FB ID writeback before its target buffer is
  reused as input by the next subtest.

A diagnostic run observed the prior fence still unsignalled and a row of
old black pixels replacing red input pixels. Waiting for the fence removes
this race. The standalone fix passes the four applicable existing subtests
on unfixed and fixed VKMS kernels with one and two CPUs; both XRGB2101010
cases skip.

 tests/kms_writeback.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
index 7c30e8e..550d603 100644
--- a/tests/kms_writeback.c
+++ b/tests/kms_writeback.c
@@ -228,7 +228,7 @@ static int do_writeback_test(igt_output_t *output, uint32_t fb_id,
 
 	ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 
-	if (ptr_valid)
+	if (ptr_valid && ret)
 		igt_assert(*out_fence_ptr == -1);
 
 	/* WRITEBACK_FB_ID must always read as zero */
@@ -288,8 +288,12 @@ static void writeback_fb_id(igt_output_t *output, igt_fb_t *valid_fb, igt_fb_t *
 	igt_assert_eq(ret, 0);
 
 	/* Valid output buffer */
-	ret = do_writeback_test(output, valid_fb->fb_id, NULL, false);
+	ret = do_writeback_test(output, valid_fb->fb_id,
+				&output->writeback_out_fence_fd, true);
 	igt_assert_eq(ret, 0);
+
+	/* The next subtest may reuse this buffer as input. */
+	igt_get_and_wait_out_fence(output);
 }
 
 static void fill_fb(igt_fb_t *fb, uint32_t pixel)

base-commit: 454657e58fbcfd6fa8a9db0830aa1652fe6364c2
-- 
2.50.1 (Apple Git-155)


  reply	other threads:[~2026-11-05 22:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25 18:24 [PATCH i-g-t] tests/kms_writeback: Check CRC capture survives writeback atipre
2026-10-26 15:37 ` Kamil Konieczny
2026-10-26 17:33 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-10-31 17:59 ` [PATCH i-g-t v2] " Aditya Tipre
2026-10-31 18:14 ` ✗ LGCI.VerificationFailed: failure for tests/kms_writeback: Check CRC capture survives writeback (rev2) Patchwork
2026-11-02 19:19 ` ✓ Xe.CI.BAT: success for tests/kms_writeback: Check CRC capture survives writeback (rev3) Patchwork
2026-11-02 19:24 ` ✓ i915.CI.BAT: " Patchwork
2026-11-02 19:49 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-02 21:06 ` ✓ i915.CI.Full: " Patchwork
2026-11-04 13:37 ` [PATCH i-g-t] tests/kms_writeback: Check CRC capture survives writeback S, Sowmiya
2026-11-05 22:56   ` Aditya Tipre [this message]
2026-11-05 22:56     ` [PATCH i-g-t v3 2/2] " Aditya Tipre

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=20261105225628.4123-1-tipreaditya@gmail.com \
    --to=tipreaditya@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=louis.chauvet@bootlin.com \
    --cc=sowmiya.s@intel.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