summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-12-07 18:57:38 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-12-07 18:57:38 -0200
commitcd476bced39098128e4e24a78d8f5fe2d953f14e (patch)
tree9aacb5fbd408ac47776ce6a3f4184312f3a8d9c9 /linux
parent1c0e6e2a91a24a057e1fa87365cfb20720a551ab (diff)
downloadmediapointer-dvb-s2-cd476bced39098128e4e24a78d8f5fe2d953f14e.tar.gz
mediapointer-dvb-s2-cd476bced39098128e4e24a78d8f5fe2d953f14e.tar.bz2
Subject: v4l: nopage
From: Nick Piggin <npiggin@suse.de> Convert v4l from nopage to fault. Remove redundant vma range checks. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/videobuf-dma-sg.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/linux/drivers/media/video/videobuf-dma-sg.c b/linux/drivers/media/video/videobuf-dma-sg.c
index a99415141..712f59ac2 100644
--- a/linux/drivers/media/video/videobuf-dma-sg.c
+++ b/linux/drivers/media/video/videobuf-dma-sg.c
@@ -395,6 +395,7 @@ videobuf_vm_close(struct vm_area_struct *vma)
* now ...). Bounce buffers don't work very well for the data rates
* video capture has.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
static struct page*
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,1)
videobuf_vm_nopage(struct vm_area_struct *vma, unsigned long vaddr,
@@ -424,12 +425,32 @@ videobuf_vm_nopage(struct vm_area_struct *vma, unsigned long vaddr,
#endif
return page;
}
+#else
+static int
+videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+ struct page *page;
+
+ dprintk(3,"fault: fault @ %08lx [vma %08lx-%08lx]\n",
+ (unsigned long)vmf->virtual_address,vma->vm_start,vma->vm_end);
+ page = alloc_page(GFP_USER | __GFP_DMA32);
+ if (!page)
+ return VM_FAULT_OOM;
+ clear_user_page(page_address(page), vaddr, page);
+ vmf->page = page;
+ return 0;
+}
+#endif
static struct vm_operations_struct videobuf_vm_ops =
{
.open = videobuf_vm_open,
.close = videobuf_vm_close,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
.nopage = videobuf_vm_nopage,
+#else
+ .fault = videobuf_vm_fault,
+#endif
};
/* ---------------------------------------------------------------------