accessing legacy(?) VGA input status register 1 on 945GM/xf86-video-intel

Jesse Barnes jbarnes at virtuousgeek.org
Thu Sep 25 07:50:41 PDT 2008


On Thursday, September 25, 2008 6:00 am Theo Veenker wrote:
> Hi,
>
> I have an application that presents audio-visual stimuli to subjects. To
> be able to precisely synchronize the audio and graphics the application
> needs to know when a vsync occurs. My application (from 1994) doesn't yet
> use libdrm. I'm using a real-time module which (among other things)
> monitors the vretrace bit in the VGA input status register 1 at 0x3DA and
> signals the application on each vsync event. It works fine on most graphics
> hardware.
>
> Now I need to make this application work on a laptop with an Intel 945GM.
> The vretrace bit at IO address 0x3DA doesn't work (under X) unless I
> connect an external VGA display. Then it works, but it reflects the retrace
> of the external monitor and not that of the laptop's LCD screen.
>
> Since also drmWaitVBlank() didn't work for me on this system, I applied the
> change hinted in
> http://lists.freedesktop.org/archives/xorg/2007-June/025166.html to the
> xf86-video-intel driver (2.4.2). That makes drmWaitVBlank() work (but only
> after I briefly run a GL application like glxgears first).

There's some code in the xf86-video-intel driver to disable vblank interrupts 
when no 3D client is running (look for want_vblank_interrupts in i830_dri.c, 
you can either remove the code from I830DRISetVBlankInterrupt or make that 
field unconditionally true).  Maybe that's what you already did.

> I understand the LCD screen is on pipe B and the VGA screen on pipe A.
> Can I somehow swap current behaviour so that when I monitor IO address
> 0x3DA I can detect vretraces for pipe B instead of for pipe A? That would
> save me the trouble of hacking DRM into this legacy aplication.

I think the status bit in 0x3da will correspond to the pipe VGA is assigned to 
in VGACNTRL (the headers should have the info you need, if not check out the 
docs at http://www.intellinuxgraphics.org).

Hope that helps.

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the xorg mailing list