public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: figo zhang <figo1802@gmail.com>
Cc: hverkuil@xs4all.nl, linux-media <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@redhat.com>
Subject: Re: how to mmap in videobuf-dma-sg.c
Date: Sun, 25 Jul 2010 14:46:49 -0300	[thread overview]
Message-ID: <4C4C7889.4000304@infradead.org> (raw)
In-Reply-To: <AANLkTimExb4hh8K5lRCRiM0IMIgsOpCw69bFvqLlQCDc@mail.gmail.com>

Em 22-07-2010 23:31, figo zhang escreveu:
> 
>     Em Thu, 21 May 2009 12:46:04 +0800
>     "Figo.zhang" <figo1802@gmail.com <mailto:figo1802@gmail.com>> escreveu:
> 
>     > hi,all,
>     >  I am puzzle that how to mmap ( V4L2_MEMORY_MMAP) in videobuf-dma-sg.c?
>     >
>     > In this file, it alloc the momery using vmalloc_32() , and put this
>     > momery into sglist table,and then use dma_map_sg() to create sg dma at
>     > __videobuf_iolock() function. but in __videobuf_mmap_mapper(), i canot
>     > understand how it do the mmap?
>     > why it not use the remap_vmalloc_range() to do the mmap?
> 
>     The answer is simple: remap_vmalloc_range() is newer than videobuf code. This
>     part of the code was written back to kernel 2.4, and nobody cared to update it
>     to use those newer functions, and simplify its code.
> 
> 
> thanks, in __videobuf_mmap_mapper(), it define a videobuf_vm_ops->fault, it will alloc a new page for mmaping when it  encounter page fault (do_page_fault),
> so how the mmap() can mmap the vmalloc memory which had allocted before using __videobuf_iolock()/vmalloc_32() ?

Sorry for not answering earlier.

The current videobuf implementation has some problems. Laurent and Pawel are working
on a new implementation that will likely solve such issues. Not sure if they already
submitted the patches, since I just return back from vacations, and I'm still trying
to handle all the backlogs on my inboxes. I haven't look at LMML posts yet.

Cheers,
Mauro.

> 
> Thanks,
> Figo.zhang
>  
> 
> 
>     If you want, feel free to propose some cleanups on it
> 
> 
> 
>     Cheers,
>     Mauro
> 
> 


  parent reply	other threads:[~2010-07-25 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-21  4:46 how to mmap in videobuf-dma-sg.c Figo.zhang
2009-05-21 10:35 ` Mauro Carvalho Chehab
2009-05-21 10:48   ` Figo.zhang
2009-06-10 15:06     ` Figo.zhang
2010-07-24 13:43   ` Figo.zhang
     [not found]   ` <AANLkTimExb4hh8K5lRCRiM0IMIgsOpCw69bFvqLlQCDc@mail.gmail.com>
2010-07-25 17:46     ` Mauro Carvalho Chehab [this message]
2010-07-26  8:16       ` Laurent Pinchart

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=4C4C7889.4000304@infradead.org \
    --to=mchehab@infradead.org \
    --cc=figo1802@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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