summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/v4l1-compat.c
AgeCommit message (Collapse)Author
2009-01-09backport commit 5f820f648c92a5ecc771a96b3c29aa6e90013bbaMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Author: Tejun Heo <htejun@gmail.com> poll: allow f_op->poll to sleep f_op->poll is the only vfs operation which is not allowed to sleep. It's because poll and select implementation used task state to synchronize against wake ups, which doesn't have to be the case anymore as wait/wake interface can now use custom wake up functions. The non-sleep restriction can be a bit tricky because ->poll is not called from an atomic context and the result of accidentally sleeping in ->poll only shows up as temporary busy looping when the timing is right or rather wrong. This patch converts poll/select to use custom wake up function and use separate triggered variable to synchronize against wake up events. The only added overhead is an extra function call during wake up and negligible. This patch removes the one non-sleep exception from vfs locking rules and is beneficial to userland filesystem implementations like FUSE, 9p or peculiar fs like spufs as it's very difficult for those to implement non-sleeping poll method. While at it, make the following cosmetic changes to make poll.h and select.c checkpatch friendly. * s/type * symbol/type *symbol/ : three places in poll.h * remove blank line before EXPORT_SYMBOL() : two places in select.c Oleg: spotted missing barrier in poll_schedule_timeout() Davide: spotted missing write barrier in pollwake() kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30v4l2-ioctl: change to long return type to match unlocked_ioctl.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Since internal to v4l2 the ioctl prototype is the same regardless of it being called through .ioctl or .unlocked_ioctl, we need to convert it all to the long return type of unlocked_ioctl. Thanks to Jean-Francois Moine for posting an initial patch for this and thus bringing it to our attention. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> CC: Jean-Francois Moine <moinejf@free.fr>
2008-10-21backport commit a65e5d782f9db2a61a914dc01a329e0c2dcf92a1Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Author: Johannes Berg <johannes@sipsolutions.net> remove CONFIG_KMOD from drivers Straight forward conversions to CONFIG_MODULE; many drivers include <linux/kmod.h> conditionally and then don't have any other conditional code so remove it from those. kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21Get rid of inode parameter at v4l_compat_translate_ioctl()Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> The inode parameter at v4l_compat_translate_ioctl() were just passed over several places just to keep compatible with fops.ioctl. However, it weren't used anywere. This patch gets hid of this unused parameter. Priority: normal CC: Laurent Pinchart <laurent.pinchart@skynet.be> CC: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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-03-12reduce stack usage of v4l1_compat_syncMauro Carvalho Chehab
From: Marcin Slusarz <marcin.slusarz@gmail.com> poll_one allocated on stack struct poll_wqueues which is pretty big structure (>500 bytes on x86_64). v4l1_compat_sync invokes poll_one in a loop, so allocate struct poll_wqueues in v4l1_compat_sync (with kmalloc) and pass it to poll_one. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-12reduce stack usage of v4l_compat_translate_ioctlMauro Carvalho Chehab
From: Marcin Slusarz <marcin.slusarz@gmail.com> v4l_compat_translate_ioctl used 1376 bytes of stack (x86_64), so split this 800 lines long function into ~20 small noinline functions; the biggest function takes now 712 bytes (v4l1_compat_sync) fix VIDIOCSWIN handler which printked wrong errors Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-10 fix coding style violations in v4l1-compat.cMauro Carvalho Chehab
From: Marcin Slusarz <marcin.slusarz@gmail.com> fix most coding style violations found by checkpatch Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-05 V4L1 - fix v4l_compat_translate_ioctl possible NULL derefMauro Carvalho Chehab
From: Cyrill Gorcunov <gorcunov@gmail.com> There are possible NULL pointer derefs in case of kzalloc fails so fix them. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-21 V4L: Storage class should be before const qualifierMauro Carvalho Chehab
From: Tobias Klauser <tklauser@distanz.ch> The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 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-11-02backport changeset e8c44319c691dfb4a0b039b095204c040df9b01aMauro Carvalho Chehab
Author: Ralf Baechle <ralf@linux-mips.org> Date: Thu Oct 18 03:07:07 2007 -0700 Replace __attribute_pure__ with __pure To be consistent with the use of attributes in the rest of the kernel replace all use of __attribute_pure__ with __pure and delete the definition of __attribute_pure__. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-21Cleanup: remove linux/moduleparam.h from drivers/media filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This patch removes all occurences of moduleparm.h from drivers/media files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-13Backport kernel changeset e63340ae6b6205fef26b40a75673d1c9c0c8bb90Mauro Carvalho Chehab
From: Mauro Carvalho Chehab kernel-sync: The original patch description, from Randy Dunlap <randy.dunlap@oracle.com>: header cleaning: don't include smp_lock.h when not used Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-08Fix mistake in patch 5571Mauro Carvalho Chehab
From: Trent Piepho <xyzzy@speakeasy.org> Two lines from an older version snuck in. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27v4l1-compat: Make VIDIOCSPICT return errors in a useful wayTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Among other things, VIDIOCSPICT sets the pixel format. Some drivers don't support all formats, e.g. cx88 doesn't support the planar formats. The compat code that translates VIDIOCSPICT into V4L2 ioctls doesn't pass on any errors, so a userspace program doesn't know if it has selected an unsupported pixel format. VIDIOCSPICT sets both the memory capture and overlay formats, and it's possible that one will be set while the other will fail, e.g. cx88 doesn't even support overlay. Also, trying to set the overlay format will fail for non-root users. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-04-27v4l1-compat: misc fixes for pixelformat functionTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Mark the palette2pixelformat lookup table as const pixelformat is unsigned, adjust the palette2pixelformat table and pixelformat_to_palette() palette_to_pixelformat() is a pure function pixelformat_to_palette() is a const function Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-19compat: Add -include linux/version.h to cflagsTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add -include linux/version.h to the cflags. Now code can have backward compatibility test without including compat.h first. Linux headers included from compat.h are removed, so that code will get the same headers when compiling in v4l-dvb as it does in the kernel. Many drivers have compat.h moved to the end of their include list, as this lets compat.h do things it can't do at the beginning. Such as test of something is defined to include compat code, or to put a wrapper around a function without changing the function's name. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-01-09Fix authorship referencesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Bill Dirks asked me to update his entries at kernel files, since he change his e-mail. I've also updated a few web broken links or obsolete info to the curent sites where V4L drivers and API are being discussed currently. CC: Bill Dirks <bill@thedirks.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-20Fixes uninitialized variables passed to VIDIOC_G_FBUF.Mauro Carvalho Chehab
From: audetto@tiscali.it <"audetto@tiscali.it"> Signed-off-by: Andrea A Odetti <audetto@tiscali.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-20Fix: implement missing VIDIOCSTUNER on v4l1-compat moduleMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-20Cleans some ioctl structs before calling V4L2 counterpartMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-08-06On some cases, depth were not returned.Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-08-03Fix V4L1 Compat for VIDIOCGPICT ioctlMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-08-03From: Mauro Carvalho Chehab <mchehab@infradead.org>Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-19Remove obsolete #include <linux/config.h>Mauro Carvalho Chehab
From: Jörn Engel <joern@wohnheim.fh-wedel.de> kernel-sync: Kernel adds "-include include/linux/autoconf.h" for every file to be compiled, so, including config.h is not required. Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-05Removed all references to kernel stuff from videodev.h and videodev2.hMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> The videodev.h and videodev2.h describe the public API for V4L and V4L2. It shouldn't have there any kernel-specific stuff. Those were moved to v4l2-dev.h. This patch removes some uneeded headers and include v4l2-common.h on all V4L driver. This header includes device implementation of V4L2 API provided on v4l2-dev.h as well as V4L2 internal ioctls that provides connections between master driver and its i2c devices. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-04-11Since we are not using CVS, $Id makes no sense anymoreMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-11From: Panagiotis Issaris <takis@issaris.org>Mauro Carvalho Chehab
Conversions from kmalloc+memset to k(z|c)alloc Conversions from kmalloc+memset to k(z|c)alloc. kernel-sync Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2005-12-14bttv VBI fixesHans Verkuil
From: Michael H. Schimek <mschimek@gmx.at> - V4L2_(G|S|TRY)_FMT returned incorrect VBI start lines for PAL-M, NTSC-JP, and PAL-60. They also returned an inaccurate VBI offset. - V4L2_(G|S)_FMT and V4L2_TRY_FMT disagreed about the start of VBI capturing in PAL and SECAM second field. Note the start line fixes may break applications using VIDIOCSVBIFMT because this ioctl fails when the driver does not support exactly the requested parameters. - V4L2_TRY_FMT did not clear the reserved field in struct v4l2_vbi_format. - V4L2_(S|TRY)_FMT did not expect very large or small VBI start or count values, returning wrong (but safe) counts due to an overflow. - VIDIOCGVBIFMT confused V4L and V4L2 VBI flags. However this had no effect because the flags have the same value and bttv never sets them. - In v4l_compat_translate_ioctl() the VIDIOC(G|S)VBIFMT code did not expect V4L2 drivers supporting VBI formats besides V4L2_PIX_FMT_GREY. Signed-off-by: Michael H. Schimek <mschimek@gmx.at> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2005-12-07kernel-sync patches.Mauro Carvalho Chehab
kernel-sync Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-10-16- Whitespace Cleanups.Mauro Carvalho Chehab
- Whitespace script improved. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-10-08VIDIOCSFREQ and VIDIOCGFREQ expect an unsigned long as argument.Michael Krufky
v4l1-compat.c expects an int. The first is 8 bytes for an AMD64, the second only 4. This patch fixes this. I've checked other sources in the v4l repository and they all use unsigned long, so this is the only place that needs patching. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-07-13 - Linux/version.h removed. Replaced by linux/utsname.hMauro Carvalho Chehab
where KERNEL_VERSION is required. - incremented versions for CX88, BTTV and SAA7134. * compat.h: - Included linux/version.h. This change is required to be compatible with a patch applied at Kernel by Olaf Hering <olh@suse.de> this patch does reduce kernel dependency of its version number. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-06-22 * bttv-cards.c, cx88-core.c, cx88.h, v4l1-compat.c,doc/CARDLIST.bttv,Mauro Carvalho Chehab
doc/CARDLIST.saa7134, doc/Cards: - tail spaces removed. * cx88-core.c, cx88.h: - cx88_pci_irqs changed to static * doc/V4L1_API.html: - Now informs that it is obsolete. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-06-12 * audiochip.h, compat.h, cx22702.h, cx88-core.c, cx88-dvb.c,Mauro Carvalho Chehab
cx88-i2c.c, cx88-vbi.c, cx88-video.c, dpl3518.c, dpl3518.h, i2c-compat.h, id.h, msp3400.h, or51132.c, or51132.h, plx9054.h, rds-saa6588.c, saa7134-dvb.c, tda7432.c, tda9875.c, tvaudio.c, tveeprom.h, tvmixer.c, v4l1-compat.c, video-buf-dvb.h: - Minor changes to synchronize with -mm series; - PAL-60 code maintained for SAA7134. However, -mm has different values; - Now, every .c or .h file has cvs field ID.
2005-06-07Make stereo/mono settings available for applications. Some improvementsNickolay V. Shmyrev
for MK3 tuners. Now tda9887 has stereo setting by default
2004-12-10- add moduleparam.h include to many files.Gerd Knorr
- some pinnacle 300i progress (can talk to mt352 now, not working yet through). - misc minor stuff.
2004-11-07- yet another video-buf interface change + fixups.Gerd Knorr
- move more modules to new-style insmod options.
2004-10-13- kill trailing whitespaces.Gerd Knorr
2004-08-25- merge 2.6.9-rc1 changes (mostly __user stuff).Gerd Knorr
2004-03-15- cropcap fixes.Gerd Knorr
- v4l1-compat fix.
2004-03-05- more cards supported in ir-kbd-gpio.cGerd Knorr
- add magics to video-buf structs. - fix saa7134 oss driver spinlocks. - misc minor stuff.
2004-02-22Initial revisionGerd Knorr