From patchwork Thu Jul 21 12:36:35 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: 2921 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 B178023F4D for ; Thu, 21 Jul 2011 12:37:50 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 7A562A18287 for ; Thu, 21 Jul 2011 12:37:50 +0000 (UTC) Received: by qwb8 with SMTP id 8so850980qwb.11 for ; Thu, 21 Jul 2011 05:37:50 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr169888qcc.148.1311251869950; Thu, 21 Jul 2011 05:37: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.217.78 with SMTP id hl14cs139369qcb; Thu, 21 Jul 2011 05:37:49 -0700 (PDT) Received: by 10.216.187.75 with SMTP id x53mr731015wem.92.1311251797031; Thu, 21 Jul 2011 05:36:37 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id n6si2395124wbh.43.2011.07.21.05.36.36; Thu, 21 Jul 2011 05:36:37 -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 1QjsUV-0000D9-Nu for ; Thu, 21 Jul 2011 12:36:35 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B33172E8951 for ; Thu, 21 Jul 2011 12:36:35 +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: 79 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 79: gles2: Ensure our screen updates are not synchronized with the vertical retrace (LP: 761855). Message-Id: <20110721123635.17019.77346.launchpad@loganberry.canonical.com> Date: Thu, 21 Jul 2011 12:36:35 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13475"; Instance="initZopeless config overlay" X-Launchpad-Hash: f7449b5c3329617a147e1a6fc72321ebbadee245 ------------------------------------------------------------ revno: 79 committer: Alexandros Frantzis timestamp: Fri 2011-04-15 21:20:15 +0300 message: gles2: Ensure our screen updates are not synchronized with the vertical retrace (LP: 761855). modified: src/screen-sdl-glesv2.cpp src/sdlgles/SDL_gles.c src/sdlgles/SDL_gles.h --- 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/screen-sdl-glesv2.cpp' --- src/screen-sdl-glesv2.cpp 2011-04-15 17:36:47 +0000 +++ src/screen-sdl-glesv2.cpp 2011-04-15 18:20:15 +0000 @@ -45,6 +45,11 @@ return; } + if (SDL_GLES_SetSwapInterval(0) != 0) { + fprintf(stderr, "[ Fail ] - GLES set swap interval: %s\n", SDL_GetError()); + return; + } + #ifdef _DEBUG { int buf, red, green, blue, alpha, depth; === modified file 'src/sdlgles/SDL_gles.c' --- src/sdlgles/SDL_gles.c 2010-07-12 13:37:04 +0000 +++ src/sdlgles/SDL_gles.c 2011-04-15 18:20:15 +0000 @@ -377,6 +377,17 @@ return 0; } +int SDL_GLES_SetSwapInterval(int interval) +{ + if (!eglSwapInterval(egl_display, interval)) { + SDL_SetError("EGL failed to set swap interval: %s", + get_error_string(eglGetError())); + return -1; + } + + return 0; +} + void SDL_GLES_SwapBuffers() { eglSwapBuffers(egl_display, egl_surface); === modified file 'src/sdlgles/SDL_gles.h' --- src/sdlgles/SDL_gles.h 2010-07-12 13:37:04 +0000 +++ src/sdlgles/SDL_gles.h 2011-04-15 18:20:15 +0000 @@ -93,6 +93,12 @@ */ extern DECLSPEC int SDLCALL SDL_GLES_MakeCurrent(SDL_GLES_Context *context); +/** Sets the swap interval for the current SDL_GLES context + * @param interval 0 for immediate updates, 1 for updates synchronized with the vertical retrace. + * @return 0 if everything went OK. + */ +extern DECLSPEC int SDLCALL SDL_GLES_SetSwapInterval(int interval); + /** Equivalent to SDL_Flip(). Call when you're finished issuing GL calls * and want to draw the color buffer contents to the window surface. */