summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2020-08-15 23:18:22 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2020-08-29 13:42:06 -0400
commit7212a2782f3e638acf49de4716656b2ae27c2156 (patch)
tree26c110c96cdee38cf99face2a7e5d2e241ced637
parent5031100549fb053527a1f11d771e930dec065ced (diff)
downloadxorg-driver-xf86-video-nouveau-7212a2782f3e638acf49de4716656b2ae27c2156.tar.gz
present: fix handling of drmWaitVBlank failures
When drmWaitVBlank fails, make sure to remove the event from the queue. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
-rw-r--r--src/nouveau_present.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/nouveau_present.c b/src/nouveau_present.c
index 8167fd8..20f5e85 100644
--- a/src/nouveau_present.c
+++ b/src/nouveau_present.c
@@ -113,8 +113,19 @@ nouveau_present_vblank_queue(RRCrtcPtr rrcrtc, uint64_t event_id, uint64_t msc)
args.request.signal = (unsigned long)token;
while ((ret = drmWaitVBlank(pNv->dev->fd, &args)) != 0) {
- if (errno != EBUSY || drmmode_event_flush(crtc->scrn) < 0)
+ if (errno != EBUSY) {
+ xf86DrvMsgVerb(crtc->scrn->scrnIndex, X_WARNING, 4,
+ "PRESENT: Wait for VBlank failed: %s\n", strerror(errno));
+ drmmode_event_abort(crtc->scrn, event_id, false);
return BadAlloc;
+ }
+ ret = drmmode_event_flush(crtc->scrn);
+ if (ret < 0) {
+ xf86DrvMsgVerb(crtc->scrn->scrnIndex, X_WARNING, 4,
+ "PRESENT: Event flush failed\n");
+ drmmode_event_abort(crtc->scrn, event_id, false);
+ return BadAlloc;
+ }
}
return Success;