How do I wait for VSYNC with binary nVidia driver?

Barry Scott barry.scott at onelan.co.uk
Fri Sep 22 02:55:10 PDT 2006


Matthew Allum wrote:
> Hi;
>
> On 9/22/06, Barry Scott <barry.scott at onelan.co.uk> wrote:
>> I have an X11 client (not OpenGL) that needs to wait for VSYNC.
>> With Intel and VIA I use drm to do this successfully and I want to
>> support the binary nVidia driver.
>>
>
> Out of interest, how are you doing this specifically on intel and via ?
>
The core is this:

card_fd = open( "/dev/dri/card0", O_RDONLY );

drm_wait_vblank_t wait_vblank;
wait_vblank.request.type = _DRM_VBLANK_RELATIVE;
wait_vblank.request.sequence = 1;
wait_vblank.request.signal = 0;

int rc = ioctl( card_fd, DRM_IOCTL_WAIT_VBLANK, &wait_vblank );

You need to expect the ioctl to fail and have a fall back algorithm.
It will fail if the drm does not support this IOCTL on your card
for example. I had to use DRM from git to get Intel support, not sure
if that support is in a released kernel yet.

Barry





More information about the xorg mailing list