History log of /drivers/media/video/ivtv/ivtv-yuv.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cdc037817cc15caf931cd3476970860d62f1985c 11-Oct-2011 Hans Verkuil <hans.verkuil@cisco.com> [media] ivtv: switch to the v4l core lock

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/ivtv/ivtv-yuv.c
7fd4b41f053681cccf188cc1731ae43fe38fa969 12-Feb-2011 Paul Cassella <fortytwo-ivtv@manetheren.bigw.org> [media] ivtv: yuv: handle get_user_pages() -errno returns

get_user_pages() may return -errno, such as -EFAULT. So don't blindly use
its return value as an offset into dma->map[] for the next get_user_pages()
call. Since we'll give up and return an error if either fails, don't even
make the second call if the first failed to give us exactly what we were
looking for.

The old code would also call put_page() on as many elements of dma->map[]
as we'd asked for, regardless of how many were valid.

[Andy Walls modified this patch to return -EFAULT instead of -EINVAL
as Paul's observation "I'm not sure -EINVAL is the best return code vs
-EFAULT or -ENOMEM, [...]" was correct. The return value bubbles up
as a return code for write(), for which the V4L2 API spec indicates
EINVAL is incorrect and EFAULT is correct.]

Signed-off-by: Paul Cassella <fortytwo-ivtv@maneteren.bigw.org>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/ivtv/ivtv-yuv.c
ec105a42ac397366e05888ea96503ab3b57f79ad 02-May-2009 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (11674): ivtv: fix incorrect bit tests

Found the coccinelle tool.

Thanks-to: Julia Lawall <julia@diku.dk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/ivtv/ivtv-yuv.c
8ac05ae3192ce8a71fc84e4a88772cce0c09173c 07-Feb-2009 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (10488): ivtv: cleanup naming conventions

Use consistent naming for pci_dev, v4l2_device and video_device.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/ivtv/ivtv-yuv.c
2bd7ac55c31cb4f42e331d69dde9fc034a68944f 09-Oct-2008 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (9166): ivtv - Fix potential race condition in yuv handler

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.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/ivtv/ivtv-yuv.c
b0510f8dc73dce56f35337487c6374ae84b15446 21-May-2008 Al Viro <viro@ftp.linux.org.uk> V4L/DVB (7963): ivtv: trivial annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
3f98387efa9333c5765d36e144c47c107d6ba64a 01-May-2008 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (7854): cx18/ivtv: improve and fix out-of-memory handling

- don't show kernel backtrace when the allocation of the buffers fails: the
normal ivtv/cx18 messages are clear enough and the backtrace scares users.
- fix cleanup after the buffer allocation fails (caused kernel panic).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
a6a3a17b7fdaf824e6d73e8e4a94c9d149302f74 29-Apr-2008 Harvey Harrison <harvey.harrison@gmail.com> media: fix integer as NULL pointer warnings

drivers/media/video/v4l2-common.c:719:16: warning: Using plain integer as NULL pointer
drivers/media/video/au0828/au0828-dvb.c:122:19: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1101:22: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1102:23: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-audio.c:78:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c:84:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1264:9: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-context.c:197:28: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:126:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:133:32: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:145:31: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:177:55: warning: Using plain integer as NULL pointer
drivers/media/video/videobuf-core.c:100:9: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/media/video/ivtv/ivtv-yuv.c
88ab075aee974f70b7b0273a964810698c8a5b95 22-Apr-2008 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (7243): ivtv: yuv framebuffer tracking

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
5eedc466758b5743512d38b5d1eab6f799a39e00 22-Apr-2008 Adrian Bunk <bunk@kernel.org> V4L/DVB (7105): ivtv-yuv.c: make 3 functions static

This patch makes the following needlessly global functions static:
- ivtv_yuv_next_free()
- ivtv_yuv_setup_frame()
- ivtv_yuv_udma_frame()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
2b057e8dc6cc8318956fef92b77a4e86985e84d9 13-Nov-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (6719): ivtv: ivtv-yuv clean-up + source cropping bug-fix

ivtv-yuv code clean up & reformat. Includes minor changes to some debug lines.

Also fixes a bug found during the reformatting, which would cause the
incorrect amount of yuv data to be sent to the card if source cropping
coordinates were used.

Apart from the bug-fix, there should be no functional difference to the
previous version.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
77aded6ba51f01335840ce8e18b413067810b68e 05-Nov-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (6717): ivtv: Initial merge of video48 yuv handling into the IVTV_IOC_DMA_FRAME framework

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
3b5c1c8e71eb8fe2297a5884db59108e3c8b44c5 22-Oct-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (6716): ivtv: yuv interlace mode change

Interlace mode selection code moved into the frame setup phase, so it's now
run before the frame is loaded into a hardware buffer. Given that it can
affect how a new frame is displayed, it was a bit stupid running it after the
frame was already visible.

A few stray interlace related variables which were linked to individual frames
have now been moved into the yuv_frame_info struct. This means that all
variables linked to a specific frame are in the same place & not scattered.

Minor code reformatting in areas touched by the above changes.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
406c8b0ff0891ace87440bcb298a91c1927f9ae5 21-Oct-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (6715): ivtv: Remove unnecessary register update

To reduce the number of display register accesses, the yuv code keeps track of
the current video settings. Should there be a change in any single parameter,
it will update the associated display registers to ensure everything is
displayed correctly.

The existing check also looks at the field order for the video. This is not
required, since field reversal does not require any display register changes.

