accessing legacy(?) VGA input status register 1 on 945GM/xf86-video-intel
rene at exactcode.de
Fri Sep 26 07:05:28 PDT 2008
Theo Veenker wrote:
> Jesse Barnes wrote:
>> On Thursday, September 25, 2008 6:00 am Theo Veenker wrote:
>>> 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
>>> 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.
> Yes that's what I did. With the stock driver drm vblank would only work while
> running, for instance, glxgears. After the 'fix' I just need to run glxgears
> once and after that it works. I can live with that.
You do not "fix" it, but mangle a power saving feature not to wake the CPU
while vblank is not wanted by any client.
René Rebe - ExactCODE GmbH - Europe, Germany, Berlin
http://exactcode.de | http://t2-project.org | http://rene.rebe.name
More information about the xorg