diff -Nru glmark2-2012.08/debian/changelog glmark2-2012.08/debian/changelog --- glmark2-2012.08/debian/changelog 2012-08-21 17:56:25.000000000 -0300 +++ glmark2-2012.08/debian/changelog 2012-08-25 23:36:19.000000000 -0300 @@ -1,3 +1,10 @@ +glmark2 (2012.08-0ubuntu2) quantal; urgency=low + + * debian/patches/update-handle-api-change-glx_ext_swap_control.patch: + - Fixing FTBFS with latest mesa due api change (LP: #1040895) + + -- Ricardo Salveti de Araujo Sat, 25 Aug 2012 23:35:30 -0300 + glmark2 (2012.08-0ubuntu1) quantal; urgency=low * New upstream release 2012.08 (LP: #1039736) diff -Nru glmark2-2012.08/debian/patches/series glmark2-2012.08/debian/patches/series --- glmark2-2012.08/debian/patches/series 1969-12-31 21:00:00.000000000 -0300 +++ glmark2-2012.08/debian/patches/series 2012-08-25 23:31:13.000000000 -0300 @@ -0,0 +1 @@ +update-handle-api-change-glx_ext_swap_control.patch diff -Nru glmark2-2012.08/debian/patches/update-handle-api-change-glx_ext_swap_control.patch glmark2-2012.08/debian/patches/update-handle-api-change-glx_ext_swap_control.patch --- glmark2-2012.08/debian/patches/update-handle-api-change-glx_ext_swap_control.patch 1969-12-31 21:00:00.000000000 -0300 +++ glmark2-2012.08/debian/patches/update-handle-api-change-glx_ext_swap_control.patch 2012-08-26 01:29:34.000000000 -0300 @@ -0,0 +1,65 @@ +From: Jesse Barker +Subject: 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. + +Origin: upstream, http://bazaar.launchpad.net/~glmark2-dev/glmark2/trunk/revision/249 +Bug-Ubuntu: http://bugs.launchpad.net/bugs/1040895 + +diff --git a/src/canvas-x11-glx.cpp b/src/canvas-x11-glx.cpp +index 01d71cc..db3ac70 100644 +--- a/src/canvas-x11-glx.cpp ++++ b/src/canvas-x11-glx.cpp +@@ -28,6 +28,7 @@ + + static PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT_; + static PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA_; ++static PFNGLXGETSWAPINTERVALMESAPROC glXGetSwapIntervalMESA_; + + /********************* + * Protected methods * +@@ -60,12 +61,24 @@ CanvasX11GLX::make_current() + 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 @@ CanvasX11GLX::init_extensions() + reinterpret_cast("glXSwapIntervalMESA") + ) + ); ++ glXGetSwapIntervalMESA_ = ++ reinterpret_cast( ++ glXGetProcAddress( ++ reinterpret_cast("glXGetSwapIntervalMESA") ++ ) ++ ); + } + +