From patchwork Fri Mar 29 05:54:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 2364501 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 53455DFB79 for ; Fri, 29 Mar 2013 08:26:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31FE3E5D17 for ; Fri, 29 Mar 2013 01:26:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=PGeRGeX38p8rw5jZK2PCTmzlcxjDuVX9qPV2IgDJe4c=; b=dzF1xbdVKyXMoss02TjW/Chwh/r3+iPQj+CdPJ6hAe1SnBv3uITAT+Zb+y2wTevslZ +xXBu6AkXK+vJQQYLnpIKk20/DEFBgE5u2Jrns0jBNs1WWRjnM1J9gdz7za9Z3Fe0lGT 9UbFK1XVAacIW7RAzfPOVjQnnl0ZK2kIkwx6E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=PGeRGeX38p8rw5jZK2PCTmzlcxjDuVX9qPV2IgDJe4c=; b=RCizePrEqPGPhSnUgJ75qslPDnvz+b15saPmlgKm934OJKd7RAKKs+1GRtOiA/Q055 txs74zjoVVF/yyyUnmxZJvkDELBGlKOMFVZUkvvwbvog1TubAfhfD+ce/D9WDticpNFr KsRTMtQaPY8smav5mntSWNHGwIWxlOW4TudZHneT/R4SHl9g5M4ahlyG5ILC+4ylb0LU //jf+5hcje/v1cM4gsQ35231vGiwgqd8ntMJcz7Evc7IUlVLwOLS/SXahTvRQ8rKoYoI dJ1ldcoyh2itmLalVVzzJIPq46iEyAXkVUU0CP6bAJT0tDV6dsoOaH3k5neZ4z1G5F9j Pgjg== X-Received: by 10.66.88.105 with SMTP id bf9mr2683999pab.175.1364536486287; Thu, 28 Mar 2013 22:54:46 -0700 (PDT) Received: from djkurtz-z620.tpe.corp.google.com (djkurtz-z620.tpe.corp.google.com [172.30.210.61]) by mx.google.com with ESMTPS id m18sm2108052pad.17.2013.03.28.22.54.43 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 22:54:45 -0700 (PDT) From: Daniel Kurtz To: Jesse Barnes , marcheu@chromium.org, intel-gfx@lists.freedesktop.org Date: Fri, 29 Mar 2013 13:54:37 +0800 Message-Id: <1364536477-7844-1-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 1.8.1.3 X-Gm-Message-State: ALoCoQlnWG3uUQZe6jlEOEfaF1AaMMiEMW+A1B6/7Myu84a6BJEllxpVmXQ/WkbOQ2s/PYQxqPMD Subject: [Intel-gfx] [PATCH xf96-video-intel] DRI2GetMSC: Do not send a bogus ust when no drawable is not displayed X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@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;