Re: v4l2 api

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> >  - V4L2_MEMORY_USERPTR allows applications to pass in pointers to
> >    random userspace memory (userptr+length).
>  
>  If you do this, please keep in mind that some scatter-gather DMA engines 
>  (especially the philips saa7146, don't know about the saa7134) can only 
>  deal with page aligned boundaries.

The saa7134 doesn't need a page-aligned buffer start, and I doubt the
saa7146 does.

The saa7134 has a iommu which wants a page list in physical memory.
That forms a virtual, 4MB sized I/O space.  The saa7146 does the same
as far I know.

For DMA transfer you have some control registers (start offset, line
padding, ...) for each field.  The start offset is needed to fill a
buffer with an interlaced image and to place the overlay at a random
location on the screen, thus I expect the saa7146 has this too.

The start offset can also be used to let the capture buffer start
at non-page-aligned addresses.

>  Alternatively, the user application may provide an already page aligned 
>  memory, but I don't think that this is a good idea (and if it's possible 
>  for a user application to request this).

If page-alignment is really needed I'd prefeare this way.  If you
allocate memory by mapping anonymous memory it will be page aligned.
shared memory is also page-aligned.  And applications can figure the
page size with the "getpagesize()" call, so they have a chance to
do the page-alignment thing themself even for memory allocated via
malloc().

  Gerd

-- 
You can't please everybody.  And usually if you _try_ to please
everybody, the end result is one big mess.
				-- Linus Torvalds, 2002-04-20





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux