[PATCH 3/3] present: Check for an invalid target CRTC before flipping

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 6 00:25:44 PST 2015


Once we have chosen the target CRTC, check for an error when querying
the current MSC so we can report the error before attempting to record
the uninitialised MSC/UST, and subsequently feeding garbage values to
drmWaitVBlank.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 present/present.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/present/present.c b/present/present.c
index 1ce587e..4a1cf0c 100644
--- a/present/present.c
+++ b/present/present.c
@@ -727,7 +727,9 @@ present_pixmap(WindowPtr window,
     else if (!target_crtc)
 	target_crtc = present_get_crtc(window);
 
-    present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc);
+    ret = present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc);
+    if (ret)
+	    return ret;
 
     target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc);
 
-- 
2.1.4



More information about the xorg-devel mailing list