[MPlayer-dev-eng] DMA or not DMA

Ville Syrjälä syrjala at sci.fi
Wed Nov 24 14:45:50 CET 2004


On Wed, Nov 24, 2004 at 02:01:33PM +0100, Arpi wrote:
> Hi,
> 
> > > The problem is multiple drivers trying to use the hardware at the same 
> > > time.
> > 
> > We have that problem with mga_vid already, but as X and mga_vid
> > are accessing different memory regions, that's not a big issue.
> 
> it is, as the card cannot do multiple dma transfers at same time.
> but on framebuffer, it should work fine.
> 
> > The only real issue i see is, that during a DMA transfere,
> > MPlayer has either to sleep until the buffer is coppied or
> > that the codec has to use a copy of the buffer to work on.
> > Both options are not very exciting.
> 
> in case of dma, codecs decode to system memory, then copy it
> over dma. the only trick is that you need 2 (or more) buffers
> for B frames, so while decoding second B frame, it wont overwrite
> the buffer of first B (which is being transferred by dma)
> it mean a little bit more memory, but doesnt mean speed loss.

I experimented with DirectFB + matrox + AGP at some point but didn't see 
any performance benefit. That may have been due to the fact that I was 
still using MMIO to program the hardware and thus had to poll for the 
accelerator to become idle before flipping the buffers.

> anyway, i have a sponsor interested in a dma-capable mga_vid.
> they need to drive 5 or 6 matrox g450 cards (pci version) in a pc,
> all playing back 800x600x25fps or 720x576x25fps video (possibly
> on both heads, so total 12 video streams).

The bad thing is that matrox cards don't support scatter gather DMA so you 
need to blit the data a few lines at a time (depending on how many lines 
fit in a page). This is where DMA command buffers help since you can 
generate all blit commands beforehand and submit them in one go. 
Alternatively agpgart could be used to avoid the sg problem but that would 
make direct rendering suck since the memory will not be cached.

I played around with this kind of scatter gather DMA once. The only 
difference to this case is that I did the blit from FB to system memory.
See http://article.gmane.org/gmane.comp.video.marvel/934

-- 
Ville Syrjälä
syrjala at sci.fi
http://www.sci.fi/~syrjala/




More information about the MPlayer-dev-eng mailing list