summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ivtv/ivtv-ioctl.c
AgeCommit message (Collapse)Author
2008-12-30v4l2: debugging API changed to match against driver name instead of ID.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
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-12-30v4l2: introduce v4l2_file_operations.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-11-29ivtv/ivtvfb: convert to v4l2_device/v4l2_subdev.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-10-21Remove unused inode parameter from video_ioctl2Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> inode is never used on video_ioctl2. Remove it and rename the function to __video_ioctl2. This allows its usage directly as a callback at fops.unlocked_ioctl. Since we still need a callback with inode to be used with fops.ioctl, this patch adds video_ioctl2() that is just a call to __video_ioctl2(). Also, this patch adds some comments about video_ioctl2 and __video_ioctl2 usage at v4l2-ioctl.h. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-18ivtv: switch to unlocked_ioctl.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-10-11ivtv: partially revert an earlier patch that checks the max image heightHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Ian Armstrong pointed out to me that it is perfectly valid to have a 576 lines YUV video with NTSC output in this particular case. In fact, without this the X driver for ivtv does not function properly. Reverted my earlier change that restrictred the height to 480 for NTSC and add the comments provided by Ian to explain what is happening here. Priority: normal Thanks-to: Ian Armstrong <ian@iarmst.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-10-09ivtv - Fix potential race condition in yuv handlerHans Verkuil
From: Ian Armstrong <ian@iarmst.demon.co.uk> Modified yuv register update handling to remove a potential race condition which could occur with the first video frame. Also removed a forced yuv position update, since changing the source video dimensions or interlace settings doesn't affect the frame already being displayed. Priority: normal Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-10-06ivtv: V4L2_FBUF_FLAG_OVERLAY status fixHans Verkuil
From: Ian Armstrong <ian@iarmst.demon.co.uk> When the framebuffer format was queried via VIDIOC_G_FBUF, V4L2_FBUF_FLAG_OVERLAY would only be correctly returned for certain screen depths. Priority: normal Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-10-04ivtv: fix raw/sliced VBI mixupHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The service_set field was used in saa7115 and cx25840 to determine whether raw or sliced VBI was desired. This is incorrect since it is perfectly valid to select sliced VBI with a service_set of 0. Instead these drivers should checked on VIDIOC_S_FMT whether the type field matches the raw or sliced VBI type. Updated ivtv accordingly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-09-08cx18/ivtv: add 'PCI:' prefix to bus_info.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Suggested by Martin Dauskardt. This is conform what the other drivers do. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-09-06ivtv: fix incorrect capability and assorted sliced vbi and video out fmt fixesHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - V4L2_CAP_VBI_OUTPUT is not supported by ivtv, remove it. - ivtv_try_fmt_vid_out also needed to constrain the width/height of MPEG decoder window sizes. - allow empty sliced services. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-09-06cx18/ivtv: fix check of window boundaries for VIDIOC_S_FMTHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> It was possible to set out-of-bounds windows sizes, this is now fixed. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
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-06-25ivtv/cx18: remove s/g_ctrl, now all controls are handled through s/g_ext_ctrlHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> videodev converts old-style controls to an extended control so the ivtv and cx18 drivers no longer have to handle both. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-25ivtv/cx18: fix compile error when CONFIG_VIDEO_ADV_DEBUG is not defined.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Thanks to Randy Dunlap for reporting this. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-22cx18/ivtv: ioctl debugging improvementsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Completely rely on the video_ioctl2 debugging facilities rather than doing it ourselves. Fill in some missing fields in ivtv with VIDIOC_G_FBUF. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-21ivtv: yuv decoder lock fix (2)Hans Verkuil
From: Ian Armstrong <ian@iarmst.demon.co.uk> The IVTV_IOC_DMA_FRAME ioctl fails to correctly 'start' the decoder. Although yuv output will be correct, some functions which should be disabled while the decoder is in use remain enabled. This can result in hardware registers being corrupted, causing problems with the mpeg decoder. This patch ensures the decoder 'start' sequence is called, disabling these functions until the device is closed. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-21ivtv/cx18: fix video_temporal_filter handlingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> If the capture is scaled, then the video_temporal_filter is set to 0 by the cx2341x.c module since otherwise you would get ghosting. However, this was also done in the VIDIOC_S_FMT ioctl which meant that the video_temporal_filter control was reset to 0 or 8 each time S_FMT was called. This was old code that should have been removed a long time ago. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-21ivtv: fill in all v4l2_framebuffer fields in VIDIOC_G/S_FBUFHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-21ivtv/cx18: remove unnecessary memsets & KERNEL_VERSION testsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-21ivtv: remove obsolete arrays.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-21ivtv: make sure all v4l2_format fields are filled inHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-05-29ivtv: Convert to video_ioctl2.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-05-01ivtv: prefix ivtv external functions with ivtv_Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Fix conflict with cx18 driver. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-04-26ivtv: fix oops when itv->speed == 0 and VIDEO_CMD_PLAY is called.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-04-26ivtv: use strlcpy instead of strcpy.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-04-20 Fix VIDIOCGAP corruption in ivtvMauro Carvalho Chehab
From: Alan Cox <alan@lxorguk.ukuu.org.uk> Frank Bennett reported that ivtv was causing skype to crash. With help from one of their developers he showed it was a kernel problem. VIDIOCGCAP copies a name into a fixed length buffer - ivtv uses names that are too long and does not truncate them so corrupts a few bytes of the app data area. Possibly the names also want trimming but for now this should fix the corruption case. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-13videobuf: Improve command output for debug purposesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-21ivtv: CROP is not supported for video captureHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> CROPCAP suggests that video capture supports cropping, but this is not the case. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-02-21ivtv: yuv framebuffer trackingHans Verkuil
From: Ian Armstrong <ian@iarmst.demon.co.uk> The existing yuv code limits output to the display area occupied by the framebuffer. This patch allows the yuv output to be 'detached' via V4L2_FBUF_FLAG_OVERLAY. By default, the yuv output window will be restricted to the framebuffer dimensions and the output position is relative to the top left corner of the framebuffer. This matches the behaviour of previous versions. If V4L2_FBUF_FLAG_OVERLAY is cleared, the yuv output will no longer be linked to the framebuffer. The maximum dimensions are either 720x576 or 720x480 depending on the current broadcast standard, with the output position relative to the top left corner of the display. The framebuffer itself can be resized, moved and panned without affecting the yuv output. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-12-08 ivtv: Some general fixesMauro Carvalho Chehab
From: Richard Knutsson <ricknu-0@student.ltu.se> Fix "warning: Using plain integer as NULL pointer". Convert 'x < y ? x : y' to use min() instead. Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-02 ivtv: Remove a invalid shadow-variableMauro Carvalho Chehab
From: Richard Knutsson <ricknu-0@student.ltu.se> Remove the shadowing 'struct v4l2_chip_ident *chip', since it already exists and makes the if-statement useless. Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-05ivtv: ivtv yuv format description correctionHans Verkuil
From: Ian Armstrong <ian@iarmst.demon.co.uk> The driver was incorrectly reporting that it supported YUV 4:2:2 output, when it is actually YUV 4:2:0. Though I believe the hardware can be pushed to 4:2:2, we don't currently support that. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-11-05ivtv: Initial merge of video48 yuv handling into the IVTV_IOC_DMA_FRAME ↵Hans Verkuil
framework From: Ian Armstrong <ian@iarmst.demon.co.uk> Previously, all yuv data written to /dev/video48 had only basic support with no double buffering to avoid display tearing. With this patch, yuv frames written to video48 are now handled by the existing IVTV_IOC_DMA_FRAME framework. As such, the frames are hardware buffered to avoid tearing, and honour scaling mode & field order options. Unlike the proprietary IVTV_IOC_DMA_FRAME ioctl, all parameters are controlled by the V4L2 API. Due to mpeg & yuv output restrictions being different, their V4L2 output controls have been separated. To control the yuv output, the V4L2 calls must be done via video48. If the ivtvfb module is loaded, there will be one side effect to this merge. The yuv output window will be constrained to the visible framebuffer area. In the event that a virtual framebuffer size is being used, the limit to the output size will be the virtual dimensions, but only the portion that falls within the currently visible area of the framebuffer will be shown. Like the IVTV_IOC_DMA_FRAME ioctl, the supplied frames must be padded to 720 pixels wide. However the height must only be padded up the nearest multiple of 32. This would mean an image of 102 lines must be padded to 128. As long as the true source image size is given, the padding will not be visible in the final output. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-10-12ivtv: fix resizing MPEG1 streamsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Resizing an MPEG 1 stream would cut off the right half of the image due to a missing divide by 2 in VIDIOC_S_FMT. Also did some minor cleanup in this part of the code. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-25ivtv: use new videodev2.h pixel formatsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-24ivtv: set correct pixel format and alpha properties in VIDIOC_G_FBUFHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-23ivtv: fix VIDIOC_G_ENC_INDEX flag handlingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Due to a documentation bug (the type mask is 3 bits long, not 2) the wrong frame types were filled in: the B and P frame types were swapped. This bug also hid a second bug: when a capture is stopped a last entry is written into the pgm index buffer with internal type 0, denoting the end of the program. This entry wasn't ignored, instead it was accidentally returned to the caller as a P frame. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-23ivtv: reorganized and cleanup ivtv structHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-23ivtv: more cleanups, merged ivtv-audio.c and ivtv-video.c into ivtv-routing.cHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-22ivtv: log in status if framebuffer uses YUV instead of RGBHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-20ivtv: prevent changing VBI format while capture is in progress.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Changing the VBI format requires a CX2341X_ENC_INITIALIZE_INPUT firmware call. This can only be done if no capture is in progress. So return -EBUSY if the encoder is busy. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-20ivtv: fix output mode processing: UDMA_YUV wasn't cleared.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - Always clear when stopping the decoder - Clear if the filehandle that is being close was used for UDMA_YUV output. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-19ivtv: add VIDIOC_OVERLAYHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add VIDIOC_OVERLAY to enable/disable the OSD. Also add the OSD state to the log status report. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-19ivtv: log stereo/bilingual audio modesHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-19ivtv: move serialization to the fileops level.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Serialization is now done on the open/close/ioctl level and also when the read/write/poll start an encoder/decoder stream. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-19ivtv: improve debug messagesHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - add FILE debug flag for open/close/read/write/poll. - show cmd for encoder/decoder command ioctl. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-18ivtv: fix handling of INITIALIZE_INPUT fw callHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The CX2341X_ENC_INITIALIZE_INPUT firmware call requires careful handling, otherwise the computer can freeze or the top-third of the screen can start flickering. This patch ensures that CX2341X_ENC_INITIALIZE_INPUT is called at the right time and in the right way. In addition the stop capture handling was improved so that the last pending DMA transfer is also processed. Otherwise this would be the first data that arrived when a new capture was started which is not what you want. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-04ivtv: make VIDIOC_INT_RESET support smarter.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add support to optionally reset the IR and/or the video digitizer. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>