public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: "Wang, Wen W" <wen.w.wang@intel.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"umg-meego-handset-kernel@umglistsvr.jf.intel.com"
	<umg-meego-handset-kernel@umglistsvr.jf.intel.com>,
	Jozef Kruger <jozef.kruger@siliconhive.com>,
	"Zhang, Xiaolin" <xiaolin.zhang@intel.com>
Subject: Re: Memory allocation in Video4Linux
Date: Wed, 09 Feb 2011 08:19:57 -0200	[thread overview]
Message-ID: <4D526A4D.1040906@redhat.com> (raw)
In-Reply-To: <D5AB6E638E5A3E4B8F4406B113A5A19A32F923C4@shsmsx501.ccr.corp.intel.com>

Hi Wen,

Em 09-02-2011 04:23, Wang, Wen W escreveu:
> Hi,
> 
> We are developing the image processor driver for Intel Medfield platform. 
> 
> We have received some comments on memory management that we should use standard Linux kernel interfaces for this, since we are doing everything by ourselves including memory allocation (based on pages), page table management, virtual address management and etc.
> 
> So can you please help give some advice or suggestion on using standard kernel interface for memory management?
> 
> The processor has a MMU on-chip with same virtual address range as IA. The processor will access system memory (read and write) through MMU and page table. The memory consumption of the driver could be quite big especially for high resolution (14MP) with certain features turned on. 
> For example: advanced ISP with XNR and yuv444 output, at 14MP this uses:
> 	1 RAW16: 2*14 = 28MB
> 	1 qplane6: 6/4 * 14 = 21MB
> 	1 yuv420_16: 2 * 1.5 * 14 = 42MB
> 	1 yuv420: 1.5 * 14 = 21MB
> 	1 yuv444: 3 * 14 = 42MB
> 	total: 154MB.

You should take a look at the videobuf2 for buffer management. It is flexible
enough to be used on embedded hardware, as it splits the memory management
on a separate module. In particular, the CMA allocator was designed to handle
memory management on complex designs. You'll find extensive discussions about
CMA and videobuf2 in the ML. The videobuf2 is already at linux-next and will
be available for 2.6.39. Not sure about the status of the CMA allocator, as
the patches are handled via another upstream tree.

I hope that helps.

Cheers,
Mauro

      parent reply	other threads:[~2011-02-09 10:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09  6:23 Memory allocation in Video4Linux Wang, Wen W
2011-02-09  6:30 ` Kanigeri, Hari K
2011-02-09  6:30 ` Yang, Jianwei
2011-02-09  6:32   ` Wang, Wen W
2011-02-09  6:49     ` Iyer, Sundar
2011-02-09  7:22       ` Kanigeri, Hari K
2011-02-09  7:27         ` Wang, Wen W
2011-02-09  7:51           ` Hans Verkuil
2011-02-09  7:55             ` Wang, Wen W
2011-02-10 10:06               ` Sakari Ailus
2011-02-09  7:58             ` Jonghun Han
2011-02-09  8:10               ` Wang, Wen W
2011-02-10  7:59           ` Gao, Bin
2011-02-10  8:08             ` Jozef Kruger
2011-02-10  9:29             ` Laurent Pinchart
2011-02-10  9:44               ` Wang, Wen W
2011-02-10 10:00                 ` Laurent Pinchart
2011-02-11  2:07                   ` KyongHo Cho
2011-02-09 10:19 ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D526A4D.1040906@redhat.com \
    --to=mchehab@redhat.com \
    --cc=jozef.kruger@siliconhive.com \
    --cc=linux-media@vger.kernel.org \
    --cc=umg-meego-handset-kernel@umglistsvr.jf.intel.com \
    --cc=wen.w.wang@intel.com \
    --cc=xiaolin.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox