Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2] tests/kms_universal_plane: Fix fb count mismatch
@ 2025-04-05 10:18 Nemesa Garg
  2025-04-05 11:55 ` ✓ i915.CI.BAT: success for tests/kms_universal_plane: Fix fb count mismatch (rev2) Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Nemesa Garg @ 2025-04-05 10:18 UTC (permalink / raw)
  To: igt-dev; +Cc: Nemesa Garg

There is a mismatch in the count of fb before
start and end of the test. This is because cursor
fbs still not removed and we are counting the fbs.
Add a 2 vblank wait before counting the fbs so that
all cursors fbs gets removed.
Since unpinning of cursor fb occurs during vblank in xe,
we need to wait atleast 1 vblank for driver to remove
cursor fb. We need 1 additional vblank because vblank
event is scheduled before unpinning.

v2: Use is_xe_device[Chaitanya]

Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
---
 tests/kms_universal_plane.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 8e0b4dda0..2d9716575 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -703,6 +703,16 @@ cursor_leak_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 			    COMMIT_ATOMIC : COMMIT_LEGACY);
 	cursor_leak_test_fini(data, output, &background_fb, cursor_fb);
 
+	/* Since unpinning of cursor fb occurs during vblank in xe, we need
+	 * to wait atleast 1 vblank for driver to remove cursor fb. We need
+	 * 1 additional vblank because vblank event is scheduled before
+	 * unpinning. Therefore add 2 vblank wait to ensure that all
+	 * cursor-related framebuffers can be removed before counting the
+	 * framebuffer.
+	 */
+	if (is_xe_device(data->drm_fd))
+		igt_wait_for_vblank_count(data->drm_fd, data->display.pipes[pipe].crtc_offset, 2);
+
 	/* We should be back to the same framebuffer count as when we started */
 	count2 = intel_gem_fb_count(data);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-07 22:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-05 10:18 [PATCH i-g-t v2] tests/kms_universal_plane: Fix fb count mismatch Nemesa Garg
2025-04-05 11:55 ` ✓ i915.CI.BAT: success for tests/kms_universal_plane: Fix fb count mismatch (rev2) Patchwork
2025-04-05 12:08 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-05 13:34 ` ✗ i915.CI.Full: failure " Patchwork
2025-04-07  6:40 ` [PATCH i-g-t v2] tests/kms_universal_plane: Fix fb count mismatch Sharma, Swati2
2025-04-07 22:08 ` ✗ Xe.CI.Full: failure for tests/kms_universal_plane: Fix fb count mismatch (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox