Vertical retrace sync under Linux

Does anyone konw how to detect the vertical retrace sync under Linux? I am using
Nvidea card on my computer. Does their driver support vertical sync?

In openGL mode, it is supported, cfr. README file in the NVIDIA_GLX driver
doc (on my PC it is located in /usr/share/doc):

VBLANK SYNCING

Setting the environment variable __GL_SYNC_TO_VBLANK to a non-zero value
will force glXSwapBuffers to sync to your monitor’s vertical refresh rate
(perform a swap only during the vertical blanking period) on GeForce or
newer hardware (ie: everything but TNT/TNT2 products).

In our application, it helped us get rid of ugly shearing problems. But
take care, support for this feature is broken in some previous releases of
the driver.

Willy

Does anyone konw how to detect the vertical retrace sync under Linux? I
am using
Nvidea card on my computer. Does their driver support vertical sync?

Xavier Wielemans - alterface
http://www.alterface.com
phone +32 10 47 41 05
fax +32 10 47 20 89

I think the nVidia drivers support it, but AFAIK, that’s only the OpenGL part. (It’s usually easier to do it in an OpenGL driver, since you’re on the “right” side of an asynchronous “command queue”. Normal 2D APIs usually require that the application’s rendering loop is “hard sync’ed” with the retrace as well.)

IIRC, there is an option in the XFree86 config file to enable retrace sync in the nVidia driver, but I can’t remember it’s name.(Google; “nvidia linux retrace sync”, or something…?)

//David

.---------------------------------------
| David Olofson
| Programmer

david.olofson at reologica.se
Address:
REOLOGICA Instruments AB
Scheelev?gen 30
223 63 LUND
Sweden
---------------------------------------
Phone: 046-12 77 60
Fax: 046-12 50 57
Mobil:
E-mail: david.olofson at reologica.se
WWW: http://www.reologica.se

`-----> We Make Rheology RealOn Wed, 12/06/2002 15:00:57 , Tony Wu wrote:

Does anyone konw how to detect the vertical retrace sync under Linux? I am using
Nvidea card on my computer. Does their driver support vertical sync?

Hi Willy,

Our application is for 2D image only. We rely mostly on the SDL function and
direct video memory access.
Can I still use openGL? If I enable the V-sync by setting the enviroment
variable , will SDL_Flip sync to
the vertical retrace also?

Tony> Message: 22

Date: Thu, 13 Jun 2002 09:23:34 +0200
To: sdl at libsdl.org
From: Xavier Wielemans
Subject: Re: [SDL] Vertical retrace sync under Linux
Reply-To: sdl at libsdl.org

In openGL mode, it is supported, cfr. README file in the NVIDIA_GLX driver doc (on my PC it is located in /usr/share/doc):

VBLANK SYNCING

Setting the environment variable __GL_SYNC_TO_VBLANK to a non-zero value
will force glXSwapBuffers to sync to your monitor's vertical refresh rate
(perform a swap only during the vertical blanking period) on GeForce or
newer hardware (ie: everything but TNT/TNT2 products).

In our application, it helped us get rid of ugly shearing problems.  But take care, support for this feature is broken in some previous releases of the driver.

Willy

Does anyone konw how to detect the vertical retrace sync under Linux? I am using
Nvidea card on my computer. Does their driver support vertical sync?

Xavier Wielemans - alterface
<a href="http://www.alterface.com/"

eudora=“autourl”>http://www.alterface.com

phone +32 10 47 41 05

fax +32 10 47 20 89

Hi Willy,

Our application is for 2D image only. We rely mostly on the SDL function and
direct video memory access.

If you use a driver that supports vertical retrace sync, your application
will automatically use it when you call SDL_Flip().

Drivers that may support this include DGA 2.0 and the framebuffer console.

SDL will only enable this if you ask for a page-flipped hardware surface
video memory configuration, by specifying SDL_DOUBLEBUF in the flags passed
to SDL_SetVideoMode().

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hi Willy,

Our application is for 2D image only. We rely mostly on the SDL function and
direct video memory access.
Can I still use openGL?

Yes - but you actually have to use OpenGL; not SDL’s normal rendering. (That is, you must set up an OpenGL context, which in turn means you cannot use SDL for rendering.)

That said, if you’re feeling a bit adventurous, you could try glSDL, which implements the SDL blitting API on top of SDL/OpenGL.

http://olofson.net/mixed.html

If I enable the V-sync by setting the enviroment
variable , will SDL_Flip sync to
the vertical retrace also?

Depending on the driver, it might work with DGA (which requires root), but probably only in fullscreen mode. (IIRC, the DGA API supports only synchronization of real page flips - which rules windowed modes out on current servers.)

The double buffering SDL provides for non-DGA and AFAIK, DGA in windowed mode, is exactly that; provided by SDL. It’s not provided or even emulated by the X server. The server sees nothing but just another (big) blit into a window, and as a result, the driver can’t tell when you want it to sync with the retrace.

//David

.---------------------------------------
| David Olofson
| Programmer

david.olofson at reologica.se
Address:
REOLOGICA Instruments AB
Scheelev?gen 30
223 63 LUND
Sweden
---------------------------------------
Phone: 046-12 77 60
Fax: 046-12 50 57
Mobil:
E-mail: david.olofson at reologica.se
WWW: http://www.reologica.se

`-----> We Make Rheology RealOn Thu, 13/06/2002 12:46:43 , Tony Wu wrote: