On Thu, 2009-05-21 at 07:35 -0300, Mauro Carvalho Chehab wrote: > Em Thu, 21 May 2009 12:46:04 +0800 > "Figo.zhang" <figo1802@xxxxxxxxx> 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. > > If you want, feel free to propose some cleanups on it 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() ? Thanks, Figo.zhang > > > > Cheers, > Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html