[MPlayer-dev-eng] [PATCH] Improved DGA vertical retrace sync

Arpi arpi at thot.banki.hu
Mon Sep 23 23:30:41 CEST 2002


Hi,

> Attached patch improves the vertical retrace synchronisation (vsync)
> of the mplayer DGA driver.
> 
> It implements a more general buffer scheme than double buffers that
> allows for deeper buffer queues. This makes it less likely that mplayer
> tries to draw in buffers that are currently displayed, or buffers that
> soon are about to be displayed.
> 
> The buffers (up to 9 on a simple Riva 128 card) are located in graphics
> memory, and this can later be exploited by Mplayer since it can make
> Mplayer much less sensitive to scheduling problems.

hmm, it looks ok, but...
- does more than 3 (display, render, waiting) buffers has any sense?
- it should honor the -double/-nodouble flag, and by default (nodouble) use
only one buffer with no buffer flipping. you've just removed the
if(!vo_doublebuffering) check.

> To take full advantage of the mplayer DGA driver, busy-waits in 
> the XDGASetViewport function in the XFree86 DGA drivers needs to be
> eliminated. 
> 
> This is a problem in for example the Nvidia "nv" driver. I have a
> work-around patch which improves the situation for the Nvidia DGA
> driver in XFree86. It uses /dev/rtc; a long-term solution would 
> likely need some other kind of kernel support however. (In some
> simple tests I've done, XFree86 4.0.2 normally wastes around 
> 20-40 % cpu on busy-waiting.)

most vga cards can trigger an IRQ at vsync, it should be possible to develop
a kernel driver which can catch that. Zdenek Kabelac (avifile author) worked
on such thing, and also made a draft of /dev/vbi for Linux, but afair it was
refused. it could work similar way to /dev/rtc, you can read() and it will
return only at vsync, without burning the cpu.
afaik he implemented it in avifile's version of mga_vid, but only for matrox
cards.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list