Philipp Zabel [Wed, 6 Aug 2014 11:02:23 +0000 (08:02 -0300)]
[media] coda: checkpatch cleanup
This patch breaks most long lines, concatenates broken up text strings,
and adds or removes parentheses where needed to make checkpatch happy.
The long codec list lines and a few 81-wide lines remain.
Philipp Zabel [Tue, 5 Aug 2014 17:00:20 +0000 (14:00 -0300)]
[media] coda: disable old cropping ioctls
Since we neither support composing on the OUTPUT side, nor cropping
on the CAPTURE side, disable VIDIOC_CROPCAP and VIDIOC_G/S_CROP
altogether. This silences a GStreamer warning when GStreamer tries
to obtain the pixel aspect ratio using VIDIOC_CROPCAP.
Philipp Zabel [Tue, 5 Aug 2014 17:00:19 +0000 (14:00 -0300)]
[media] coda: set capture frame size with output S_FMT
This patch makes coda_s_fmt_vid_out propagate the output frame size
to the capture side.
The GStreamer v4l2videodec only ever calls S_FMT on the output side
and then expects G_FMT on the capture side to return a valid format.
Philipp Zabel [Tue, 5 Aug 2014 17:00:17 +0000 (14:00 -0300)]
[media] coda: fix timestamp list handling
Lock modification of the timestamp list with bitstream_mutex and do not
try to remove a timestamp element if the list is empty. This can happen
if the userspace feeds us garbage or multiple encoded frames in a single
buffer.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Philipp Zabel [Tue, 5 Aug 2014 17:00:14 +0000 (14:00 -0300)]
[media] coda: increase max vertical frame size to 1088
This patch increases the maximum vertical frame size reported
by enum_fmt and accepted by try_fmt/s_fmt from 1080 to 1088.
Since for 16x16-pixel macroblocks 1080p will be rounded up to
this anyway, we may as well admit that we support it.
Philipp Zabel [Wed, 23 Jul 2014 15:28:43 +0000 (12:28 -0300)]
[media] coda: move per-instance buffer allocation and cleanup
This patch moves the context buffer allocation into the context start_streaming
callbacks. The context buffer and internal framebuffer cleanup is moved into
the context release callback.
Philipp Zabel [Wed, 23 Jul 2014 15:28:40 +0000 (12:28 -0300)]
[media] coda: add context ops
Add a struct coda_context_ops that encapsulates context specific operations.
This will simplify adding JPEG support in the future and helps to avoid
exporting all functions individually when they move out of the main code
file.
Philipp Zabel [Wed, 23 Jul 2014 15:28:38 +0000 (12:28 -0300)]
[media] coda: move coda driver into its own directory
The coda driver has grown significantly and will continue to grow.
Move the coda driver into its own directory so it can be split.
Rename coda.h to coda_regs.h as it contains the register defines.
Philipp Zabel [Fri, 18 Jul 2014 10:22:43 +0000 (07:22 -0300)]
[media] coda: split format enumeration for encoder end decoder device
Let the decoder capture side and encoder output side only list
uncompressed formats, and the decoder output and encoder capture
side only list compressed formats.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Philipp Zabel [Fri, 18 Jul 2014 10:22:42 +0000 (07:22 -0300)]
[media] coda: split userspace interface into encoder and decoder device
Userspace has a hard time making sense of format enumerations on V4L2
mem2mem devices if there are restrictions on which input and output
formats can be used together. Alleviate the problem by splitting the
video4linux device into separate encoder and decoder devices which list
only raw formats on one side and only encoded formats on the other side.
With this patch, the instance type (encoder or decoder) is already
determined by the open file operation.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Michael Olbrich [Fri, 18 Jul 2014 10:22:40 +0000 (07:22 -0300)]
[media] coda: delay coda_fill_bitstream()
coda_fill_bitstream() calls v4l2_m2m_buf_done() which is no longer allowed
before streaming was started.
Delay coda_fill_bitstream() until coda_start_streaming() and explicitly set
'start_streaming_called' before calling coda_fill_bitstream()
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Philipp Zabel [Fri, 18 Jul 2014 10:22:36 +0000 (07:22 -0300)]
[media] coda: initialize hardware on pm runtime resume only if firmware available
If no firmware was found and the coda module is unloaded, coda_runtime_resume
will be called without an allocated code buffer. Do not call coda_hw_init in
this case.
[media] omap3isp: resizer: Protect against races when updating crop
When updating the crop rectangle during streaming, the IRQ handler will
reprogram the resizer after the current frame. A race condition
currently exists between the set selection operation and the IRQ
handler: if the set selection operation is called twice in a row and the
IRQ handler runs only during the second call, it could reprogram the
hardware with partially updated values. Use a spinlock to protect
against that.
[media] omap3isp: resizer: Remove slow debugging message from interrupt handler
The resizer_set_input_size() function prints a debugging message with
the input width and height values. As the function is called from
interrupt context, printing that message to the serial console could
slow down the interrupt handler and cause it to miss the start of the
next frame, causing image corruption.
Fix this by reorganizing the resizer debug messages. The driver now
prints the input size, the crop rectangle and the output size in the set
selection handler instead of scattering debug messages in various
places.
Laurent Pinchart [Tue, 10 Jun 2014 13:28:48 +0000 (10:28 -0300)]
[media] omap3isp: ccdc: Restart the CCDC immediately after an underrun in BT.656
As the CCDC doesn't generate interrupts when stopped in BT.656 mode,
restart it immediately when the next buffer after an underrun is queued
instead of relying on the interrupt handler to restart the CCDC.
Laurent Pinchart [Tue, 10 Jun 2014 13:26:28 +0000 (10:26 -0300)]
[media] omap3isp: ccdc: Don't timeout on stream off when the CCDC is stopped
When the CCDC is already stopped due to a buffer underrun, the stop
state machine won't advance in BT.656 mode as no interrupt are generated
by the stopped CCDC in that mode. Handle this case explicitly in the
ccdc_disable() function.
Laurent Pinchart [Tue, 10 Jun 2014 12:41:57 +0000 (09:41 -0300)]
[media] omap3isp: ccdc: Fix freeze when a short frame is received
In BT.656 mode the synchronization signals are generated by the CCDC
from the embedded sync codes. The VD0 and VD1 interrupts are thus only
triggered when the CCDC is enabled, unlike external sync mode where the
line counter runs even when the CCDC is stopped. We can't disable the
CCDC at VD1 time, as no VD0 interrupt would be generated for a short
frame, which would result in the CCDC being stopped and no VD interrupt
generated anymore. The CCDC is stopped from the VD0 interrupt handler
instead for BT.656.
[media] omap3isp: ccdc: Only complete buffer when all fields are captured
Checking that the captured field corresponds to the last required field
depending on the requested field order before completing the buffer
isn't enough. When the first field at stream start corresponds to the
last required field, this would result in returning an interlaced buffer
containing a single field.
Fix this by keeping track of the fields captured in the buffer, and make
sure that both fields are present for alternate field orders.
Laurent Pinchart [Tue, 10 Jun 2014 14:51:34 +0000 (11:51 -0300)]
[media] omap3isp: ccdc: Disable the video port when unused
The video port doesn't support YUV formats. Disable it when the CCDC
sink pad format is set to YUV instead of leaving it enabled and relying
on downstream modules not to process data they receive from the video
port.
Experiments showed that this fixes some of the CCDC failures to stop,
especially in BT.656 mode.
Laurent Pinchart [Tue, 20 May 2014 17:18:53 +0000 (14:18 -0300)]
[media] omap3isp: ccdc: Add support for BT.656 YUV format at the CCDC input
Query the CCDC input media bus type from the subdev connected to the
CCDC sink pad and configure the CCDC accordingly to support BT.656
synchronization.
Laurent Pinchart [Mon, 19 May 2014 19:37:38 +0000 (16:37 -0300)]
[media] omap3isp: ccdc: Add basic support for interlaced video
When the CCDC input is interlaced enable the alternate field order on
the CCDC output video node. The field signal polarity is specified
through platform data.
Laurent Pinchart [Mon, 19 May 2014 13:33:15 +0000 (10:33 -0300)]
[media] omap3isp: Move non-critical code out of the mutex-protected section
The isp_video_pix_to_mbus() and isp_video_mbus_to_pix() calls in
isp_video_set_format() only access static fields of the isp_video
structure. They don't need to be protected by a mutex.
Laurent Pinchart [Mon, 19 May 2014 14:36:23 +0000 (11:36 -0300)]
[media] v4l: subdev: Extend default link validation to cover field order
The field order must match between the source and sink pads, or the sink
pad field order must be NONE. This allows connecting an interlaced
source to a bridge that has no hardware support for interlaced formats.
Sakari Ailus [Wed, 21 May 2014 19:58:11 +0000 (16:58 -0300)]
[media] smiapp: Implement the test pattern control
Add support for the V4L2_CID_TEST_PATTERN control. When the solid colour
mode is selected, additional controls become available for setting the
solid four solid colour components.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Sakari Ailus [Wed, 28 May 2014 12:38:21 +0000 (09:38 -0300)]
[media] v4l: Add test pattern colour component controls
In many cases the test pattern has selectable values for each colour
component. Implement controls for raw bayer components. Additional controls
should be defined for colour components that are not covered by these
controls.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
xc5000_set_params() is a bad name for a function that
handles only digital TV. Rename it to xc5000_set_digital_params(),
and proper name the generic function that works for both
digital and analog.
[media] xc5000: Split config and set code for analog/radio
As we need a function that reapply the last tuned radio,
in order to do resume, split the code that validates and
updates the internal priv struct from the ones that
actually set radio and TV.
[media] au0828: move the code that sets DTV on a separate function
As we'll be adding a code to resume tuner operation, we
need to move the code that actually sets DTV on a separate
function, to be called by the resume code.
[media] dvb-frontend: add core support for tuner suspend/resume
While several tuners have some sort of suspend/resume
implementation, this is currently mangled with an optional
.sleep callback that it is also used to put the device on
low power mode.
Not all drivers implement it, as returning the driver from
low power may require to re-load the firmware, with takes
some time. Also, some drivers may delay it.
So, the more coherent is to add two new optional callbacks
that will let the tuners to directy implement suspend and
resume callbacks if they need.
[media] au0828: don't let the IR polling thread to run at suspend
Trying to make au0828 to suspend can do very bad things, as
the polling Kthread is not handled. We should disable it
during suspend, only re-enabling it at resume.
Still, analog and digital TV won't work, as we don't reinit
the settings at resume, but at least it won't hang.
Shuah Khan [Sat, 9 Aug 2014 00:36:18 +0000 (21:36 -0300)]
[media] au0828: add au0828_rc_*() stubs for VIDEO_AU0828_RC disabled case
Define au0828_rc_*() stubs to avoid compile errors when
VIDEO_AU0828_RC is disabled and avoid the need to enclose
au0828_rc_*() in ifdef CONFIG_VIDEO_AU0828_RC in .c files.
[media] au0828-input: Be sure that IR is enabled at polling
When the DVB code sets the frontend, it disables the IR
INT, probably due to some hardware bug, as there's no code
there at au8522 frontend that writes on register 0xe0.
Fixing it at au8522 code is hard, as it doesn't know if the
IR is enabled or disabled, and just restoring the value of
register 0xe0 could cause other nasty effects. So, better
to add a hack at au0828-input polling interval to enable int,
if disabled.
This sleep was doing some debouncing on the original driver.
This is not needed on Linux, because the RC core and the input
layer already takes care of it.
Linus Torvalds [Sat, 16 Aug 2014 15:32:27 +0000 (09:32 -0600)]
Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
Pull x86 platform driver updates from Matthew Garrett:
"A moderate number of changes, but nothing awfully significant.
A lot of const cleanups, some reworking and additions to the rfkill
quirks in the asus driver, a new driver for generating falling laptop
events on Toshibas and some misc fixes.
Maybe vendors have stopped inventing things"
* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: (41 commits)
platform/x86: Enable build support for toshiba_haps
Documentation: Add file about toshiba_haps module
platform/x86: Toshiba HDD Active Protection Sensor
asus-nb-wmi: Add wapf4 quirk for the U32U
alienware-wmi: make hdmi_mux enabled on case-by-case basis
ideapad-laptop: Constify DMI table and other r/o variables
asus-nb-wmi.c: Rename x401u quirk to wapf4
compal-laptop: correct invalid hwmon name
toshiba_acpi: Add Qosmio X75-A to the alt keymap dmi list
toshiba_acpi: Add extra check to backlight code
Fix log message about future removal of interface
ideapad-laptop: Disable touchpad interface on Yoga models
asus-nb-wmi: Add wapf4 quirk for the X550CC
intel_ips: Make ips_mcp_limits variables static
thinkpad_acpi: Mark volume_alsa_control_{vol,mute} as __initdata
fujitsu-laptop: Mark fujitsu_dmi_table[] DMI table as __initconst
hp-wmi: Add missing __init annotations to initialization code
hp_accel: Constify ACPI and DMI tables
fujitsu-tablet: Mark DMI callbacks as __init code
dell-laptop: Mark dell_quirks[] DMI table as __initconst
...
Linus Torvalds [Sat, 16 Aug 2014 15:25:34 +0000 (09:25 -0600)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
Pull idle update from Len Brown:
"Two Intel-platform-specific updates to intel_idle, and a cosmetic
tweak to the turbostat utility"
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
tools/power turbostat: tweak whitespace in output format
intel_idle: Broadwell support
intel_idle: Disable Baytrail Core and Module C6 auto-demotion