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 v4 1/2] tests/kms_writeback: Wait for the valid FB ID writeback
Date: Sun, 29 Nov 2026 13:06:59 -0500	[thread overview]
Message-ID: <20261129180700.89278-2-tipreaditya@gmail.com> (raw)
In-Reply-To: <20261129180700.89278-1-tipreaditya@gmail.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>
---
 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)
-- 
2.50.1 (Apple Git-155)


  reply	other threads:[~2026-11-29 18:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 18:06 [PATCH i-g-t v4 0/2] kms_writeback: Synchronize writeback and test CRC continuity Aditya Tipre
2026-11-29 18:06 ` Aditya Tipre [this message]
2026-11-29 18:07 ` [PATCH i-g-t v4 2/2] tests/kms_writeback: Check CRC capture survives writeback Aditya Tipre
2026-11-29 18:21 ` ✗ LGCI.VerificationFailed: failure for kms_writeback: Synchronize writeback and test CRC continuity Patchwork
2026-12-01  0:51 ` ✓ Xe.CI.BAT: success for kms_writeback: Synchronize writeback and test CRC continuity (rev2) Patchwork
2026-12-01  1:02 ` ✓ i915.CI.BAT: " Patchwork
2026-12-01 14:02 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-12-01 23:20 ` ✗ i915.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=20261129180700.89278-2-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