[PATCH 1/5] present: Always present_execute even if present_queue_vblank fails.

Kenneth Graunke kenneth at whitecape.org
Thu Dec 18 18:23:49 PST 2014


Previously, if present_queue_vblank() failed, we simply dropped the
present request on the floor, and returned an error.  This was rather
mean to clients - after presenting, they wait for a PresentComplete
event to come back.  But since the present never happens, they end up
waiting forever, and lock up in poll().

This patch makes present_execute happen regardless.  If queueing the
vblank fails, we issue a debugging warning.  This way, we can still
debug problems, but don't completely lock up people's compositors
when there's a bug.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 present/present.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/present/present.c b/present/present.c
index e27fe30..f91a8a5 100644
--- a/present/present.c
+++ b/present/present.c
@@ -872,18 +872,16 @@ present_pixmap(WindowPtr window,
     if ((pixmap && target_msc >= crtc_msc) || (!pixmap && target_msc > crtc_msc)) {
         ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc);
         if (ret != Success) {
-            xorg_list_del(&vblank->event_queue);
-            vblank->queued = FALSE;
-            goto failure;
+            DebugPresent(("present_queue_vblank failed\n"));
         }
-    } else
-        present_execute(vblank, ust, crtc_msc);
+    }
+
+    present_execute(vblank, ust, crtc_msc);
 
     return Success;
 
 no_mem:
     ret = BadAlloc;
-failure:
     vblank->notifies = NULL;
     present_vblank_destroy(vblank);
     return ret;
-- 
2.1.3



More information about the xorg-devel mailing list