Google
  Web www.spinics.net

Re: videobuf-dma-contig - buffer allocation at init time ?

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


Hia,

On 23 September 2008, Karicheri, Muralidharan wrote:
> 1) Why the allocation of buffer done as part of mmap() not at the
> init time?  Usually video capture requires big frame buffers of 4M or so,
> if HD capture is involved. So in our driver (based on 2.6.10) we allocate
> the buffer at driver initialization and had a hacked version of the buffer
> allocation module which used this pre-allocated frame buffer address ptrs
> during mmap. Allocating buffer of such big size during kernel operation is
> likely to fail due to fragmentation of buffers. 

The original videobuf-dma-contig patch had the following comment:

"Since it may be difficult to allocate large chunks of physically
contiguous memory after some uptime due to fragmentation, this code
allocates memory using dma_alloc_coherent(). Architectures supporting
dma_declare_coherent_memory() can easily avoid fragmentation issues
by using dma_declare_coherent_memory() to force dma_alloc_coherent()
to allocate from a certain pre-allocated memory area."

I'm facing the same issue with a Zoran Vaddis driver I'm writing. I haven't 
seen fragmentation issues yet because the buffer size is much smaller at 256k 
or so, but I probably should pre-allocate too.

I couldn't quite figure out how dma_declare_coherent_memory() is used; there 
is no use-case anywhere in the kernel that I can make sense of.

Cheers!

    Rob

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

[Linux Media]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Video Technology]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Plasma TVs]     [Video Projectors]     [PDAs]     [Xorg]     [Util Linux NG]     [Xfree86]     [Devices]     [Big List of Linux Books]     [Free Photo Albums]     [LCD TVs]     [Fedora Users]     [Webcams]     [Fedora Women]     [HDTV]     [ALSA Users]     [ALSA Devel]     [Stuff]     [SSH]     [DVB Maintainers]     [Linux USB]

Add to Google Powered by Linux