Re: [PATCH 2/2] [media] videobuf-dma-contig: use vm_iomap_memory()
From: Mauro Carvalho Chehab
Date: Wed Apr 17 2013 - 08:57:59 EST
Em Wed, 17 Apr 2013 09:22:16 -0300
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx> escreveu:
> vm_iomap_memory() provides a better end user interface than
> remap_pfn_range(), as it does the needed tests before doing
> mmap.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
> ---
> drivers/media/v4l2-core/videobuf-dma-contig.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c
> index 67f572c..7e6b209 100644
> --- a/drivers/media/v4l2-core/videobuf-dma-contig.c
> +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c
> @@ -303,14 +303,9 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
> goto error;
>
> /* Try to remap memory */
> -
> size = vma->vm_end - vma->vm_start;
> - size = (size < mem->size) ? size : mem->size;
> -
> vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> - retval = remap_pfn_range(vma, vma->vm_start,
> - mem->dma_handle >> PAGE_SHIFT,
> - size, vma->vm_page_prot);
> + retval = vm_iomap_memory(vma, vma->vm_start, size);
Just to be sure, that changing from remap_pfn_range() to io_remap_pfn_range()
won't cause any side-effects, I double-checked that, for all drivers using
this code, that remap_pfn_range is equal to io_remap_pfn_range.
The Timberdale driver was a little trickier to check, as VIDEO_TIMBERDALE
doesn't depend on any architecture. However, this driver was submitted and
was known to work only on the Intel in-Vehicle Infotainment reference board
russelville. According with http://wiki.meego.com/In-vehicle, the
architecture for it is x86 (Intel Atom Z5xx).
In summary, those are the archs where this core driver is used, with the
corresponding drivers that make such usage:
powerpc:
drivers/media/platform/fsl-viu.c
arm:
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/omap/omap_vout_vrfb.c
drivers/media/platform/soc_camera/mx1_camera.c
drivers/media/platform/soc_camera/omap1_camera.c
sh:
drivers/media/platform/sh_vou.c
x86:
drivers/media/platform/timblogiw.c
--
Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/