[Intel-gfx] [PATCH xf96-video-intel] DRI2GetMSC: Do not send a bogus ust when no drawable is not displayed

Daniel Kurtz djkurtz at chromium.org
Fri Mar 29 06:54:37 CET 2013


According to the opengl glx_sync_control spec, the Unadjusted System Time
(or UST) is a 64-bit monotonically increasing counter that is available
throughout the system:
http://www.opengl.org/registry/specs/OML/glx_sync_control.txt

Therefore, sending 0, even in this corner case, is out of spec.
Instead, just return FALSE indicating that the operation could not be
completed.

Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
---
 src/intel_dri.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/intel_dri.c b/src/intel_dri.c
index f351203..179bfb7 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -1339,12 +1339,9 @@ I830DRI2GetMSC(DrawablePtr draw, CARD64 *ust, CARD64 *msc)
 	drmVBlank vbl;
 	int ret, pipe = I830DRI2DrawablePipe(draw);
 
-	/* Drawable not displayed, make up a value */
-	if (pipe == -1) {
-		*ust = 0;
-		*msc = 0;
-		return TRUE;
-	}
+	/* Drawable not displayed, return FALSE */
+	if (pipe == -1)
+		return FALSE;
 
 	vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe);
 	vbl.request.sequence = 0;
-- 
1.8.1.3




More information about the Intel-gfx mailing list