From patchwork Thu Aug 23 22:50:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barker X-Patchwork-Id: 10912 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 DCA4423F27 for ; Thu, 23 Aug 2012 22:50:19 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id B9B02A181E4 for ; Thu, 23 Aug 2012 22:50:03 +0000 (UTC) Received: by iadj38 with SMTP id j38so2099935iad.11 for ; Thu, 23 Aug 2012 15:50:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=ronQ2ok082u3sb7IHZn7lJ6Txaooj8xlulWNO05075I=; b=a6y1lRIr8Tsgqgw7kxHQ55Sba57SE5qjdhGG4XFq98X/GGzciLkR50itdJKsSqLWPg YWF8a9ZnLpfewFecMN2gtNKtNP1p6ToUGqAzbnJG/SN4/11bxIMojBD2E6q1tXPSDe3Q kPoA3oPkM9JBK7qRKob3eLvOnU5BH/jVsRl1qA5AesIkIUSWh5iOh0nL+Kaq9Q54uWSM QpvNm5sySi1LtKfk6jB7iZSMKsDaHJwZxxOzkvanyP2Ktx3jLzBDPX2xGAeIvmtuiZ/T aoNlY8uRRBNs4xqXMqqQRrFxLIugRIkL6frjfbfNiInHtTd+Fk39ui6p6etl3+MKiA/h wVZg== Received: by 10.50.207.106 with SMTP id lv10mr134161igc.0.1345762218727; Thu, 23 Aug 2012 15:50:18 -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.50.184.232 with SMTP id ex8csp286629igc; Thu, 23 Aug 2012 15:50:17 -0700 (PDT) Received: by 10.216.237.193 with SMTP id y43mr1758728weq.75.1345762216657; Thu, 23 Aug 2012 15:50:16 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id i16si11924655weo.39.2012.08.23.15.50.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 15:50:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1T4gEB-00016c-Cd for ; Thu, 23 Aug 2012 22:50:15 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 44EBBE0261 for ; Thu, 23 Aug 2012 22:50:15 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 249 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 249: CanvasX11GLX: Updates to handle the API change for GLX_EXT_swap_control Message-Id: <20120823225015.31647.59557.launchpad@ackee.canonical.com> Date: Thu, 23 Aug 2012 22:50:15 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15843"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: ab50603674a21dbd3c90cadc1d6b7d3510ced79a X-Gm-Message-State: ALoCoQmzASmWGPbmSjTqicPStUTrzvVglPl6PDOH3YP329eIvQYqYXI+AG54anAlil5t97lQiYGa ------------------------------------------------------------ revno: 249 committer: Jesse Barker branch nick: trunk timestamp: Thu 2012-08-23 15:47:12 -0700 message: CanvasX11GLX: Updates to handle the API change for GLX_EXT_swap_control (The spec always had a void return value for glXSwapIntervalEXT, however, the original example and protocol had a return value of int. To make matters worse, the header files in mesa were updated a year after the spec.). Also, make the GLX_MESA_swap_control initialization match the new logic for GLX_EXT_swap_control. modified: src/canvas-x11-glx.cpp --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'src/canvas-x11-glx.cpp' --- src/canvas-x11-glx.cpp 2012-05-11 13:53:08 +0000 +++ src/canvas-x11-glx.cpp 2012-08-23 22:47:12 +0000 @@ -28,6 +28,7 @@ static PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT_; static PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA_; +static PFNGLXGETSWAPINTERVALMESAPROC glXGetSwapIntervalMESA_; /********************* * Protected methods * @@ -60,11 +61,23 @@ return false; } - if ((!glXSwapIntervalEXT_ || glXSwapIntervalEXT_(xdpy_, xwin_, 0)) && - (!glXSwapIntervalMESA_ || glXSwapIntervalMESA_(0))) - { - Log::info("** Failed to set swap interval. Results may be bounded above by refresh rate.\n"); - } + unsigned int desired_swap(0); + unsigned int actual_swap(-1); + if (glXSwapIntervalEXT_) { + glXSwapIntervalEXT_(xdpy_, xwin_, desired_swap); + glXQueryDrawable(xdpy_, xwin_, GLX_SWAP_INTERVAL_EXT, &actual_swap); + if (actual_swap == desired_swap) + return true; + } + + if (glXSwapIntervalMESA_) { + glXSwapIntervalMESA_(desired_swap); + actual_swap = glXGetSwapIntervalMESA_(); + if (actual_swap == desired_swap) + return true; + } + + Log::info("** Failed to set swap interval. Results may be bounded above by refresh rate.\n"); return true; } @@ -131,6 +144,12 @@ reinterpret_cast("glXSwapIntervalMESA") ) ); + glXGetSwapIntervalMESA_ = + reinterpret_cast( + glXGetProcAddress( + reinterpret_cast("glXGetSwapIntervalMESA") + ) + ); }