[PATCH] DRI2: Fix handling of drmmode_crtc_get_ust_msc return code

Michel Dänzer michel at daenzer.net
Mon Jun 1 00:28:37 PDT 2015


From: Michel Dänzer <michel.daenzer at amd.com>

Fixes regression introduced in commit
76c2923ac5c7230a8b2f9f8329c308d28b44d9c0 ("DRI2: Split out helper for
getting UST and MSC of a specific CRTC").

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_dri2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 6bb3dc6..a1f0145 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -988,11 +988,11 @@ static int radeon_dri2_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc)
     if (radeon_crtc_is_enabled(crtc)) {
 	/* CRTC is running, read vblank counter and timestamp */
 	ret = drmmode_crtc_get_ust_msc(crtc, ust, msc);
+	if (ret != Success)
+	    return FALSE;
 
-	if (ret != Success) {
-	    *msc += radeon_get_interpolated_vblanks(crtc);
-	    *msc &= 0xffffffff;
-	}
+	*msc += radeon_get_interpolated_vblanks(crtc);
+	*msc &= 0xffffffff;
     } else {
 	/* CRTC is not running, extrapolate MSC and timestamp */
 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-- 
2.1.4



More information about the xorg-driver-ati mailing list