public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] prime_vgem: Downgrade the severity of a single missed vblank on flipping
@ 2019-04-04  7:05 Chris Wilson
  2019-04-04  7:38 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Wilson @ 2019-04-04  7:05 UTC (permalink / raw)
  To: igt-dev

Not displaying the flip on the next vblank is bad, but not the end of
the world -- so long as that is only a temporary glitch. Give the vblank
a few more frames to complete, and warn instead of failing if it takes
more than one vblank interval to flip.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/prime_vgem.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 85a27b69f..8c0dd6c7a 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -713,15 +713,23 @@ static void flip_to_vgem(int i915, int vgem,
 
 	/* And then the flip is completed as soon as it is ready */
 	if (!hang) {
-		union drm_wait_vblank wait;
+		unsigned long miss;
 
-		memset(&wait, 0, sizeof(wait));
-		wait.request.type = DRM_VBLANK_RELATIVE | pipe_select(0);
-		wait.request.sequence = 10;
-		do_or_die(drmIoctl(i915, DRM_IOCTL_WAIT_VBLANK, &wait));
-
-		vgem_fence_signal(vgem, fence);
+		/* Signal fence at the start of then next vblank */
 		get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS);
+		vgem_fence_signal(vgem, fence);
+
+		miss = 0;
+		igt_until_timeout(5) {
+			get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS);
+			if (poll(&pfd, 1, 0))
+				break;
+			miss++;
+		}
+		if (miss) {
+			igt_warn("Missed %lu vblanks after signaling before flip was completed\n",
+				 miss);
+		}
 		igt_assert_eq(poll(&pfd, 1, 0), 1);
 	}
 
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-04-04 21:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-04  7:05 [igt-dev] [PATCH i-g-t] prime_vgem: Downgrade the severity of a single missed vblank on flipping Chris Wilson
2019-04-04  7:38 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-04  8:17 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2019-04-04  8:40   ` Chris Wilson
2019-04-04  8:49     ` Daniel Vetter
2019-04-04 21:49 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork

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