summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/videobuf-vmalloc.c
AgeCommit message (Collapse)Author
2008-07-26fix a few assorted spelling mistakes.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-16videobuf: Fix gather spellingMagnus Damm
Use "scatter gather" instead of "scatter gatter". Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> --- drivers/media/video/videobuf-dma-sg.c | 2 +- drivers/media/video/videobuf-vmalloc.c | 2 +- include/media/videobuf-dma-sg.h | 2 +- include/media/videobuf-vmalloc.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
2008-04-13videobuf-dvb: allow its usage with videobuf-vmallocMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> videobuf-dvb were still using a function that were videobuf-dma-sg dependent. This patch creates a generic handler for this function. This way, videobuf-dvb can now work with all videobuf implementations. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-13videobuf-vmalloc: stop streaming before unmapMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Before the patch, there were a risk of freeing and unmapping userspace memory, while there were pending requests. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-13videobuf-vmalloc: fix STREAMOFF/STREAMONMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> There were a small bug on videobuf-vmalloc that were preventing STREAMOFF to work. The issue is that vmalloc'ed mmaped memory should only be freed after being sure that there aren't any mmap usage. Otherwise, the memory remap will stop working, and the userspace won't receive any frames. This bug were affecting some userspace applications, like tvtime. After this patch, tvtime started to work again with the drivers that use videobuf-vmalloc. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-13videbuf-vmalloc: Corrects mmap codeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> There were some bugs on videobuf-vmalloc. Basically, remap were called with a wrong parameter. Due to that, a later remap were needed, generating the need of some hacks on videobuf-vmalloc and videobuf-core. This patch fixes the remap and removes the hacks. TODO: - V4L2_MEMORY_USERPTR is not implemented yet. This method should be properly implemented, in order to work with a few userspace applications. - The driver also doesn't implement V4L2_MEMORY_OVERLAY. This method is used only by a few applications, and are becaming obsolete, due to the increment of cpu performance. So, most apps prefer to retrieve data to an internal buffer, doing some processing like de-interlacing. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-13videobuf: revert changeset #7490:5b77f099a151Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> This changeset were supposed to optimize mmap() support on vmalloc. However, it just broke mmap() on real devices. Revert the changeset to make mmap() to work again. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-08media/video/ replace remaining __FUNCTION__ occurrencesMichael Krufky
From: Harvey Harrison <harvey.harrison@gmail.com> __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2008-04-02videobuf-vmalloc.c: Fix hack of postponing mmap on remap failureBrandon Philips
In videobuf-vmalloc.c remap_vmalloc_range is failing when applications are trying to mmap buffers immediately after reqbuf. It fails because the vmalloc area isn't setup until the first QBUF when drivers call iolock. This patch introduces mmap_setup to the qtype_ops and it is called in __videobuf_mmap_setup if the buffer type is mmap. In the case of vmalloc buffers this calls iolock, and sets the state to idle. I don't think this is needed for dma-sg buffers and it defaults to a no-op for everything but vmalloc. Signed-off-by: Brandon Philips <bphilips@suse.de> --- linux/drivers/media/video/videobuf-core.c | 29 +++++++----------- linux/drivers/media/video/videobuf-vmalloc.c | 43 +++++++++++++-------------- linux/include/media/videobuf-core.h | 3 + 3 files changed, 35 insertions(+), 40 deletions(-)
2008-04-02videobuf-vmalloc.c: Remove buf_release from videobuf_vm_closeBrandon Philips
Remove the buf_release on vm_close because it will lead to a buffer being released multiple times since all buffers are already freed under the two possible cases: device close or STREAMOFF. Signed-off-by: Brandon Philips <bphilips@suse.de> --- linux/drivers/media/video/videobuf-vmalloc.c | 2 -- 1 file changed, 2 deletions(-)
2008-02-25From: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>Mauro Carvalho Chehab
Subject: Convert videobuf-dma-sg to generic DMA API Date: Tue, 19 Feb 2008 13:40:54 +0100 (CET) videobuf-dma-sg does not need to depend on PCI. Switch it to using generic DMA API, convert all affected drivers, relax Kconfig restriction, improve compile-time type checking, fix some Coding Style violations while at it. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-04[v4l] convert videbuf_vmalloc_memory to videobuf_vmalloc_memoryBrandon Philips
Signed-off-by: Brandon Philips <bphilips@suse.de>
2008-01-31Renames videobuf lock to vb_lockMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> This helps to identify where vb_lock is being used, and find missusages of the locks. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-27[PATCH] static memoryDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> - Static memory is always initialized with 0. - Replaced in some cases C99 comments for /* */ Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2007-12-08V4L: Memory leak! Fix count in videobuf-vmalloc mmapMauro Carvalho Chehab
From: Brandon Philips <bphilips@suse.de> This is pretty serious bug. map->count is never initialized after the call to kmalloc making the count start at some random trash value. The end result is leaking videobufs. Also, fix up the debug statements to print unsigned values. Pushed to http://ifup.org/hg/v4l-dvb too Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-30V4L: fix copy and paste error in dprintk for videobuf-vmalloc.cBrandon Philips
Signed-off-by: Brandon Philips <bphilips@suse.de>
2007-10-17backport changeset 13bcd5d0e21e3ca726965371ada8ff6c64af288fMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Original description: Author: Al Viro <viro@ftp.linux.org.uk> Date: Sat Oct 13 08:25:24 2007 +0100 v4l: copy_to_user() is not a good method name Breaks on any target that has copy_to_user() defined as a non-trivial macro. kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-11 git-dvb: rename videobuf_qtype_ops.copy_to_user()Mauro Carvalho Chehab
From: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-08videobuf_core init always require callback implementationMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> In the past, videobuf_queue_init were used to initialize PCI DMA videobuffers. This patch renames it, to avoid confusion with the previous kernel API, doing: s/videobuf_queue_init/void videobuf_queue_core_init/ Also, the operations is now part of the function parameter. The function will also add a test if this is defined, otherwise producing BUG. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-27videobuf cleanup: mmap check is common to all videobuf. Make it at coreMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981 Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-09-07Fix buffer release codeMauro Carvalho Chehab
Release code should happen before the cleaning of map variable. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-06An allocation error message were being printed as a debug msgMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-06Cleans mem->vmalloc after vfreeMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-02Add videobuf-vmallocMauro Carvalho Chehab
Adds a newer videobuf-vmalloc module. This module uses the same videobuf controls, but implements memory allocation based on vmalloc methods. With this method, an USB driver can use video-buf, without needing to request memory from the DMA-safe area. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/Kconfig | 4 linux/drivers/media/video/Kconfig | 2 linux/drivers/media/video/Makefile | 1 linux/drivers/media/video/videobuf-vmalloc.c | 385 ++++++++++++++++++++++++++ linux/include/media/videobuf-vmalloc.h | 44 ++ 5 files changed, 435 insertions(+), 1 deletion(-)