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]


Hi,

I think this will resolve our issue as well. I will use this for my port.


Murali Karicheri
Software Design Engineer
Texas Instruments Inc.
Germantown, MD 20874
Phone : 301-515-3736
email: m-karicheri2@xxxxxx

>>>-----Original Message-----
>>>From: Jadav, Brijesh R
>>>Sent: Wednesday, October 15, 2008 7:54 AM
>>>To: Magnus Damm
>>>Cc: video4linux-list@xxxxxxxxxx; Karicheri, Muralidharan
>>>Subject: RE: videobuf-dma-contig - buffer allocation at init time ?
>>>
>>>Hi,
>>>
>>>Thank you very much for providing me the solution to this problem. This
>>>will solve our problem for which we struggled a lot.
>>>
>>>Brijesh Jadav
>>>
>>>-----Original Message-----
>>>From: Magnus Damm [mailto:magnus.damm@xxxxxxxxx]
>>>Sent: Tuesday, October 14, 2008 6:17 PM
>>>To: Jadav, Brijesh R
>>>Cc: Rob Kramer; video4linux-list@xxxxxxxxxx; Karicheri, Muralidharan
>>>Subject: Re: videobuf-dma-contig - buffer allocation at init time ?
>>>
>>>Hi there,
>>>
>>>On Sat, Oct 4, 2008 at 2:41 AM, Jadav, Brijesh R <brijesh.j@xxxxxx>
>>>wrote:
>>>> Hi,
>>>>
>>>> Even dma_alloc_coherent fails after some time because of the memory
>>>fragmentation for the large buffer, which is required for the HD modes.
>>>This is typically in the Embedded devices because they have less memory.
>>>Is it possible to have a hook from the video-buf layer to the driver for
>>>allocating contiguous buffer so that allocation and de-allocation is
>>>managed in the driver completely?
>>>
>>>Yes, you are correct that fragmentation will be an issue. To avoid
>>>that you could allocate a static buffer at boot up and use that buffer
>>>with dma_declare_coherent_memory().
>>>
>>>Look at how platform_resource_setup_memory() is being used in the
>>>board specific code here:
>>>
>>>http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-
>>>2.6.git;a=blob;f=arch/sh/boards/mach-
>>>migor/setup.c;h=714dce91cc9bbb30684764c33eef963c09844866;hb=HEAD
>>>
>>>This SuperH specific function is used at boot up time to allocate a
>>>chunk of physically contiguous memory for on-chip IP blocks:
>>>
>>>http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-
>>>2.6.git;a=blob;f=arch/sh/mm/consistent.c;h=64b8f7f96f9aed038e87be11ee374d
>>>5b0797f239;hb=HEAD
>>>
>>>This memory chunk is passed to the V4L2 driver as a platform resource.
>>>The V4L2 driver performs a dma_declare_coherent_memory() call to make
>>>sure all future dma_alloc_coherent() calls will be allocated from this
>>>memory.
>>>
>>>http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-
>>>2.6.git;a=blob;f=drivers/media/video/sh_mobile_ceu_camera.c;h=76838091dc6
>>>6ce05140b63912ec106422e2bc542;hb=HEAD
>>>
>>>Look at Documentation/DMA-API.txt for more information. Not sure if
>>>your architecture support this mechanism though.
>>>
>>>/ magnus


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

[Home]     [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