This patch removes the field order from the check.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
a3e5f5e2dfb50bebca24329e5377d804c6e3eb1b 20-Oct-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (6713): ivtv: ivtv_yuv_prep_frame breakup and yuv hardware buffer changes

ivtv_yuv_prep_frame is split in smaller code blocks.

Modified yuv buffer handling on the PVR350 itself. We now cycle through all 8
hardware buffers.

With this patch in place, driver behaviour should remain unchanged from the
existing release.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
195b1252517d504391d29f71b789d4c1c9f605e0 14-Oct-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (6346): ivtvfb: YUV output size fix when ivtvfb is not loaded

If the ivtvfb module isn't loaded, the valid YUV output area should be set to
full-screen. This patch fixes the case where the valid output area was not
reset when the output broadcast format was changed from NTSC to PAL. This
resulted in output being limited to the top 480 lines of the display.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
0bfeb04a9f3ad9ad8c9bbba062231ff1a76e4465 14-Oct-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (6345): ivtvfb: YUV handling of an image which is not visible in the display area

When the ivtvfb module is loaded, the YUV output is relative to the
framebuffer output. When a virtual screen size is used, the output area for
the YUV may actually be off screen. To prevent the hardware from crashing,
the current driver will ignore an off-screen position and leave the output
visible at the last on-screen position. This may not be desirable, so this
patch will switch off the YUV output should the image move off-screen, and
re-enable it should the image move on-screen again.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
33c0fcad2160bc211272295e862c6f708118d006 23-Aug-2007 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (6092): ivtv: more cleanups, merged ivtv-audio.c and ivtv-video.c into ivtv-routing.c

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
612570f2c4794bbf4e5bfa8648b61fbfc9cd8501 23-Aug-2007 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (6091): ivtv: header cleanup

- add guards
- remove unused header includes
- move card-specific stuff from ivtv-driver.h to ivtv-cards.h
- move YUV-specific stuff from ivtv-driver.h to ivtv-yuv.h

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
8beb058f1ecde7bc0554d18ce1baa18b5dfb02d3 19-Aug-2007 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (6060): ivtv: fix IVTV_IOC_DMA_FRAME bug introduced by highmem bugfix

The return value of ivtv_udma_fill_sg_list() was changed by the
highmem bugfix, but that return value was still used in ivtv-yuv.c.

Revert to the old return value, but in addition return -1 in case of
a memory allocation error.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
0989fd2c88a11aa5014b2b348ed51872d14d536d 19-Aug-2007 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (6058): ivtv: add support for highmem udma

When trying to DMA userspace buffers to the cx23415 you need to check
whether the page is in highmem. If this is the case, then bounce buffers
have to be used to allow DMA.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
bfd7beacff2b5c811badb587a74c3dfbf7f98721 03-Aug-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (5973): ivtv: attach yuv field order to each frame

In the current driver, the field order is global. As soon as it's changed it
takes immediate effect. This is a problem when the video changes order mid
stream. Although it mostly works okay, the video may judder / flicker.

This patch attaches the field order to the frame, so that any buffered frames
will not be displayed until the correct field. In the event that the field
order is changed mid stream, the driver will ensure that the previous frame
is displayed for a minimum of 3 fields. These are the two original fields the
frame should have occupied, plus the one extra since the new frame still has
to wait for the correct field.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
943e8910db31e36d945f2bf7d4c273ca5fa01f6e 03-Aug-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (5972): ivtv: prevent yuv register updates from being missed

The yuv output code always compares the new frame position & size with those
of the previous frame. If they are different, a flag is set to request the
yuv output registers be updated when the new frame is displayed.

If the incoming frames are delivered too fast, exhausting the buffers, the
most recent frame already buffered will be discarded. Unfortunately, any
update request will also be discarded. If the new frame matches the size &
position of the now discarded frame, the yuv registers are not flagged for
update & will remain in their old state.

This patch preserves the register update flag in the event that a frame is
dropped.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
b4b38bd63c07c8927b43c6c378eca1db10fdaf2e 03-Aug-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (5970): ivtv: prevent vertical overflow of yuv output

When the video standard is changed, there's no guarantee the framebuffer
dimensions are still legal. The yuv output code uses these dimensions to
calculate the size & position for the video overlay. If the framebuffer
dimensions are now illegal, the output may exceed the vertical limit of the
display, causing distortion.

This patch adds an additional check to ensure the output doesn't exceed
the limits for the current video standard, cropping if required.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
9e0df402e695e638dfee94a6e05fca48b15404e6 16-Mar-2007 Ian Armstrong <ian@iarmst.demon.co.uk> V4L/DVB (5438): Fix ivtv yuv threshold handling

Modifies automatic mode selection for yuv playback. Behaviour is now that
source video with a vertical resolution below that of the currently set
broadcast mode will be treated as progressive. Video with a vertical
resolution greater or equal to the current broadcast mode (up to 576 lines)
will be treated as interlaced.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
83df8e7b0d7b319f9ce9773eaf4b1da324ae17d7 10-Mar-2007 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (5405): Add missing includes.

Every file should include the headers containing the prototypes
for its global functions.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
1e13f9e3f1501cc167e40a2adf07e6e4705cb331 10-Mar-2007 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (5404): Merges VBI & YUV handling into a single work queue.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c
1a0adaf37c30e89e44d1470ef604a930999a5826 27-Apr-2007 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder

It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!

Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/ivtv/ivtv-yuv.c