[PATCH i-g-t] tests/kms_universal_plane: Fix fb count mismatch

Nemesa Garg nemesa.garg at intel.com
Wed Apr 2 12:32:18 UTC 2025


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 delay of 2 vblank before counting the fbs
so that all cursors fbs gets removed.

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

diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 8e0b4dda0..1a4e9489f 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -703,6 +703,15 @@ 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 vbalnk event is scheduled before
+	 * unpinning. Therefore 2 vblank to ensures that all cursor-related
+	 * framebuffers can be removed before counting the framebuffer.
+	 */
+	if (get_intel_driver(data->drm_fd) == INTEL_DRIVER_XE)
+		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



More information about the igt-dev mailing list