Re: updated dma to user space API
Brought to you by:
aeb,
bencollins
From: Andreas B. <and...@mu...> - 2000-04-28 16:14:54
|
On Tue, Apr 25, 2000 at 08:14:57PM +1000, Sebastien Rougeaux wrote: > > I have updated the API for the direct iso dma to user space feature > that is available for the ohci driver. Previously the buffer filling > was running continuously in the driver, and the user app was only > waiting for irq generated for each frame. The problem was doing so > you could easily create synchronization problems. Now the user app > has to queue the buffers for each frame. If the user app can not keep > up with the framerate, the dma context will wait until fresh buffers > are queued. It is very similar to the video4linux API. Is there anything special about this DMA? I guess it just does header stripping instead of giving the complete packet like libraw does. Strictly seen it's also not DMA to user space but having kernel buffers mapped to user space (what I intended to do for libraw once I figure it out and get to it). What I have problems with is that it duplicates a lot of bttv code, something Linus probably will also complain about. Plus, from my understanding, the bttv code handles a lot of cases which are not required for OHCI hardware. What I have in mind for better iso receiving is something like a manager part in the subsystem handing out chunks of 64kB (or something, should be tunable) contiguous mem to the hardware drivers which receive iso packets into those. When the remaining space in the chunk is too small for more packets, the driver tells the subsystem and gets a new chunk. The filled chunks have then a soft and a hard reference count. The soft count indicates that someone is interested in the contained data at all (otherwise it could just as well be freed immediately). The hard count indicates that it must not be freed at this time (e.g. it's mapped to user space by raw1394 currently). If a limit is reached or memory gets low the oldest chunks with soft references but no hard refs can be freed (i.e. packets get lost). > /* queue the buffers for frame acquisition */ > for (i=0;i<v.nb_buffers;i++) { > w.buffer=i; > if (ioctl(fd,VIDEO1394_QUEUE_BUFFER,&w)==-1) { > perror("VIDEO1394_QUEUE_BUFFER"); > return -1; } > } ^ In case anyone wondered there was a missing closing brace there. -- Andreas E. Bombe <and...@mu...> DSA key 0x04880A44 http://home.pages.de/~andreas.bombe/ http://linux1394.sourceforge.net/ |