From: Daniel Kurtz Subject: [PATCH xf96-video-intel] DRI2GetMSC: Do not send a bogus ust when no drawable is not displayed Date: Fri, 29 Mar 2013 13:54:37 +0800 Message-ID: <1364536477-7844-1-git-send-email-djkurtz@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 60905E5DFE for ; Thu, 28 Mar 2013 22:54:46 -0700 (PDT) Received: by mail-pa0-f43.google.com with SMTP id hz11so220973pad.2 for ; Thu, 28 Mar 2013 22:54:46 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes , marcheu@chromium.org, intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 --- 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