From patchwork Tue Mar 12 23:44:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 2260461 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id A0DA53FCF6 for ; Tue, 12 Mar 2013 23:44:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72786E62C7 for ; Tue, 12 Mar 2013 16:44:47 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f50.google.com (mail-qa0-f50.google.com [209.85.216.50]) by gabe.freedesktop.org (Postfix) with ESMTP id F13DBE5C4F for ; Tue, 12 Mar 2013 16:44:34 -0700 (PDT) Received: by mail-qa0-f50.google.com with SMTP id dx4so332564qab.16 for ; Tue, 12 Mar 2013 16:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=V0GxppqMC3eE0kGO4Ue4DrtWCiLq8ogb1unvJgIc3d0=; b=TtyhCU/L2rE/we93hhw+D1H3Ax/SR8xgi3fbmLJc380JvHTwXJtVMFwdSxwbbwZD9d yHc3e3hKPXf7O418UHioDk9Q0/G+yIi2zjrZE1oOLmoJ9kFRAwBR4AamtG+404fGZwJe uAA08BYg6TXk4OWYX23O9kdo583iNv8DMj4IyPYBRMK4a4juW+sF2J0SxEjQzgbYwxnE hYZWbN+iBavorVopDG7Qb+h5tPo3PLVm0XRv2MSdJCkq/gsfCHj2PEq/1Vx1hAC1yv2i yPsXHUMx+Zo17j5R6aZAjqTlC5ENhKCnjDhikXRc90VtaodqsSW2qVIz7rlxf7kaS+0B pkfQ== X-Received: by 10.49.18.138 with SMTP id w10mr7090282qed.64.1363131874391; Tue, 12 Mar 2013 16:44:34 -0700 (PDT) Received: from localhost (ppp-70-129-136-92.dsl.rcsntx.swbell.net. [70.129.136.92]) by mx.google.com with ESMTPS id bb8sm33622515qeb.5.2013.03.12.16.44.32 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 12 Mar 2013 16:44:33 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH] DRI2: don't advertise GLX_INTEL_swap_event if it can't Date: Tue, 12 Mar 2013 19:44:26 -0400 Message-Id: <1363131866-12573-1-git-send-email-robdclark@gmail.com> X-Mailer: git-send-email 1.8.1.4 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org If ddx does not support swap, don't advertise it. We might also be able to get rid of the vmwgfx check (I'm not quite sure the purpose of that check vs. just checking dri2Minor. Signed-off-by: Rob Clark --- src/glx/dri2_glx.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index c4f6996..b2d712c 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1051,11 +1051,16 @@ static const struct glx_context_vtable dri2_context_vtable = { }; static void -dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions, +dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv, const char *driverName) { + const struct dri2_display *const pdp = (struct dri2_display *) + priv->dri2Display; + const __DRIextension **extensions; int i; + extensions = psc->core->getExtensions(psc->driScreen); + __glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync"); __glXEnableDirectExtension(&psc->base, "GLX_SGI_swap_control"); __glXEnableDirectExtension(&psc->base, "GLX_MESA_swap_control"); @@ -1069,7 +1074,7 @@ dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions, * of disabling it uncondtionally, just disable it for drivers * which are known to not support it. */ - if (strcmp(driverName, "vmwgfx") != 0) { + if (pdp->swapAvailable && strcmp(driverName, "vmwgfx") != 0) { __glXEnableDirectExtension(&psc->base, "GLX_INTEL_swap_event"); } @@ -1212,8 +1217,7 @@ dri2CreateScreen(int screen, struct glx_display * priv) goto handle_error; } - extensions = psc->core->getExtensions(psc->driScreen); - dri2BindExtensions(psc, extensions, driverName); + dri2BindExtensions(psc, priv, driverName); configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs); visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs);