This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/104111/

On February 29th, 2012, 2:26 p.m., Martin Gräßlin wrote:

Do I understand correctly that it is about this extension: http://www.opengl.org/registry/specs/SGI/swap_control.txt

If yes I must admit that my brain is today in no condition to understand what it talks about ;-)

On February 29th, 2012, 2:42 p.m., Thomas Lübking wrote:

Yupp, i controls the buffer flush interval - like eglSwapInterval is at least supposed to do. "1" one means "once every frame" while "0"  means "whenever you feel like" (values bigger than one would theoretically be possible, so 4 would flush in a 4 frame interval)

Got a flu?

On February 29th, 2012, 2:49 p.m., Martin Gräßlin wrote:

ok with 0 meaning whenever the driver things it makes sense. And yes I got a flu.
SwapInterval() is unrelated to WaitVideoSync().

It only controls whether SwapBuffers() waits for vblank or not. The default is 1 in all KMS drivers that support syncing to vblank, but the swap behavior can be overridden in a number of places including xorg.conf, ~/.drirc and by the vblank_mode env var.

SwapInterval() also has no affect on CopySubBuffer()/PostSubBuffer(), but those functions usually schedule the copy to occur the next time the scanout position is below the rect that's about to be copied, even though they return immediately.

- Fredrik


On February 28th, 2012, 10:08 p.m., Thomas Lübking wrote:

Review request for kwin and Martin Gräßlin.
By Thomas Lübking.

Updated Feb. 28, 2012, 10:08 p.m.

Description

Believe it or not, but there's actually a glXSwapInterval function and as far as i could figure one should use it since i found contradicting claims about the default (some mesa guy in a mailing list entry from 2006 says it's 0, while http://www.opengl.org/registry/specs/SGI/swap_control.txt suggests it's one)

However it can't harm -hopefully- and works here on nvidia and GMA/mesa (nvidia has SGI & ext, mesa has MESA and OML - d'ooohh) and *might* be the cause of wonky swapping because if it's not set the color buffer flushes whenever it feels like what can cause waitSync to block for even a random amount of frames or not at all (causing tearing) - at least says the guy from 2006 and is supported by the reply of the guy who originally asked =D

Testing

It's detected and applied, not 100% sure about the resulting impact.

Diffs

  • kwin/libkwineffects/kwinglutils_funcs.h (97a7a6c)
  • kwin/libkwineffects/kwinglutils_funcs.cpp (6d79507)
  • kwin/scene_opengl_glx.cpp (ddebcd0)

View Diff