summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/vivi.c
AgeCommit message (Collapse)Author
2008-07-21videodev: move all ioctl callbacks to a new v4l2_ioctl_ops structHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it. This ensures a clean separation between the const ops struct and the non-const video_device struct. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-20videodev: move some functions from v4l2-dev.h to v4l2-common.h or v4l2-ioctl.hHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The functions in a header should not belong to another module. The prio functions belong to v4l2-common.c, so move them to v4l2-common.h. The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header and move those functions to it. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.16Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 4 removes the compatibility support for kernels < 2.6.16. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.13Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 3 of the compat cleanup. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.0Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> First phase of the backwards compatibility cleanup: stop supporting kernels older than 2.6.0. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-22 V4L/vivi: fix possible memory leak in vivi_fillbuffMauro Carvalho Chehab
From: Marcin Slusarz <marcin.slusarz@gmail.com> Move allocation after first check and fix memory leak. Noticed-by: Daniel MarjamÀki <danielm77@spray.se> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-10vivi: rename MODULE_NAME macro to VIVI_MODULE_NAME to avoid namespace conflictsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-10 vivi: announce that it is registered as /dev/video%dMauro Carvalho Chehab
From: Carl Karsten <carl@personnelware.com> Signed-off-by: Carl Karsten <carl@personnelware.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-28videodev: renamed the vidioc_*_fmt_* callbacksHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The naming for the callbacks that handle the VIDIOC_ENUM_FMT and VIDIOC_S/G/TRY_FMT ioctls was very confusing. Renamed it to match the v4l2_buf_type name. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-04-24vivi: fix a warningMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> some gcc versions complain that fh is used without being defined. The error report is bogus. However, fixing it is trivial. Better to make gcc happy. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-13vivi: Add a missing \nMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> 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-02vivi: Simplify the vivi driver and avoid deadlocksBrandon Philips
vivi previously had a very complex queuing system and held spinlocks while doing copy_to_user, kmalloc, etc. This caused the driver to easily deadlock when a multi-threaded application used it and revealed bugs in videobuf too. This replaces the copy_to_user with memcpy since we were never copying to user space addresses. And makes the kmalloc atomic. Signed-off-by: Brandon Philips <bphilips@suse.de> --- linux/drivers/media/video/vivi.c | 317 +++++++++------------------------------ 1 file changed, 81 insertions(+), 236 deletions(-)
2008-04-02vivi: make vivi openable only onceBrandon Philips
vivi currently doesn't have the infrastructure to handle being opened more than one time and will crash if it is. So, make it openable only once. Signed-off-by: Brandon Philips <bphilips@suse.de> --- linux/drivers/media/video/vivi.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
2008-03-28vivi: Add 32bit compatibility to the moduleMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Thanks to Jiri Slaby <jirislaby@gmail.com> for pointing this issue. CC: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-13Fix timestamp presentation on vivi driverMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Due to date overflow, vivi were not working fine anymore. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13Cleanup kernel thread and provide overrun detectionMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> The previous code were a little bit messy. Cleans it up. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13Add proper locking for buffer fillingMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Avoids de-alocating buffers before finishing to fill a buffer Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13Fix vivi internal debug messagesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13fix debug enableMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> The changes at vivi_template make debug option to not work properly. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13Allow emulating changes of video std by viviMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-10Miscelaneous cleanupsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Manually fixed all pertinent checkpatch.pl errors inside the source code. Also removed some unused code at the driver and a few minor cleanups. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-10Avoid troubles when using multiple devicesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> mv_count is a counter used to move the vertical bars. Before this patch, it where a static var. This works fine for just one device. However, when using multiple devices, every device would increment it. This patch moves it to its correct place: struct vivi_dev. So, now, each device has its own data. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-10Allow vivi to open multiple video devicesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Now, it is possible to open multiple vivi devices, by using n_devs parameter. This makes vivi driver closer to a real one. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-10Fix vivi to support non-zero minor nodeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> There were a trouble at vivi driver when using non-zero inodes. This where due to not properly preserving the minor inode after calling video_register. Since this driver is a reference for newer drivers, and it is possible to have more than one video device inside the machine, this patch makes vivi to dynamically allocate video_device struct. Thanks to Gregor Jasny <jasny@vidsoft.de> for pointing the issue. Also, this patch removes a very anoying (but useless) message of not having a proper release call. CC: Gregor Jasny <jasny@vidsoft.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-13V4L: Convert videobuf drivers to videobuf_stopBrandon Philips
Drivers were using cookie cutter code for stopping the read/stream. Use the new videobuf_stop function which is lock safe. Signed-off-by: Brandon Philips <bphilips@suse.de>
2007-11-06V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_Brandon Philips
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g s/STATE_PREPARED/VIDEOBUF_PREPARED/g s/STATE_QUEUED/VIDEOBUF_QUEUED/g s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g s/STATE_DONE/VIDEOBUF_DONE/g s/STATE_ERROR/VIDEOBUF_ERROR/g s/STATE_IDLE/VIDEOBUF_IDLE/g Signed-off-by: Brandon Philips <bphilips@suse.de>
2007-10-15v4l core: remove the unused .hardware V4L1 fieldMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> struct video_device used to define a .hardware field. While initialized on severl drivers, this field is never used inside V4L. However, drivers using it need to include the old V4L1 header. This seems to cause compilation troubles with some random configs. Better just to remove it from all drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10Change list_for_each+list_entry to list_for_each_entryTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The rest of V4L files. There is one list_for_each+list_entry in cpia_pp.c that wasn't changed because it expects the loop iterator to remain NULL if the list is empty. A bug in vivi is fixed; the 'safe' version needs to be used because the loop deletes the list entries. Simplify a second loop in vivi and get rid if an un-used variable in that loop. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-09-27vivi cleanup: remove the unused varsMauro Carvalho Chehab
Last patch series made vivi driver simpler. This patch removes the now unused vars. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-27V4L: vivi.c remove the "resource" lockingbphilips@suse.de
The "resource" locking in vivi isn't needed since streamon/streamoff/read_stream do mutual exclusion using q->reading/q->streaming. Plus it is sort of broken: a) res_locked() use in vivi_read() is racey. b) res_free() calls mutex_lock twice causing streamoff to break Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-27V4L: vivi.c replace logic in vivi_poll with videobuf_poll_streambphilips@suse.de
Since vivi is using videobuf_read_stream() it can use videobuf_poll_stream() now. Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-27V4L: vivi.c vidioc_try_fmt_cap() negotiate a valid fieldbphilips@suse.de
If the client provides V4L2_FIELD_ANY vivi should return a valid field :) Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-22Make the vertical lines to moveMauro Carvalho Chehab
While this is not the standard color bar behaviour, having some movement there allows to check if buffers are being properly handled. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-27Fix vivi poll() methodMauro Carvalho Chehab
Due to the replace of videobuf_read_one to videobuf_read_stream, poll() method implementation is wrong. This fixes poll() implementation, making read of /dev/video? to work again. 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>
2007-08-02Convert vivi to use videobuf-vmallocMauro Carvalho Chehab
This patch removes the usage of videobuf-dma-sg from vivi driver, using instead videobuf-vmalloc. This way, vivi will be useful for testing the newer method. Reverting this patch won't hurt vivi, since both methods work fine. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/vivi.c | 211 ++------------------------------------- 1 file changed, 14 insertions(+), 197 deletions(-)
2007-08-23Convert vivi to use the newer videobuf-dma-sg moduleMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-29videobuf_read_stream is more efficient than videobuf_read_oneMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-19backport kernel changeset 831441862956fffa17b9801db37e6ea1650b0f69Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Original patch description from the patch by Rafael J. Wysocki <rjw@sisk.pl>: Freezer: make kernel threads nonfreezable by default Currently, the freezer treats all tasks as freezable, except for the kernel threads that explicitly set the PF_NOFREEZE flag for themselves. This approach is problematic, since it requires every kernel thread to either set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't care for the freezing of tasks at all. It seems better to only require the kernel threads that want to or need to be frozen to use some freezer-related code and to remove any freezer-related code from the other (nonfreezable) kernel threads, which is done in this patch. The patch causes all kernel threads to be nonfreezable by default (ie. to have PF_NOFREEZE set by default) and introduces the set_freezable() function that should be called by the freezable kernel threads in order to unset PF_NOFREEZE. It also makes all of the currently freezable kernel threads call set_freezable(), so it shouldn't cause any (intentional) change of behaviour to appear. Additionally, it updates documentation to describe the freezing of tasks more accurately. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-02Backport mutex changes to work with kernels <=2.6.15Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-02use mutex instead of semaphore in Virtual Video driverMauro Carvalho Chehab
From: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> The Virtual Video driver uses a semaphore as mutex. Use the mutex API instead of the (binary) semaphore. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21Backport: make file_operations constMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Backport a kernel patch by Arjan van de Ven <arjan@linux.intel.com> that made all file_operations instances const. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-19compat: Add code to compat.h for try_to_sleep()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Compat.h used to have an argument, now it doesn't. There was also some code: if (current->flags & PF_FREEZE) { refrigerator(PF_FREEZE); } which is the same as try_to_freeze(), and so can be replaced by it. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-13fix compiler warning in vivi.cMarcel Siegert
From: Marcel Siegert <mws@linuxtv.org> the result of copy_to_user was not used, so the compiler complained now a warning will be issued if copy_to_user fails Signed-off-by: Marcel Siegert <mws@linuxtv.org>
2007-01-25Make vivi driver to use vmalloced pointersMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Before this patch, vivi were simulating a scatter gather DMA transfer. While this is academic, showing how stuff really works on a real PCI device, this means a non-optimized code. There are only two memory models that vivi implements: 1) kernel alloced memory. This is also used by read() method. On this case, a vmalloc32 buffer is allocated at kernel; 2) userspace allocated memory. This is used by most userspace apps. video-buf will store this pointer. a simple copy_to_user is enough to transfer data. The third memory model scenario supported by video-buf is overlay mode. This model is not implemented on vivi and unlikely to be implemented on newer drivers, since now, most userspace apps do some post-processing (like de-interlacing). After this patch, some cleanups may be done at video-buf.c to avoid allocating pages, when the driver doesn't need a PCI buffer. This is the case of vivi and usb drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-20rmmod should be reset to zero on kernel 2.4Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-14Some fixes at stream waitqueue on viviMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> There are several potential troubles on vivi waitqueue code: - Watchdog timer should be reset at every received frame; - Watchdog timer should be reset at the beginning of vivi_thread(); - Checks for errors when creating a newer thread with kernel_thread(); - Wake up vivi_thread() after creating it. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-13Fix OOPS on some waitqueue conditionsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-02From: Mauro Carvalho Chehab <mchehab@infradead.org>Mauro Carvalho Chehab
vivi.c uses the KM_BOUNCE_READ with local interrupts enabled. This means that if a disk interrupt occurs while vivi.c is using this fixmap slot, the vivi.c driver will, upon return from that interrupt, find that the fixmap slot now points at a different physical page. The net result will probably be rare corruption of disk file contents, because viv.c will now be altering the page which the disk code was recently using. Thanks to Andrew Morton <akpm@osdl.org> for pointing this. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-27Fix some troubles at the previous patchMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> One test with vivi driver were comitted together by mistake; The whitespace identation were wrong at the previous patch. kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>