From: Magnus Damm <magnus.damm@gmail.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-media@vger.kernel.org, hverkuil@xs4all.nl,
linux-mm@kvack.org, lethal@linux-sh.org, hannes@cmpxchg.org
Subject: Re: [PATCH] videobuf-dma-contig: zero copy USERPTR support V3
Date: Tue, 12 May 2009 22:30:37 +0900 [thread overview]
Message-ID: <aec7e5c30905120630k7cbc245dh211dbd0472928a2d@mail.gmail.com> (raw)
In-Reply-To: <20090511103651.49d852f8@pedra.chehab.org>
On Mon, May 11, 2009 at 10:36 PM, Mauro Carvalho Chehab
<mchehab@infradead.org> wrote:
> Em Fri, 8 May 2009 13:06:58 -0700
> Andrew Morton <akpm@linux-foundation.org> escreveu:
>
>> On Fri, 08 May 2009 17:53:10 +0900
>> Magnus Damm <magnus.damm@gmail.com> wrote:
>>
>> > From: Magnus Damm <damm@igel.co.jp>
>> >
>> > This is V3 of the V4L2 videobuf-dma-contig USERPTR zero copy patch.
>> >
>> > Since videobuf-dma-contig is designed to handle physically contiguous
>> > memory, this patch modifies the videobuf-dma-contig code to only accept
>> > a user space pointer to physically contiguous memory. For now only
>> > VM_PFNMAP vmas are supported, so forget hotplug.
>> >
>> > On SuperH Mobile we use this with our sh_mobile_ceu_camera driver
>> > together with various multimedia accelerator blocks that are exported to
>> > user space using UIO. The UIO kernel code exports physically contiguous
>> > memory to user space and lets the user space application mmap() this memory
>> > and pass a pointer using the USERPTR interface for V4L2 zero copy operation.
>> >
>> > With this approach we support zero copy capture, hardware scaling and
>> > various forms of hardware encoding and decoding.
>> >
>> > Signed-off-by: Magnus Damm <damm@igel.co.jp>
>
> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Thank you!
>> What does it do, how does it do it and why does it do it?
>
> A good documentation is a really good idea here. There videobuf internals are
> very complex. A good documentation for it is very important to keep it updated.
I've just posted a little patch that adds function descriptions,
hopefully that is one step in the right direction.
> I would also suggest if you could also take a look at videobuf-vmalloc and implement a
> similar method to provide USERPTR. The vmalloc flavor can easily be tested with
> the virtual (vivi) video driver, so it helps people to better understand how
> videobuf works. It will also help the USB drivers that use videobuf to use USERPTR.
Yeah, supporting USERPTR with vivi sounds like a good plan. I'm not
sure how much work it involves though. The comment in the
videobuf-vmalloc header says that the buffer code assumes that the
driver does not touch the data, but I think that's exactly how vivi
generates the frame data for us. =)
I need to figure out the best way to grab references to user space
pages and map them virtually contiguous like vmalloc does. This will
take a bit of time, so don't expect anything submitted in time for
v2.6.31. I've put it fairly high on my TODO list.
Thanks for your help!
/ magnus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-05-12 13:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 8:53 [PATCH] videobuf-dma-contig: zero copy USERPTR support V3 Magnus Damm
2009-05-08 20:06 ` Andrew Morton
2009-05-11 13:36 ` Mauro Carvalho Chehab
2009-05-12 13:30 ` Magnus Damm [this message]
2009-05-12 14:45 ` Mauro Carvalho Chehab
2009-05-11 13:38 ` Mauro Carvalho Chehab
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=aec7e5c30905120630k7cbc245dh211dbd0472928a2d@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hverkuil@xs4all.nl \
--cc=lethal@linux-sh.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mchehab@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).