RE: Using MMAP calls on a video capture device having underlying NOMMU arch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Scott,

> -----Original Message-----
> From: Scott Jiang [mailto:scott.jiang.linux@xxxxxxxxx]
> Sent: Wednesday, September 12, 2012 3:09 PM
> To: Bhupesh SHARMA
> Cc: linux-media@xxxxxxxxxxxxxxx; Laurent Pinchart; Armando VISCONTI;
> Shiraz HASHIM; m.szyprowski@xxxxxxxxxxx; uclinux-dist-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: Using MMAP calls on a video capture device having
> underlying NOMMU arch
> 
> >
> > Now, I see that the requested videobuffers are correctly allocated
> via 'vb2_dma_contig_alloc'
> > call (see [3] for reference). But the MMAP call fails in
> 'vb2_dma_contig_alloc' function
> > in mm/nommu.c (see [4] for reference) when it tries to make the
> following check:
> >
> >         if (addr != (pfn << PAGE_SHIFT))
> >                 return -EINVAL;
> >
> > I address Scott also, as I see that he has worked on the Blackfin
> v4l2 capture driver using
> > DMA contiguous method and may have seen this issue (on a NOMMU
> system) with a v4l2 application
> > performing a MMAP operation.
> >
> > Any comments on what I could be doing wrong here?
> >
> 
> int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
>                 unsigned long pfn, unsigned long size, pgprot_t prot)
> {
>         if ((addr & PAGE_MASK) != (pfn << PAGE_SHIFT))
>                 return -EINVAL;
> 
>         vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
>         return 0;
> }
> 
> This patch seems not in current kernel. Hope it can resolve your
> problem.

Thanks for your pointer.
I already referred to this modification a couple of days ago from the Blackfin ucLinux implementation
(http://blackfin.uclinux.org/git/?p=linux-kernel;a=blob;f=mm/nommu.c;h=50dc42ec5f71d56fb418a4adfc3169c2f2e930ce;hb=HEAD)
and can now safely say the MMAP works fine for all v4l2 drivers on my NOMMU architecture
based SoC as well :)

BTW, I was wondering whether a patch for the same is already in the pipe to be included
in the latest linux kernel, because this is a really important fix for MMAP IO method
to work on NOMMU systems (so probably this patch should also be cc'ed to stable kernel list). 

Till then I think this discussion can help others who see a similar issue on their
NOMMU systems.

Regards,
Bhupesh

--
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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux