swap control
Is it possible to use sync to vblank / swap control with mesa/gallium (and nouveau) ?
I googled it but did not find any clear answers about how it is supposed to be enabled.
I also tried to read the code, and I am getting lost. So I didn't find any answers to any of these questions :
1) how are we supposed to enable it ? is there an env var , or ~/.drirc ? is drirc/driconf still valid with dri2 ?
2) is it supported by mesa/gallium ? and nouveau ?
It looks like there were some related changes with dri2.2 but that might not concern SGI/MESA swap_control extensions.
http://lists.x.org/archives/xorg-devel/2009-October/003209.html
Anyway when running progs/xdemos/glxswapcontrol with softpipe, I get the following message :
Unable to set swap-interval. Neither GLX_SGI_swap_control nor GLX_MESA_swap_control are supported.
And I do not get when using nouveau, so it seems these extensions are announced but not supported.
Another mystery : right after the dri2.2 merge, running glxgears showed the following bogus message :
Running synchronized to the vertical refresh. The framerate should be approximately 1/12400064 the monitor refresh rate.
4843 frames in 5.0 seconds = 968.573 FPS
Again I tried to read the code when it happened but I didn't find anything. And the message went away soon after, but I don't know when and why. Probably during one of the regular mesa update.. but I couldn't find which patch fixed it.
A message that is not in the archive (sent off-list or not yet received): b67489df1001290107v43d29388paaa7f1d939d16073-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 2 lines · Xavier Chantry
Is it possible to use sync to vblank / swap control with mesa/gallium (and nouveau) ?
I already have the answer to the primary question, thanks curro !
11:39 < curro__> shining: yes, gallium drivers can sync to vblank, but we aren't implementing that yet.
11:40 -!- curro__ is now known as curro_
11:40 < shining> nouveau gallium doesnt ?
11:40 < shining> is it hard to implement ?
11:41 < curro_> shining: nope, we already sync to vblank in the Xv code 11:41 < shining> right, so its the same code we just have to copy 11:42 < shining> is this a wanted feature ?
11:43 < shining> I am curious if I could play teeworlds at less than 100% cpu :) it runs really great on my
laptop nv84, 100-200 fps, but it gets hot and noisy.
11:45 < shining> anyway, even if its not too hard, its still too hard for me, I am not even able to locate the
relevant code. what a mess between
opengl/mesa/dri1/dri2/gallium code
11:56 < curro_> shining: well, i'd also blame the fence busy-waiting we do instead of putting the process to
sleep
I am still annoyed by this issue so I have looked a bit again.
Quoted 2 lines · Xavier Chantry
1) how are we supposed to enable it ? is there an env var , or ~/.drirc ? is drirc/driconf still valid with dri2 ?
There is a vblank_mode env var that seems to work.
And unfortunately driconf does not work with dri2, but it's very easy to convert, just rename driver name "nouveau" in ~/.drirc to "dri2"
Quoted 6 lines
2) is it supported by mesa/gallium ? and nouveau ?
It looks like there were some related changes with dri2.2 but that might not concern SGI/MESA
swap_controlextensions.
http://lists.x.org/archives/xorg-devel/2009-October/003209.html
Quoted 8 lines
Anyway when running progs/xdemos/glxswapcontrol with softpipe, I get the following message :
Unable to set swap-interval. NeitherGLX_SGI_swap_controlnorGLX_MESA_swap_controlare supported.And I do not get when using nouveau, so it seems these extensions are announced but not supported.
it indeed looks like these extensions are always enabled, in dri2 generic code. src/glx/dri2_glx.cdri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions) {
__glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync"); __glXEnableDirectExtension(&psc->base, "GLX_SGI_swap_control"); __glXEnableDirectExtension(&psc->base, "GLX_MESA_swap_control"); __glXEnableDirectExtension(&psc->base, "GLX_SGI_make_current_read");
There does not seem to be any extensions there that depend on driver capabilities, which I find a bit surprising.
Is that too hard to implement ?
I still don't understand which component exactly is supposed to implement that feature , is it the ddx , with support of the drm ? But it's not possible to query this ddx capability from mesa ?