From patchwork Fri Jun 24 15:00:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 2299 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 56B5B23F42 for ; Fri, 24 Jun 2011 15:00:50 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1E169A182F2 for ; Fri, 24 Jun 2011 15:00:50 +0000 (UTC) Received: by qyk30 with SMTP id 30so2086925qyk.11 for ; Fri, 24 Jun 2011 08:00:49 -0700 (PDT) Received: by 10.229.137.149 with SMTP id w21mr2628652qct.59.1308927649356; Fri, 24 Jun 2011 08:00:49 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.230.139 with SMTP id jm11cs50838qcb; Fri, 24 Jun 2011 08:00:49 -0700 (PDT) Received: by 10.227.135.9 with SMTP id l9mr2142303wbt.34.1308927648219; Fri, 24 Jun 2011 08:00:48 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id en14si6302566wbb.4.2011.06.24.08.00.47; Fri, 24 Jun 2011 08:00:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Qa7sF-0005ks-DD for ; Fri, 24 Jun 2011 15:00:47 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 5B31B2E808B for ; Fri, 24 Jun 2011 15:00:47 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glcompbench X-Launchpad-Branch: ~glcompbench-dev/glcompbench/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 37 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glcompbench-dev/glcompbench/trunk] Rev 37: Also check and use GLX_MESA_swap_control (if GL_EXT_swap_control is not present). Message-Id: <20110624150047.26723.15283.launchpad@loganberry.canonical.com> Date: Fri, 24 Jun 2011 15:00:47 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13265"; Instance="initZopeless config overlay" X-Launchpad-Hash: 762d61875193a9fe16b2c86b43f20eb6f9c5a09e ------------------------------------------------------------ revno: 37 committer: Alexandros Frantzis branch nick: trunk timestamp: Fri 2011-06-24 16:31:15 +0300 message: Also check and use GLX_MESA_swap_control (if GL_EXT_swap_control is not present). modified: src/composite-canvas-glx.cc --- lp:glcompbench https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk You are subscribed to branch lp:glcompbench. To unsubscribe from this branch go to https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk/+edit-subscription === modified file 'src/composite-canvas-glx.cc' --- src/composite-canvas-glx.cc 2011-06-23 09:49:07 +0000 +++ src/composite-canvas-glx.cc 2011-06-24 13:31:15 +0000 @@ -34,6 +34,7 @@ PFNGLXBINDTEXIMAGEEXTPROC glXBindTexImageEXT_; PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT_; +PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA_; bool CompositeCanvasGLX::check_glx_version() @@ -77,15 +78,25 @@ Log::info("** GLX does not support GLX_EXT_texture_from_pixmap!\n"); } - /* GLX_EXT_swap_control */ + /* + * GLX_EXT_swap_control or GL_MESA_swap_control. Note that + * GLX_SGI_swap_control is not enough because it doesn't allow 0 as a valid + * value (i.e. you can't turn off VSync). + */ if (extString.find("GLX_EXT_swap_control") != std::string::npos) { glXSwapIntervalEXT_ = reinterpret_cast( glXGetProcAddress((const GLubyte *)"glXSwapIntervalEXT")); } - - if (!glXSwapIntervalEXT_) { - Log::info("** GLX does not support GLX_EXT_swap_control!\n"); + else if (extString.find("GLX_MESA_swap_control") != std::string::npos) { + glXSwapIntervalMESA_ = + reinterpret_cast( + glXGetProcAddress((const GLubyte *)"glXSwapIntervalMESA")); + } + + + if (!glXSwapIntervalEXT_ && !glXSwapIntervalMESA_) { + Log::info("** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!\n"); } Log::debug("=======================\n"); @@ -172,8 +183,11 @@ return false; } - if (!glXSwapIntervalEXT_ || glXSwapIntervalEXT_(xdpy_, canvas_, 0)) + if ((!glXSwapIntervalEXT_ || glXSwapIntervalEXT_(xdpy_, canvas_, 0)) && + (!glXSwapIntervalMESA_ || glXSwapIntervalMESA_(0))) + { Log::info("** Failed to set swap interval. Results may be bounded above by refresh rate.\n"); + } use_accel_tfp_ = Options::use_accel_tfp;