Re: How do I sync output changes to vertical retrace?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Vojkovich wrote:
  The only mechanism I know of is OpenGL.  Most OpenGL drivers have
a mechanism to allow buffer swapping at vblank.
Using DRM/DRI this works:

void waitForVSync()
{
if( card_fd < 0 )
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;
do
{
wait_vblank.request.type = _DRM_VBLANK_RELATIVE;
rc = ioctl( card_fd, DRM_IOCTL_WAIT_VBLANK, &wait_vblank );
}
while( rc != 0 && errno == EINTR );
}


Barry

_______________________________________________

Devel@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [X Forum]     [XFree86]     [XFree86 Newbie]     [X.Org]     [IETF Annouce]     [Security]     [Fontconfig]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux