David Nahman ([EMAIL PROTECTED]):

> I'm writing a program that needs to synchronize with the vertical
> refresh of the screen in order to trigger an external piece of
> hardware.  Is there a way through Xlib to detect when a vertical
> refresh has happened?  Or is this something that is video card driver
> pecific?

  This is currently video card specific.  With nVidia cards and the
binary drivers, you can use poll() on /dev/nvidia[0-x] to have your
process block until the next refresh.  With mga, radeon, r128, i830,
(what else?) drivers, using the new DRM for X4.3, there is a DRM ioctl
you can use to get information about the refresh rate.  Look for
drmWaitVBlank and associated code in libGL for how to use the ioctl.

  Other then that, there are a bunch of card-specific codes around
providing refresh interrupts as kernel modules.  In new versions of
svgalib, they include a kernel module to provide this functionality
through their API, although it's unclear if it is 'safe' for use along
with X.  As well, the mplayer program includes some kernel module
drivers for overlay surfaces which includes some refresh sync code, but
it's not really used by them currently to my knowledge.

  I'm working on some sort of library to abstract the nvidia binary
drivers and the new DRM method, and maybe other methods if they are
clean.  If anyone else is interested in helping out with this, let me
know.

  Hope that helps,
  -Billy

-- 
Billy Biggs
[EMAIL PROTECTED]
_______________________________________________
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86

Reply via email to