After this patch, the order of the functions will be the same as before the
patch converting the driver to user video_ioctl2. This makes easier to diff
between the previous version and the newer one.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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>
Once the image rejection calibration procedure has been successful,
we should not initialize the tuner registers again.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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>
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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>
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>
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>
Inadvertently missed a line when converting code to new hardware buffering
method. In some circumstances, this would lead to a frame being displayed
using parameters belonging to another frame.
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>
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>
Currently the yuv output stream buffer is divided into blocks whose size
depend on the broadcast standard selected during the driver init phase.
However, the standard can be changed after the init phase. This effectively
breaks the yuv output stream handler, since it relies on the different yuv
planes being block aligned.
This patch changes the setup, so that the block size is always the same. The
decoder dma function has been modified to cope with the fact that the second
yuv plane may no longer be block aligned. The start of the yuv frame must
still be at the beginning of a block, so the stream write function has also
been modified to ensure this is always true.
Also, the stream write function will now initiate a yuv dma transfer as soon
as a full frame is ready. It will not wait until the current write request
has completed, or the stream buffer becomes full.
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>
pvrusb2: When a per-device-type default video standard is declared,
handle it in such a way that it can be correctly and unambiguously
reported in the system log.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
pvrusb2: Eliminate use of volatile in pipeline control state
variables. These were all cases of paranoia; upon further review the
overall mechanism employed here should not require use of volatile.
This had originally been done out of paranoia, and I have since been
convinced that the paranoia is not required.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
pvrusb2: Remove use of volatile for command sequencer; these variables
are set by interrupt-context code and we check their state in such a
manner that there should be no race conditions. This had originally
been done out of paranoia, and I have since been convinced that the
paranoia is not required.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This adds a default video standard setting to the pvr2_device_desc
structure for describing device types. With this change it is
possible to set a reasonable default standard based on device type.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This changeset allows the pvrusb2 driver to operate a new device type
("GOTVIEW USB2.0 DVD2"). Changes amount to defining a new routing
scheme for the device and adding appropriate table entries into
pvrusb2-devattr.c.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The pvrusb2 driver has been successfully recovering from a crashed
encoder now for over 2 years. I think it's time to reduce the
perceived severity of the warning message. While I'd still very much
like to stop these crashes, the recovery logic is solid enough that
the problem is effectively benign. No point in panicing the users
over it.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
For Hauppauge 24xxx devices, the IR receiver is a custom piece of
logic that is very specific to the device. The pvrusb2 driver can
virtualize this to make it look like a more normal IR receiver found
in other Hauppauge devices. The decision of whether or not to enable
this virtualization however is a device-specific attribute, thus this
changeset.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The exact routing of video and audio signals within a device is a
device-specific attribute. Hauppauge devices do it one way; other
types of device may route things differently. Unfortunately it is
rather impractical to define chip-specific routing at the device
attribute level, so instead what happens here is that "schemes" are
defined. Each chip level interface implements its part of a given
scheme and the scheme as a whole is made into a device specific
attribute controlled via a table entry in pvrusb2-devattr.c. The only
scheme defined here is for Hauppauge devices, but clearly this opens
the door for other possibilities to follow.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Arrange so that the pvrusb2 driver can optionally work without a
Hauppauge ROM being present - which is fairly important for devices
that happen to not come from Hauppauge. The expected existence of a
Hauppauge ROM is now a device attribute. The tuner type is now also a
device attribute, which is consulted if there is no ROM.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Correctly mark when a tuner type is set. Report more faithfully
information about known supported device video standards.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Implement additional pvrusb2 device info table entries for a device
identifier and a device description. Export this information via the
driver's internal API. Make this information available via the sysfs
driver interface. Also propagate this information into the v4l2
capability structure. An app can now retrieve and report a
descriptive string about the particular type of hardware device it is
operating.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Device-specific driver behavior is now defined by generic device
characteristics rather than by specific device model information.
With this change, the hardware type field can go away, thus this
change.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The pvrusb2 driver currently supports two variants of the Hauppauge
PVR USB2. However there are other hardware types potentially
supportable, but the driver at the moment is not structured to make it
easy to describe these minor variations. This changeset is the first
set of changes to make such additional device support possible.
Device attributes are held in several tables all contained within
pvrusb2-devattr.c; all other device-specific driver behavior now
derives from these tables.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This is a new implementation for video pipeline control within the
pvrusb2 driver. Actual start/stop of the pipeline is moved to the
driver's kernel thread. Pipeline stages are controlled autonomously
based on surrounding pipeline or application control state. Kernel
thread management is also cleaned up and moved into the internal
control structure of the driver, solving a set up / tear down race
along the way. Better failure recovery is implemented with this new
control strategy. Also with this change comes better control of the
cx23416 encoder, building on additional information learned about the
peculiarities of controlling this part (this information was the
original trigger for this rework). With this change, overall encoder
stability should be considerably improved. Yes, this is a large
change for this driver, but due to the nature of the feature being
worked on, the changes are fairly pervasive and would be difficult to
break into smaller pieces with any semblence of step-wise stability.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Currently the saa7134 chips only have mute support for the TV input.
Cards with mute from external audio muxes are already fine on the
other inputs and some recent tuners mute at least the radio on exit.
But these mostly hybrid tuners are not fully backward compatible, since
they must power down and mute regardless.
For some included above, the MD7134 knows several, to switch on mute/automute
to the TV input is functional and backward compatible for the applications,
except that the tuners with tda9887 always mute on exit.
Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This change adds support for 4 extra keys on the remote currently being
shipped by leadtek with their "WinFast TV2000 XP/Expert" and
"WinFast PVR2000" cards. The remote P/N seems to be Y04G0033 and
you can see a picture of it here: http://lespinasse.org/y04g0033.jpg
The extra keys are at the bottom and are labeled MCE +VOL, -VOL, +CH, -CH.
I chose to map them to the F21-F24 keycodes, following the precedent of
ir_codes_gotview7135[], so as to differentiate these 'MCE' keys from the
other +VOL, -VOL, +CH, -CH 'arrow' keys higher up on the remote.
Signed-off-by: Michel Lespinasse <walken@zoy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
DVB-S is not supported. Also, there are some QAM6 firmwares for xc3028, but it
is reported that this doesn't work fine.
Thanks to Manu Abraham, Michael Krufky and Patrick Boettcher for their
insights.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Move tda18271_map tables to a separate source file,
to improve code readability and ease maintenance.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Force tuner init after attach, then sleep until use.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
A previous patch implemented support for non-OFDM digital TV. However, the
previous bandwidth ofdm parameter were left at the code by mistake.
Thanks to Michael Krufky and Patrick Boettcher for noticing this mistake.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
s-code tables are related to IF frequency used for video demodulation.
The s-codes for analog are automatically loaded, according with video standard.
However, for digital, they will depend on the IF of the demoduler chip. IF of
the demoduler.
Before this patch, only a few IF's where possible to use. This patch allows
selecting any IF defined at firmware file.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>