aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/vivi.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-05-19V4L/DVB: vivi and mem2mem_testdev need slab.h to buildRandy Dunlap1-0/+1
Fix vivi and mem2mem_testdev build errors: need to #include <linux/slab.h>: drivers/media/video/vivi.c:1144: error: implicit declaration of function 'kfree' drivers/media/video/vivi.c:1156: error: implicit declaration of function 'kzalloc' drivers/media/video/vivi.c:1156: warning: assignment makes pointer from integer without a cast drivers/media/video/mem2mem_testdev.c:862: error: implicit declaration of function 'kzalloc' drivers/media/video/mem2mem_testdev.c:862: warning: assignment makes pointer from integer without a cast drivers/media/video/mem2mem_testdev.c:874: error: implicit declaration of function 'kfree' drivers/media/video/mem2mem_testdev.c:944: warning: assignment makes pointer from integer without a cast Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: vivi: clean up and a major overhaulHans Verkuil1-485/+324
- Clean up the code - Use the kernel's built-in vga8x16 font instead of our own. - Drop exclusive open: now multiple users can open the device as per the V4L2 spec. - Move the format description to the vivi device instead of keeping it in the file handle. Again as per the spec. - Streamline and simplify the drawing code. It is now easy to add text on top of the colorbar pattern. - Upgrade the max resolution to 1920x1200. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: V4L2: Replace loops for finding max buffers in VIDIOC_REQBUFS callbacksAndreas Bombe1-2/+2
Due to obvious copy and paste coding a number of video capture drivers which implement a limit on the buffer memory decremented the user supplied buffer count in a while loop until it reaches an acceptable value. This is a silly thing to do when the maximum value can be directly computed. Signed-off-by: Andreas Bombe <aeb@debian.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26V4L/DVB (13944): vivi: Fix test of unsigned in vivi_create_instance()Roel Kluin1-1/+1
video_nr is unsigned so the test did not work. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13556): v4l: Remove unneeded video_device::minor assignmentsLaurent Pinchart1-1/+0
Now that the video_device registration is tested using video_is_registered(), drivers don't need to initialize the video_device::minor field to -1 anymore. Remove those unneeded assignments. [mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13555): v4l: Use video_device_node_name() instead of the minor numberLaurent Pinchart1-4/+3
Instead of using the minor number in kernel log messages, use the device node name as returned by the video_device_node_name() function. This makes debug, informational and error messages easier to understand for end users. [mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13551): v4l: Remove video_device::num usage from device driversLaurent Pinchart1-3/+0
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13550): v4l: Use the new video_device_node_name functionLaurent Pinchart1-5/+6
Fix all device drivers to use the new video_device_node_name function. This also strips kernel log messages from the "/dev/" prefix, has the device node location is a userspace policy decision unknown to the kernel. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-05V4L/DVB (12134): vivi: bug: don't assume that S_STD will be called before streamingMauro Carvalho Chehab1-49/+50
precalculate_bars() improved vivi performance. However, it assumed that always before streaming, the driver would call VIDIOC_S_STD. This is not an API requirement, and the testing apps don't do that. Due to that, a regression were caused by the patch that added it. This patch moves the precalculate_bars to the proper place of the code, calling it at buffer_prepare() callback. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23V4L/DVB (11905): vivi: Use v4l bounding/alignment functionTrent Piepho1-9/+2
The v4l function has a better algorithm for aligning image size. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10912): vivi: fix compile warning.Hans Verkuil1-1/+1
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10907): avoid loading the entire videodev.h header on V4L2 driversMauro Carvalho Chehab1-4/+0
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10647): vivi: add slider flag to controls.Hans Verkuil1-5/+5
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10646): vivi: controls are per-device, not global.Hans Verkuil1-18/+22
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10645): vivi: introduce v4l2_device and do several cleanupsHans Verkuil1-128/+130
- add v4l2_device - remove BKL - make the debug parameter settable on the fly - set bus_info in querycap Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10642): vivi: update comment to reflect that vivi can now create more than 32 devs.Hans Verkuil1-4/+1
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10211): vivi: Implements 4 inputs on viviMauro Carvalho Chehab1-44/+142
This patch adds the capability of selecting between 4 different inputs on vivi driver. Input 0 is the normal color bar, while inputs 1-3 are modified color bars. This allows testing input selection on userspace applications and serves as an implementation model for other drivers. The current approach allows a maximum of 10 different inputs, since the input name generator assumes that we need just one digit to present the input. It shouldn't be hard to modify it to present a bigger name of inputs, but, in fact, it doesn't make much sense of doing it for this test driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02V4L/DVB (10135): v4l2: introduce v4l2_file_operations.Hans Verkuil1-7/+5
Introduce a struct v4l2_file_operations for v4l2 drivers. Remove the unnecessary inode argument. Move compat32 handling (and llseek) into the v4l2-dev core: this is now handled in the v4l2 core and no longer in the drivers themselves. Note that this changeset reverts an earlier patch that changed the return type of__video_ioctl2 from int to long. This change will be reinstated later in a much improved version. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21V4L/DVB (9327): v4l: use video_device.num instead of minor in video%dHans Verkuil1-3/+3
The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now independent of the minor number. So instead of using the minor field of the video_device struct one has to use the num field: this always contains the kernel number of the device node. I forgot about this when I did the v4l2 core change, so this patch converts all drivers that use it in one go. Luckily the change is trivial. Cc: michael@mihu.de Cc: mchehab@infradead.org Cc: corbet@lwn.net Cc: luca.risolia@studio.unibo.it Cc: isely@pobox.com Cc: pe1rxq@amsat.org Cc: royale@zerezo.com Cc: mkrufky@linuxtv.org Cc: stoth@linuxtv.org Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17V4L/DVB (9239): Add support for rgb555 pixel formats to viviMagnus Damm1-0/+40
This patch adds RGB555 pixel format support to the vivi driver. Both little endian and big endian versions are added. The driver follows the RGB pixel format described in Table 2-2 of the V4L2 API spec, _not_ the older BGR interpretation described in Table 2-1. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17V4L/DVB (9238): Add support for rgb565 pixel formats to viviMagnus Damm1-0/+40
This patch adds RGB565 pixel format support to the vivi driver. Both little endian and big endian versions are added. The driver follows the RGB pixel format described in Table 2-2 of the V4L2 API spec, _not_ the older BGR interpretation described in Table 2-1. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17V4L/DVB (9237): Add uyvy pixel format support to viviMagnus Damm1-0/+20
This patch simply adds UYVY pixel format support to the vivi driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17V4L/DVB (9236): Teach vivi about multiple pixel formatsMagnus Damm1-30/+67
This patch contains the ground work to add support for multiple pixel formats to vivi.c Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17V4L/DVB (9235): Precalculate vivi yuv valuesMagnus Damm1-59/+58
This patch improves the color space conversion code in vivi.c to directly draw with precalculated YUV values as palette instead of drawing with YUV that is calculated from RGB for every two pixels. This way we eliminate the need for 9 multiplications every two pixels. A side effect of this patch is that the time counter is changed from green text on black background to white text on black background. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8613): v4l: move BKL down to the driver level.Hans Verkuil1-1/+6
The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03V4L/DVB (8842): vivi_release(): fix use-after-freeAdrian Bunk1-4/+4
video_device_release() does kfree(), which made the following printk() doing a use-after-free. printk() first and release then. Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03V4L/DVB (8751): vivi: Fix some issues at vivi register routineMauro Carvalho Chehab1-8/+36
This patch fixes several small issues at vivi register routines: 1) minor and n_devs should be unsigned; 2) n_devs = 0 were not properly handled; 3) if n_devs specify a high number, the driver would just roll back and won't register any device. The proper behaviour is to keep all succeded devices registered; 4) both n_devs and minor were using 0 as permissions. Better to have them with 0444. With the current patch, if n_devs specify a very large value, it will register all possible devices. For example, on a machine without any other V4L drivers loaded, with this patch, we will have something like: vivi: V4L2 device registered as /dev/video0 vivi: V4L2 device registered as /dev/video1 vivi: V4L2 device registered as /dev/video2 ... vivi: V4L2 device registered as /dev/video31 video_register_device_index: get_index failed Video Technology Magazine Virtual Video Capture Board ver 0.5.0 successfully loaded. 5) The number of allocated devices on success is now kept at n_devs: $ cat /sys/module/vivi/parameters/n_devs 32 Thanks to Henne <henne@nachtwindheim.de> for pointing that there were some issues at vivi. Cc: Henne <henne@nachtwindheim.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-07-27V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_deviceHans Verkuil1-1/+0
The type and type2 fields were unused and so could be removed. Instead add a vfl_type field that contains the type of the video device. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-26V4L/DVB (8482): videodev: move all ioctl callbacks to a new v4l2_ioctl_ops structHans Verkuil1-7/+11
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23V4L/DVB (8430): videodev: move some functions from v4l2-dev.h to v4l2-common.h or v4l2-ioctl.hHans Verkuil1-0/+1
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8024): vivi: rename MODULE_NAME macro to VIVI_MODULE_NAME to avoid namespace conflictsMauro Carvalho Chehab1-4/+4
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8023): vivi: announce that it is registered as /dev/video%dCarl Karsten1-4/+15
Signed-off-by: Carl Karsten <carl@personnelware.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacksHans Verkuil1-9/+9
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26V4L/DVB (8100): V4L/vivi: fix possible memory leak in vivi_fillbuffMarcin Slusarz1-3/+4
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-04-26V4L/DVB (7732): vivi: fix a warningMauro Carvalho Chehab1-1/+1
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-24V4L/DVB (7551): vivi: Add a missing \nMauro Carvalho Chehab1-2/+2
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7518): media/video/ replace remaining __FUNCTION__ occurrencesHarvey Harrison1-11/+11
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7492): vivi: Simplify the vivi driver and avoid deadlocksBrandon Philips1-232/+81
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7491): vivi: make vivi openable only onceBrandon Philips1-2/+18
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7456): vivi: Add 32bit compatibility to the moduleMauro Carvalho Chehab1-0/+1
Thanks to Jiri Slaby <jirislaby@gmail.com> for pointing this issue. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25V4L/DVB (7022): Fix timestamp presentation on vivi driverMauro Carvalho Chehab1-7/+8
Due to date overflow, vivi were not working fine anymore. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25V4L/DVB (6817): Cleanup kernel thread and provide overrun detectionMauro Carvalho Chehab1-32/+41
The previous code were a little bit messy. Cleans it up. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25V4L/DVB (6816): Add proper locking for buffer fillingMauro Carvalho Chehab1-2/+10
Avoids de-alocating buffers before finishing to fill a buffer Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25V4L/DVB (6815): Fix vivi internal debug messagesMauro Carvalho Chehab1-42/+67
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25V4L/DVB (6807): fix debug enableMauro Carvalho Chehab1-1/+1
The changes at vivi_template make debug option to not work properly. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25V4L/DVB (6806): Allow emulating changes of video std by viviMauro Carvalho Chehab1-2/+2
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25V4L/DVB (6758): Miscelaneous cleanupsMauro Carvalho Chehab1-241/+246
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>
2008-01-25V4L/DVB (6755): Avoid troubles when using multiple devicesMauro Carvalho Chehab1-4/+4
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>
2008-01-25V4L/DVB (6754): Allow vivi to open multiple video devicesMauro Carvalho Chehab1-44/+62
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>
2008-01-25V4L/DVB (6753): Fix vivi to support non-zero minor nodeMauro Carvalho Chehab1-8/+32
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>