Hi,
we have a strange problem on one of our development machines:
Our graphics application should sync with monitor frequency by calling
IDirectFB::Flip( WAITFORSYNC ). On this particular machine, however, the
flip takes almost exactly 113 ms for every frame, while it should be
13ms (fbset reports 75 Hz, see attached output).
Graphics hardware is a Matrox G550, the same as in my setup where the
application works without problems.
I have digged DFB and matroxfb sources a bit and built the following
theory:
IDirectFB::Flip() indirectly calls fbdev.c::primaryWaitVSync() which
does
if (ioctl( dfb_fbdev->fd, FBIO_WAITFORVSYNC, &zero ))
waitretrace();
In matroxfb, the ioctl waits with
wait_event_interruptible_timeout(vs->wait, cnt != vs->cnt, HZ/10)
for the VSYNC interrupt, but times out after HZ/10=100ms, so -ETIMEDOUT
is returned to primaryWaitVSync() which calls waitretrace() which, in
turn, does a busy wait for the next VSYNC and consumes 1/framerate=13ms.
This would more or less explain the constant frame length of 113ms.
Now, the question is: Does this explanation sound plausible and, if yes:
Why does the wait_event_bla fail? Isn't there any VSYNC interrupt? How
can this happen?
I've got no idea of where this interrupt should normally come from, but
could this be caused by a second PCI graphics board in the machine, on
which an Xserver runs?
I will ask my colleagues with access to the machine to try and remove
the second board. But even if this would help, we would have to track
the problem down and find a solution because we need two heads.
Anyway, I hope someone with a better understanding of Linux graphics
systems will be able to shed some light on this, any hints would be
greatly appreciated. :)
Thanks,
Jan
------------8<----------------8<---------------------
$ fbset -i
mode "800x600-75"
# D: 49.498 MHz, H: 46.873 kHz, V: 74.996 Hz
geometry 800 600 800 1200 16
timings 20203 160 16 21 1 80 3
hsync high
vsync high
rgba 5/11,6/5,5/0,0/0
endmode
Frame buffer device information:
Name : MATROX
Address : 0xe0000000
Size : 16777216
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 8
YPanStep : 1
YWrapStep : 0
LineLength : 1600
MMIO Address: 0xc0100000
MMIO Size : 16384
Accelerator : Matrox G400
------------8<----------------8<---------------------