summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-07 23:32:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-07 23:34:21 +0100
commit696f58f69f2bac5717d19f7a1a2278fee50a083e (patch)
tree0b692f4fc972ab361f085e9c9438fcd762b5294d
parentbd33d0a7e9801e710b77fd32df90b3cc953045fe (diff)
sna: Add an assertion that the flip succeeds
Upon completion of the flip-event, check that the current scanout matches our expectations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 43fe4db4..39c07b30 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -9186,6 +9186,15 @@ again:
crtc->flip_bo->handle, crtc->flip_bo->active_scanout));
assert(crtc->bo->active_scanout);
assert(crtc->bo->refcnt >= crtc->bo->active_scanout);
+
+#ifndef NDEBUG
+ {
+ struct drm_mode_crtc mode = { .crtc_id = __sna_crtc_id(crtc) };
+ drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode);
+ assert(mode.fb_id == fb_id(crtc->flip_bo));
+ }
+#endif
+
crtc->bo->active_scanout--;
kgem_bo_destroy(&sna->kgem, crtc->bo);