diff options
| -rw-r--r-- | drivers/media/v4l2-core/videobuf-dma-contig.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c index bf80f0f7dfb8..e02353e340dd 100644 --- a/drivers/media/v4l2-core/videobuf-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c | |||
| @@ -305,6 +305,15 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, | |||
| 305 | /* Try to remap memory */ | 305 | /* Try to remap memory */ |
| 306 | size = vma->vm_end - vma->vm_start; | 306 | size = vma->vm_end - vma->vm_start; |
| 307 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 307 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
| 308 | |||
| 309 | /* the "vm_pgoff" is just used in v4l2 to find the | ||
| 310 | * corresponding buffer data structure which is allocated | ||
| 311 | * earlier and it does not mean the offset from the physical | ||
| 312 | * buffer start address as usual. So set it to 0 to pass | ||
| 313 | * the sanity check in vm_iomap_memory(). | ||
| 314 | */ | ||
| 315 | vma->vm_pgoff = 0; | ||
| 316 | |||
| 308 | retval = vm_iomap_memory(vma, mem->dma_handle, size); | 317 | retval = vm_iomap_memory(vma, mem->dma_handle, size); |
| 309 | if (retval) { | 318 | if (retval) { |
| 310 | dev_err(q->dev, "mmap: remap failed with error %d. ", | 319 | dev_err(q->dev, "mmap: remap failed with error %d. ", |
