firefly-linux-kernel-4.4.55.git
9 years ago[media] si2157: Add get_if_frequency callback
Matthias Schwarzott [Tue, 15 Jul 2014 07:58:40 +0000 (04:58 -0300)]
[media] si2157: Add get_if_frequency callback

This is needed for PCTV 522e support.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] si2157: Add support for spectral inversion
Matthias Schwarzott [Tue, 15 Jul 2014 19:34:36 +0000 (16:34 -0300)]
[media] si2157: Add support for spectral inversion

This is needed for PCTV 522e support.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] em28xx-dvb: Prepare for si2157 driver getting more parameters
Matthias Schwarzott [Tue, 15 Jul 2014 19:34:35 +0000 (16:34 -0300)]
[media] em28xx-dvb: Prepare for si2157 driver getting more parameters

Modify all users of si2157_config to correctly initialize all not
listed values to 0.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] cxusb: Prepare for si2157 driver getting more parameters
Matthias Schwarzott [Tue, 15 Jul 2014 19:34:34 +0000 (16:34 -0300)]
[media] cxusb: Prepare for si2157 driver getting more parameters

Modify all users of si2157_config to correctly initialize all not
listed values to 0.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] si2157: Use name si2157_ops instead of si2157_tuner_ops
Olli Salonen [Fri, 18 Jul 2014 05:41:12 +0000 (02:41 -0300)]
[media] si2157: Use name si2157_ops instead of si2157_tuner_ops

The struct prototype is defined at the beginning of the code as
"si2157_ops" but the real struct is called "si2157_tuner_ops".

This is causing the name to be empty on this info msg: si2157 16-0060:
si2157: found a '' in cold state

[crope@iki.fi: commit msg from Luis email reply]
Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Cc: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] si2168: Support Si2168-A20 firmware downloading
Luis Alves [Thu, 17 Jul 2014 22:43:37 +0000 (19:43 -0300)]
[media] si2168: Support Si2168-A20 firmware downloading

This adds support for the Si2168-A20 firmware download.

Extracting the firmware:

wget http://www.tbsdtv.com/download/document/tbs6281/tbs6281-t2-t-driver_v1.0.0.6.zip
unzip tbs6281-t2-t-driver_v1.0.0.6.zip
dd if=tbs-6281_x64/tbs6281_64.sys of=dvb-demod-si2168-a20-01.fw count=28656 bs=1 skip=1625088

md5sum:
32e06713b33915f674bfb2c209beaea5 /lib/firmware/dvb-demod-si2168-a20-01.fw

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] si2168: Remove testing for demod presence on probe
Luis Alves [Thu, 17 Jul 2014 20:56:44 +0000 (17:56 -0300)]
[media] si2168: Remove testing for demod presence on probe

Testing demod presence on probe fails if the demod was sleep mode.

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] si2168: Fix i2c_add_mux_adapter return value
Luis Alves [Thu, 17 Jul 2014 19:38:08 +0000 (16:38 -0300)]
[media] si2168: Fix i2c_add_mux_adapter return value

In case of failure the return value was always 0. Return proper
error code (ENODEV) instead.

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] si2168: improve scanning performance
Olli Salonen [Thu, 17 Jul 2014 18:43:27 +0000 (15:43 -0300)]
[media] si2168: improve scanning performance

Improve scanning performance by setting property 0301 with a value
from Windows driver.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] si2168: Set symbol rate for DVB-C
Luis Alves [Thu, 17 Jul 2014 17:31:28 +0000 (14:31 -0300)]
[media] si2168: Set symbol rate for DVB-C

This patch adds symbol rate setting to the driver.

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] MAINTAINERS: add airspy driver
Antti Palosaari [Fri, 18 Jul 2014 00:57:14 +0000 (21:57 -0300)]
[media] MAINTAINERS: add airspy driver

Video4Linux2 driver for AirSpy SDR device.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] airspy: print notice to point SDR API is not 100% stable yet
Antti Palosaari [Fri, 18 Jul 2014 00:47:48 +0000 (21:47 -0300)]
[media] airspy: print notice to point SDR API is not 100% stable yet

Print notice on driver load: "SDR API is still slightly
experimental and functionality changes may follow". It is just
remind possible used SDR API is very new and surprises may occur.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] airspy: move out of staging into drivers/media/usb
Antti Palosaari [Fri, 18 Jul 2014 00:42:24 +0000 (21:42 -0300)]
[media] airspy: move out of staging into drivers/media/usb

Move it out of staging into media like all the other SDR drivers
too. There is no good reasons to keep these SDR drivers in staging.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] airspy: remove v4l2-compliance workaround
Antti Palosaari [Fri, 18 Jul 2014 00:15:11 +0000 (21:15 -0300)]
[media] airspy: remove v4l2-compliance workaround

v4l2-compliance is now happy with frequency ranges where both lower
and upper limit is same.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] MAINTAINERS: update RTL2832_SDR location
Antti Palosaari [Tue, 15 Jul 2014 00:19:29 +0000 (21:19 -0300)]
[media] MAINTAINERS: update RTL2832_SDR location

It is moved out of staging to media.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] rtl2832_sdr: print notice to point SDR API is not 100% stable yet
Antti Palosaari [Tue, 15 Jul 2014 00:16:50 +0000 (21:16 -0300)]
[media] rtl2832_sdr: print notice to point SDR API is not 100% stable yet

SDR API is very new and surprises may occur. Due to that print
notice to remind possible users.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] rtl2832_sdr: put complex U16 format behind module parameter
Antti Palosaari [Tue, 15 Jul 2014 00:11:12 +0000 (21:11 -0300)]
[media] rtl2832_sdr: put complex U16 format behind module parameter

Move emulated format behind module parameter as those are not
supported. Format conversions will be on library eventually.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agortl2832_sdr: move from staging to media
Antti Palosaari [Mon, 14 Jul 2014 23:08:38 +0000 (02:08 +0300)]
rtl2832_sdr: move from staging to media

Move rtl2832_sdr driver module from staging to media.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] Kconfig: sub-driver auto-select SPI bus
Antti Palosaari [Sun, 13 Jul 2014 00:48:39 +0000 (21:48 -0300)]
[media] Kconfig: sub-driver auto-select SPI bus

Mirics MSi001 and MSi2500 drivers uses SPI bus. Due to that we need
auto-select it too.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] Kconfig: add SDR support
Antti Palosaari [Sun, 13 Jul 2014 00:43:12 +0000 (21:43 -0300)]
[media] Kconfig: add SDR support

Add software defined radio device support for media Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] MAINTAINERS: update MSI001 driver location
Antti Palosaari [Sat, 12 Jul 2014 11:58:32 +0000 (08:58 -0300)]
[media] MAINTAINERS: update MSI001 driver location

The driver moved out of staging. Update MAINTAINERS
accordingly.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agomsi001: move out of staging
Antti Palosaari [Sat, 12 Jul 2014 11:53:22 +0000 (14:53 +0300)]
msi001: move out of staging

Move MSi001 driver from staging to drivers/media/tuners/.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agostaging/airspy: fix a compilation warning
Mauro Carvalho Chehab [Mon, 21 Jul 2014 23:29:54 +0000 (20:29 -0300)]
staging/airspy: fix a compilation warning

drivers/staging/media/airspy/airspy.c: In function 'airspy_stop_streaming':
drivers/staging/media/airspy/airspy.c:569:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook: V4L: add V4L2_SDR_FMT_CS14LE - 'CS14'
Antti Palosaari [Fri, 11 Jul 2014 20:04:42 +0000 (17:04 -0300)]
[media] DocBook: V4L: add V4L2_SDR_FMT_CS14LE - 'CS14'

V4L2_SDR_FMT_CS14LE is complex signed 14-bit sample format, used
for software defined radio devices.

[m.chehab@samsung.com: remove V4L2_FL_USE_FH_PRIO setting to avoid
 compilation breakage, as this flag doesn't exist anymore]

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: uapi: add SDR format CS14
Antti Palosaari [Fri, 11 Jul 2014 19:35:47 +0000 (16:35 -0300)]
[media] v4l: uapi: add SDR format CS14

V4L2_SDR_FMT_CS14LE - Complex signed 14-bit IQ sample

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook: V4L: add V4L2_SDR_FMT_CS8 - 'CS08'
Antti Palosaari [Fri, 11 Jul 2014 18:35:05 +0000 (15:35 -0300)]
[media] DocBook: V4L: add V4L2_SDR_FMT_CS8 - 'CS08'

V4L2_SDR_FMT_CS8 is complex signed 8-bit sample format, used for
software defined radio devices.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: uapi: add SDR format CS8
Antti Palosaari [Fri, 11 Jul 2014 16:25:14 +0000 (13:25 -0300)]
[media] v4l: uapi: add SDR format CS8

V4L2_SDR_FMT_CS8 - Complex signed 8-bit IQ sample

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] airspy: AirSpy SDR driver
Antti Palosaari [Sat, 28 Jun 2014 00:30:55 +0000 (21:30 -0300)]
[media] airspy: AirSpy SDR driver

AirSpy SDR driver.

Thanks to Youssef Touil and Benjamin Vernoux for support, help and
hardware!
http://airspy.com/

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook: V4L: add V4L2_SDR_FMT_RU12LE - 'RU12'
Antti Palosaari [Fri, 11 Jul 2014 16:14:27 +0000 (13:14 -0300)]
[media] DocBook: V4L: add V4L2_SDR_FMT_RU12LE - 'RU12'

Document V4L2_SDR_FMT_RU12LE format. It is real unsigned 12-bit
little endian sample inside 16-bit space. Used by software defined
radio devices.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: uapi: add SDR format RU12LE
Antti Palosaari [Fri, 27 Jun 2014 20:42:18 +0000 (17:42 -0300)]
[media] v4l: uapi: add SDR format RU12LE

V4L2_SDR_FMT_RU12LE - Real unsigned 12-bit little endian sample
inside 16-bit (2 byte). V4L2 FourCC: RU12.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: ctrls: Unlocked variants of v4l2_ctrl_s_ctrl{,_int64}()
Sakari Ailus [Thu, 12 Jun 2014 16:09:42 +0000 (13:09 -0300)]
[media] v4l: ctrls: Unlocked variants of v4l2_ctrl_s_ctrl{,_int64}()

Implement unlocked variants of v4l2_ctrl_s_ctrl() and
v4l2_ctrl_s_ctrl_int64(). As drivers need to set controls as they access
driver internal state elsewhere than in the control framework unlocked
variants of these functions become handy.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: ctrls: Provide an unlocked variant of v4l2_ctrl_modify_range()
Sakari Ailus [Thu, 12 Jun 2014 16:09:40 +0000 (13:09 -0300)]
[media] v4l: ctrls: Provide an unlocked variant of v4l2_ctrl_modify_range()

Drivers may use the v4l2_ctrl_modify_range() internally as part of other
operations that need to be both serialised using a driver's lock which can
also be used to serialise access to the control handler. Provide an unlocked
version of the function, __v4l2_ctrl_modify_range() which then may be used
by drivers for the purpose.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: ctrls: Move control lock/unlock above the control access functions
Sakari Ailus [Thu, 12 Jun 2014 16:09:39 +0000 (13:09 -0300)]
[media] v4l: ctrls: Move control lock/unlock above the control access functions

The v4l2_ctrl_{,un}lock will be needed elsewhere. Define them before the
functions that perform operations on controls.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] saa7146: fix compile warning
Hans Verkuil [Thu, 17 Jul 2014 18:27:39 +0000 (15:27 -0300)]
[media] saa7146: fix compile warning

Fall-out from the recent struct v4l2_framebuffer change.

drivers/media/common/saa7146/saa7146_fops.c: In function ‘saa7146_vv_init’:
drivers/media/common/saa7146/saa7146_fops.c:536:6: warning: assignment from incompatible pointer type [enabled by default]
  fmt = &vv->ov_fb.fmt;
        ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] staging/media/davinci_vpfe/dm365_ipipeif.c: fix negativity check
Andrey Utkin [Thu, 17 Jul 2014 16:27:16 +0000 (13:27 -0300)]
[media] staging/media/davinci_vpfe/dm365_ipipeif.c: fix negativity check

[linux-3.16-rc5/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:210]:
(style) Checking if unsigned variable 'val' is less than zero.

    val = get_oneshot_mode(ipipeif->input);
    if (val < 0) {
        pr_err("ipipeif: links setup required");
        return -EINVAL;
    }

but

static int get_oneshot_mode(enum ipipeif_input_entity input)

Introduced temporary variable for negativity check.
"val" is afterwards used in a lot of bitwise operations, so changing its type
to signed is not safe, according to CERT C Secure Coding Standards chapter
INT13-C: "Use bitwise operators only on unsigned operands"
https://www.securecoding.cert.org/confluence/display/seccode/INT13-C.+Use+bitwise+operators+only+on+unsigned+operands

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80521

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] adv7180: Remove duplicate unregister call
Ian Molton [Sat, 5 Jul 2014 22:26:20 +0000 (19:26 -0300)]
[media] adv7180: Remove duplicate unregister call

This driver moved over to v4l2_async_unregister_subdev()
but still retained a call to v4l2_unregister_subdev(). Remove.

Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] s5p-mfc: limit the size of the CPB
panpan liu [Wed, 16 Jul 2014 01:51:33 +0000 (22:51 -0300)]
[media] s5p-mfc: limit the size of the CPB

The CPB size is limited by the hardware. Add this limit to the s_fmt.

Signed-off-by: panpan liu <panpan1.liu@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] coda: simplify IRAM setup
Philipp Zabel [Fri, 11 Jul 2014 09:36:16 +0000 (06:36 -0300)]
[media] coda: simplify IRAM setup

OVL and BTP IRAM buffers are never used, setup the bits for
for DBK/BIT/IP usage depending on CODA version in one place.
Also, use a simple allocator function and group IRAM addresses
and size in a coda_aux_buf structure.
This is done in preparation for CODA960 support.

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>
9 years ago[media] coda: fix internal framebuffer allocation size
Philipp Zabel [Fri, 11 Jul 2014 09:36:15 +0000 (06:36 -0300)]
[media] coda: fix internal framebuffer allocation size

This error was introduced by 5677e3b04d3b3961200aa2bb9cc715e709eafeb9
"[media] coda: update CODA7541 to firmware 1.4.50".

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>
9 years ago[media] coda: fix h.264 quantization parameter range
Philipp Zabel [Fri, 11 Jul 2014 09:36:14 +0000 (06:36 -0300)]
[media] coda: fix h.264 quantization parameter range

If bitrate is not set, the encoder is running in VBR mode, with the
I- and P-frame quantization parameters configured from userspace.
For the quantization parameters, 0 is a valid value.

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>
9 years ago[media] coda: fix readback of CODA_RET_DEC_SEQ_FRAME_NEED
Philipp Zabel [Fri, 11 Jul 2014 09:36:13 +0000 (06:36 -0300)]
[media] coda: fix readback of CODA_RET_DEC_SEQ_FRAME_NEED

Previously we'd add one to this value, allocating one additional, superfluous
internal buffer.

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>
9 years ago[media] coda: fix decoder I/P/B frame detection
Philipp Zabel [Fri, 11 Jul 2014 09:36:12 +0000 (06:36 -0300)]
[media] coda: fix decoder I/P/B frame detection

Currently the rotator unit is used to copy decoded frames out into buffers
provided by videobuf2. Since the CODA reports the I/P/B frame type of the
last decoded frame, and this frame will be copied out in a later device_run,
depending on display order, we have to store the frame type until such time.
This patch also adds the B-frame type.

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>
9 years ago[media] s5p-mfc: Fix selective sclk_mfc init
Jacek Anaszewski [Thu, 10 Jul 2014 09:00:39 +0000 (06:00 -0300)]
[media] s5p-mfc: Fix selective sclk_mfc init

fc906b6d "Remove special clock usage in driver" removed
initialization of MFC special clock, arguing that there's
no need to do it explicitly, since it's one of MFC gate clock's
dependencies and gets enabled along with it. However, there's
no promise of keeping this hierarchy across Exynos SoC
releases, therefore this approach fails to provide a stable,
portable solution.

Out of all MFC versions, only v6 doesn't use special clock at all.
For other versions log a message only in case clk_get fails,
as not all the devices with the same MFC version require
initializing the clock explicitly.

Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] s5p: fix error code path when failing to allocate DMA memory
Maurizio Lombardi [Fri, 27 Jun 2014 09:28:31 +0000 (06:28 -0300)]
[media] s5p: fix error code path when failing to allocate DMA memory

In the s5p_mfc_alloc_firmware() function there are some mistakes
where the code checks whether the DMA memory is properly allocated or
not.

First of all dma_alloc_coherent() returns NULL in case of error.
The code also checked two times fw_virt_addr, ignoring
the bank2_virt pointer.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] zoran: remove duplicate ZR050_MO_COMP define
Dan Carpenter [Mon, 9 Jun 2014 15:21:35 +0000 (12:21 -0300)]
[media] zoran: remove duplicate ZR050_MO_COMP define

The ZR050_MO_COMP define is cut and pasted twice so we can delete the
second instance.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] saa7164-dvb: Remove unnecessary null test
Himangi Saraogi [Tue, 15 Jul 2014 21:29:53 +0000 (18:29 -0300)]
[media] saa7164-dvb: Remove unnecessary null test

This patch removes the null test on dvb. dvb is initialized at the
beginning of the function to &port->dvb. Since port is dereferenced
prior to the null test, port must be a valid pointer, and
&port->dvb cannot be null.

The following Coccinelle script is used for detecting the change:

@r@
expression e,f;
identifier g,y;
statement S1,S2;
@@

*e = &f->g
<+...
 f->y
 ...+>
*if (e != NULL || ...)
 S1 else S2

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] radio-bcm2048.c: Fix some checkpatch.pl errors
Luke Hart [Sat, 12 Jul 2014 18:48:22 +0000 (15:48 -0300)]
[media] radio-bcm2048.c: Fix some checkpatch.pl errors

Fix the following warnings reported in radio-bcm2048.c:

WARNING: else is not generally useful after a break or return
374: FILE: radio-bcm2048.c:374:
+ return 0;
+ } else {

WARNING: else is not generally useful after a break or return
728: FILE: radio-bcm2048.c:728:
+ return BCM2048_DE_EMPHASIS_75us;
+ else

WARNING: unchecked sscanf return value
1974: FILE: radio-bcm2048.c:1974:
+ sscanf(buf, mask, &value); \

WARNING: Missing a blank line after declarations
2245: FILE: radio-bcm2048.c:2245:
+ unsigned char tmpbuf[3];
+ tmpbuf[i] = bdev->rds_info.radio_text[bdev->rd_index+i+2];

WARNING: Possible unnecessary 'out of memory' message
2601: FILE: radio-bcm2048.c:2601:
+ if (!bdev) {
+ dev_dbg(&client->dev, "Failed to alloc video device.\n");

The following error was left since it seems to be a false positive:

ERROR: Macros with complex values should be enclosed in parenthesis
+#define DEFINE_SYSFS_PROPERTY(prop, signal, size, mask, check) \
+property_write(prop, signal size, mask, check) \
+property_read(prop, size, mask)

Signed-off-by: Luke Hart <luke.hart@birchleys.eu>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] media: pvrusb2: make logging code sane
Andrey Utkin [Thu, 10 Jul 2014 12:32:25 +0000 (09:32 -0300)]
[media] media: pvrusb2: make logging code sane

The issue was discovered by static analysis. It turns out that code is
somewhat insane, being
if (x) {...} else { if (x) {...} }

Edited it to do the only reasonable thing, which is to log the
information about the failed call. The most descriptive logging commands
set is taken from original code.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79801

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] staging: media: bcm2048: radio-bcm2048.c - removed IRQF_DISABLED macro
Anil Belur [Wed, 9 Jul 2014 06:06:37 +0000 (03:06 -0300)]
[media] staging: media: bcm2048: radio-bcm2048.c - removed IRQF_DISABLED macro

- this patch removes IRQF_DISABLED macro, as this is
  deprecated/noop.

Signed-off-by: Anil Belur <askb23@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] solo6x10: update GOP size, QP immediately
Andrey Utkin [Tue, 8 Jul 2014 15:23:33 +0000 (12:23 -0300)]
[media] solo6x10: update GOP size, QP immediately

Previously, it was needed to reopen device to update GOP size and
quantization parameter. Now we update device registers with new values
immediately.

Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] solo6x10: expose encoder quantization setting as V4L2 control
Andrey Utkin [Tue, 8 Jul 2014 15:23:32 +0000 (12:23 -0300)]
[media] solo6x10: expose encoder quantization setting as V4L2 control

solo6*10 boards have configurable quantization parameter which takes
values from 0 to 31, inclusively.

This change enables setting it with ioctl VIDIOC_S_CTRL with id
V4L2_CID_MPEG_VIDEO_H264_MIN_QP.

Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook media: fix number of bits filled with zeros for SRGBB12
Andreas Weber [Mon, 7 Jul 2014 14:00:05 +0000 (11:00 -0300)]
[media] DocBook media: fix number of bits filled with zeros for SRGBB12

The total number of bits is 16 (12+4). Fix it.

Signed-off-by: Andreas Weber <andy.weber.aw@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] staging/solo6x10: SOLO6X10 should select BITREVERSE
Geert Uytterhoeven [Sun, 6 Jul 2014 08:58:41 +0000 (05:58 -0300)]
[media] staging/solo6x10: SOLO6X10 should select BITREVERSE

If CONFIG_SOLO6X10=y, but CONFIG_BITREVERSE=m:

    drivers/built-in.o: In function `solo_osd_print':
    (.text+0x1c7a1f): undefined reference to `byte_rev_table'
    make: *** [vmlinux] Error 1

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] hdpvr: fix reported HDTV colorspace
Hans Verkuil [Sat, 5 Jul 2014 08:51:55 +0000 (05:51 -0300)]
[media] hdpvr: fix reported HDTV colorspace

The colorspace for HDTV is REC709, not SMPTE240M.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] cx23885: add support for Hauppauge ImpactVCB-e
Hans Verkuil [Fri, 27 Jun 2014 14:15:42 +0000 (11:15 -0300)]
[media] cx23885: add support for Hauppauge ImpactVCB-e

Add support for Hauppauge model 71100: WinTV-ImpactVCB-e
(PCIe, Retail, half height)

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-ioctl: clips, clipcount and bitmap should not be zeroed
Hans Verkuil [Thu, 17 Jul 2014 21:45:45 +0000 (18:45 -0300)]
[media] v4l2-ioctl: clips, clipcount and bitmap should not be zeroed

Otherwise you cannot get the current clip and bitmap information from
an overlay.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-ioctl: call g_selection before calling cropcap
Hans Verkuil [Fri, 13 Jun 2014 07:31:06 +0000 (04:31 -0300)]
[media] v4l2-ioctl: call g_selection before calling cropcap

If the vidioc_cropcap op is implemented by the driver then the v4l2
core will call that directly.

If g_selection is available, then the core cropcap implementation
uses g_selection to fill in the bounds and defrect and it sets the
pixelaspect to 1x1.

But if both are available, then I would like to use g_selection to
fill in defrect and bounds before calling cropcap. That way the
driver's cropcap implementation doesn't have to set defrect or
bounds.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-ioctl: clear reserved field of G/S_SELECTION
Hans Verkuil [Mon, 24 Mar 2014 12:51:34 +0000 (09:51 -0300)]
[media] v4l2-ioctl: clear reserved field of G/S_SELECTION

Be sure that the reserved fields are cleared.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-ioctl: remove pointless INFO_FL_CLEAR
Hans Verkuil [Fri, 14 Mar 2014 14:52:38 +0000 (11:52 -0300)]
[media] v4l2-ioctl: remove pointless INFO_FL_CLEAR

The edid field is the last field of the struct, so there is nothing to clear.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-dev: don't debug poll unless the debug level > 2
Hans Verkuil [Mon, 3 Mar 2014 09:47:38 +0000 (06:47 -0300)]
[media] v4l2-dev: don't debug poll unless the debug level > 2

Some applications poll a lot, so prevent the poll message from flooding
the log.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] videodev2.h: add V4L2_FIELD_HAS_T_OR_B macro
Hans Verkuil [Wed, 26 Feb 2014 21:22:05 +0000 (18:22 -0300)]
[media] videodev2.h: add V4L2_FIELD_HAS_T_OR_B macro

Add a macro to test if the field consists of a single top
or bottom field. Anyone who needs to work with fields as opposed to
frame will need this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-dev: streamon/off is only a valid ioctl for video, vbi and sdr
Hans Verkuil [Thu, 10 Jul 2014 22:51:26 +0000 (19:51 -0300)]
[media] v4l2-dev: streamon/off is only a valid ioctl for video, vbi and sdr

The VIDIOC_STREAMON/OFF ioctls are not valid for radio devices, just
like the other streaming I/O ioctls. Add the streamon/off ioctls
to the other streaming I/O ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-ioctl.c: fix enum_freq_bands handling
Hans Verkuil [Fri, 11 Jul 2014 10:01:39 +0000 (07:01 -0300)]
[media] v4l2-ioctl.c: fix enum_freq_bands handling

If the driver supports enum_freq_bands, but only for certain device
nodes, then it may return -ENOTTY. But in that case the code should
fall into the fall-back case where the current tuner/modulator range
is returned.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-ioctl.c: check vfl_type in ENUM_FMT
Hans Verkuil [Sat, 12 Jul 2014 10:54:26 +0000 (07:54 -0300)]
[media] v4l2-ioctl.c: check vfl_type in ENUM_FMT

The other format ioctls (g/s/try_fmt) all check if the passed buffer type
makes sense for the device node's vfl_type. E.g. it makes no sense for a
VBI buffer type to be passed through a video node instead of a vbi node.

But this check was missing in ENUM_FMT which can cause a problem if you
have both video and sdr device nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook media: fix incorrect header reference
Hans Verkuil [Tue, 17 Jun 2014 13:43:46 +0000 (10:43 -0300)]
[media] DocBook media: fix incorrect header reference

The text referred to videodev.h when videodev2.h was meant. Fixed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook media: add missing dqevent src_change field
Hans Verkuil [Fri, 13 Jun 2014 12:28:59 +0000 (09:28 -0300)]
[media] DocBook media: add missing dqevent src_change field

The v4l2_event union has a new src_change field, but that was never
added to the VIDIOC_DQEVENT documentation of that union. Fixed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook media: fix wrong spacing
Hans Verkuil [Fri, 13 Jun 2014 07:47:37 +0000 (04:47 -0300)]
[media] DocBook media: fix wrong spacing

There shouldn't be any spaces after <constant> or before </constant>.
This leads to ugly results like: 'image size set by VIDIOC_S_FMT .'

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] MAINTAINERS: Add the OMAP4 ISS driver
Laurent Pinchart [Fri, 6 Jun 2014 15:08:59 +0000 (12:08 -0300)]
[media] MAINTAINERS: Add the OMAP4 ISS driver

Update the OMAP Image Signal Processor entry to cover both the OMAP3 ISP
and OMAP4 ISS.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: omap4iss: Signal fatal errors to the vb2 queue
Laurent Pinchart [Tue, 3 Jun 2014 22:25:06 +0000 (19:25 -0300)]
[media] v4l: omap4iss: Signal fatal errors to the vb2 queue

When a fatal error occurs in the pipeline signal it to the vb2 queue
with a call to vb2_queue_error(). The queue will then take care to
return -EIO when preparing buffers, remove the driver-specific code that
now duplicates that check.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: omap4iss: Use the devm_* managed allocators
Laurent Pinchart [Fri, 6 Jun 2014 14:59:04 +0000 (11:59 -0300)]
[media] v4l: omap4iss: Use the devm_* managed allocators

This simplifies remove and error code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: omap4iss: Add module debug parameter
Laurent Pinchart [Tue, 3 Jun 2014 20:49:41 +0000 (17:49 -0300)]
[media] v4l: omap4iss: Add module debug parameter

The parameter is used to initialize the video node debug field and
activate the V4L debug infrastructure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: omap4iss: Don't reinitialize the video qlock at every streamon
Laurent Pinchart [Tue, 3 Jun 2014 22:23:16 +0000 (19:23 -0300)]
[media] v4l: omap4iss: Don't reinitialize the video qlock at every streamon

Initialize the spin lock once only when initializing the video object.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: omap4iss: Copy paste error in iss_get_clocks
Vitaly Osipov [Thu, 5 Jun 2014 07:07:48 +0000 (04:07 -0300)]
[media] v4l: omap4iss: Copy paste error in iss_get_clocks

It makes more sense to return PTR_ERR(iss->iss_ctrlclk) here. The
current code looks like an oversight in pasting the block just above
this one.

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: omap4iss: tighten omap4iss dependencies
Arnd Bergmann [Wed, 11 Jun 2014 14:49:31 +0000 (11:49 -0300)]
[media] v4l: omap4iss: tighten omap4iss dependencies

The OMAP4 camera support depends on I2C and VIDEO_V4L2, both
of which can be loadable modules. This causes build failures
if we want the camera driver to be built-in.

This can be solved by turning the option into "tristate",
which unfortunately causes another problem, because the
driver incorrectly calls a platform-internal interface
for omap4_ctrl_pad_readl/omap4_ctrl_pad_writel.

Instead, this patch just forbids the invalid configurations
and ensures that the driver can only be built if all its
dependencies are built-in.

Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vb2: Add fatal error condition flag
Laurent Pinchart [Tue, 3 Jun 2014 21:53:25 +0000 (18:53 -0300)]
[media] v4l: vb2: Add fatal error condition flag

When a fatal error occurs that render the device unusable, the only
options for a driver to signal the error condition to userspace is to
set the V4L2_BUF_FLAG_ERROR flag when dequeuing buffers and to return an
error from the buffer prepare handler when queuing buffers.

The buffer error flag indicates a transient error and can't be used by
applications to detect fatal errors. Returning an error from vb2_qbuf()
is thus the only real indication that a fatal error occurred. However,
this is difficult to handle for multithreaded applications that requeue
buffers from a thread other than the control thread. In particular the
poll() call in the control thread will not notify userspace of the
error.

This patch adds an explicit mechanism to report fatal errors to
userspace. Drivers can call the vb2_queue_error() function to signal a
fatal error. From this moment on, buffer preparation will return -EIO to
userspace, and vb2_poll() will set the POLLERR flag and return
immediately. The error flag is cleared when cancelling the queue, either
at stream off time (through vb2_streamoff) or when releasing the queue
with vb2_queue_release().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vb2: Don't return POLLERR during transient buffer underruns
Laurent Pinchart [Tue, 3 Jun 2014 20:41:06 +0000 (17:41 -0300)]
[media] v4l: vb2: Don't return POLLERR during transient buffer underruns

The V4L2 specification states that

"When the application did not call VIDIOC_QBUF or VIDIOC_STREAMON yet
the poll() function succeeds, but sets the POLLERR flag in the revents
field."

The vb2_poll() function sets POLLERR when the queued buffers list is
empty, regardless of whether this is caused by the stream not being
active yet, or by a transient buffer underrun.

Bring the implementation in line with the specification by returning
POLLERR if no buffer has been queued only when the queue is not
streaming. Buffer underruns during streaming are not treated specially
anymore and just result in poll() blocking until the next event.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: uds: Fix scaling of alpha layer
Laurent Pinchart [Sat, 31 May 2014 00:45:48 +0000 (21:45 -0300)]
[media] v4l: vsp1: uds: Fix scaling of alpha layer

Pixel color components can be scaled using either bilinear interpolation
or a multitap filter. The multitap filter provides better results, but
can't be selected when the alpha layer need to be scaled down by more
than 1/2.

Disable alpha scaling when the input has a fixed alpha value, and
program the UDS to output a fixed alpha value in that case. This ensures
the multitap filter will be used whenever possible.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: bru: Make the background color configurable
Laurent Pinchart [Wed, 28 May 2014 01:46:30 +0000 (22:46 -0300)]
[media] v4l: vsp1: bru: Make the background color configurable

Expose the background color to userspace through the V4L2_CID_BG_COLOR
control.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: bru: Support non-premultiplied colors at the BRU output
Laurent Pinchart [Tue, 27 May 2014 23:35:36 +0000 (20:35 -0300)]
[media] v4l: vsp1: bru: Support non-premultiplied colors at the BRU output

The BRU outputs premultiplied colors, enable color data normalization
when the format configured at the output of the pipeline isn't
premultiplied.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: bru: Support premultiplied alpha at the BRU inputs
Laurent Pinchart [Tue, 27 May 2014 23:35:36 +0000 (20:35 -0300)]
[media] v4l: vsp1: bru: Support premultiplied alpha at the BRU inputs

Adjust the BRU blending formula to avoid the multiplication by alpha
when the corresponding input format is premultiplied. As this requires
access to the RPFs connected to the BRU inputs from the BRU module,
store pointers to the RPFs in the BRU structure when validating the
pipeline.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Add V4L2_CID_ALPHA_COMPONENT control support
Laurent Pinchart [Wed, 21 May 2014 22:00:05 +0000 (19:00 -0300)]
[media] v4l: vsp1: Add V4L2_CID_ALPHA_COMPONENT control support

The control is used to configure the fixed alpha channel value, when
reading from memory in the RPF or writing to memory in the WPF.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Add alpha channel support to the memory ports
Laurent Pinchart [Mon, 26 May 2014 23:12:53 +0000 (20:12 -0300)]
[media] v4l: vsp1: Add alpha channel support to the memory ports

Support ARGB formats on the RPF side by reading the alpha component from
memory and on the WPF side by writing it to memory.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Switch to XRGB formats
Laurent Pinchart [Mon, 26 May 2014 22:57:21 +0000 (19:57 -0300)]
[media] v4l: vsp1: Switch to XRGB formats

The driver ignores the alpha component on output video nodes and
hardcodes the alpha component to 0 on capture video nodes. Make this
explicit by exposing XRGB formats.

Compatibility with existing userspace applications is handled by
selecting the XRGB format corresponding to the requested old RGB format.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: wpf: Clear RPF to WPF association at stream off time
Laurent Pinchart [Wed, 28 May 2014 16:10:33 +0000 (13:10 -0300)]
[media] v4l: vsp1: wpf: Clear RPF to WPF association at stream off time

The VSP1 stores the video pipelines' input (RPF) to output (WPF)
mappings in a WPF register. An RPF must never be associated with
multiple WPFs, even if all of those WPFs but one are unused, otherwise
the hardware won't function properly.

The driver doesn't ensure this correctly as it never clears the
mappings. An RPF used with one WPF and later with a different WPF will
lead to malfunction, as it will be associated with two WPFs. Clear the
mappings at stream off time to fix this.

Reported-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: wpf: Simplify cast to pipeline structure
Laurent Pinchart [Tue, 27 May 2014 23:35:36 +0000 (20:35 -0300)]
[media] v4l: vsp1: wpf: Simplify cast to pipeline structure

Use the subdev pointer directly to_vsp1_pipeline() macro instead of
casting from the subdev to the wpf object and back to the subdev.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: sru: Make the intensity controllable during streaming
Laurent Pinchart [Sat, 31 May 2014 23:30:11 +0000 (20:30 -0300)]
[media] v4l: vsp1: sru: Make the intensity controllable during streaming

The control value is currently stored in the SRU structure by the
control set handler and written to the hardware at stream on time,
making control set during streaming ineffective. Fix it by writing to
the registers from within the control set handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: sru: Fix the intensity control default value
Laurent Pinchart [Wed, 21 May 2014 22:00:05 +0000 (19:00 -0300)]
[media] v4l: vsp1: sru: Fix the intensity control default value

The default value isn't set and defaults to 0, which isn't in the 1-6
min-max range. Fix it by setting the default value to 1.

This shoud have been caught when checking the control handler error
field at initialization time, but the check was missing. Add it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Setup control handler automatically at stream on time
Laurent Pinchart [Sat, 31 May 2014 13:40:51 +0000 (10:40 -0300)]
[media] v4l: vsp1: Setup control handler automatically at stream on time

When setting a control directly on a subdev node the VSP1 driver doesn't
guarantee that the device is powered on. This leads to crashes when the
control handlers writes to hardware registers. One easy way to fix this
is to ensure that the device gets powered on when a subdev node is
opened. However, this consumes power unnecessarily, as there's no need
to power the device on when setting formats on the pipeline.
Furthermore, control handler setup at entity init time suffers from the
same problem as the device isn't powered on easier.

Fix this by extend the entity base object to setup the control handler
automatically when starting the stream. Entities must then skip writing
to registers in the set control handler when not streaming, which can be
tested with the new vsp1_entity_is_streaming() helper function.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Propagate vsp1_device_get errors to the callers
Laurent Pinchart [Sat, 31 May 2014 11:50:32 +0000 (08:50 -0300)]
[media] v4l: vsp1: Propagate vsp1_device_get errors to the callers

Modify the vsp1_device_get() function to return an error code instead of
a pointer to the VSP1 device, and use the return value in the callers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Cleanup video nodes at removal time
Laurent Pinchart [Wed, 28 May 2014 15:49:13 +0000 (12:49 -0300)]
[media] v4l: vsp1: Cleanup video nodes at removal time

Video nodes created and initialized in the RPF and WPF init code paths
are never unregistered, and the related resources (videobuf alloc
context and media entity) never released.

Fix this by storing a pointer to the vsp1_video object in vsp1_entity
and calling vsp1_video_cleanup() from vsp1_entity_destroy(). This also
allows simplifying the init error code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Fix typos
Laurent Pinchart [Tue, 27 May 2014 15:59:39 +0000 (12:59 -0300)]
[media] v4l: vsp1: Fix typos

Several macros were mistakenly prefixed with VPS1 instead of VSP1. Fix
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Fix pipeline stop timeout
Laurent Pinchart [Mon, 23 Jun 2014 20:15:02 +0000 (17:15 -0300)]
[media] v4l: vsp1: Fix pipeline stop timeout

If the pipeline was already stopped when stopping the stream, no
frame end interrupt will be generated and the driver will time out
waiting for the pipeline to stop.

Fix this by setting the pipeline state to STOPPED when the pipeline is
idle waiting for frames to process, and to STOPPING at stream stop time
only when the pipeline is currently RUNNING.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Release buffers at stream stop
Laurent Pinchart [Mon, 23 Jun 2014 19:57:22 +0000 (16:57 -0300)]
[media] v4l: vsp1: Release buffers at stream stop

videobuf2 expects no buffer to be owned by the driver when the
stop_stream queue operation returns. As the vsp1 driver fails to do so,
a warning is generated at stream top time.

Fix this by releasing all buffers queued on the IRQ queue in the
stop_stream operation handler and marking them as erroneous.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vsp1: Fix routing cleanup when stopping the stream
Laurent Pinchart [Mon, 23 Jun 2014 21:40:49 +0000 (18:40 -0300)]
[media] v4l: vsp1: Fix routing cleanup when stopping the stream

Commit d9b45ed3d8b75e8cf38c8cd1563c29217eecba27 ("v4l: vsp1: Support
multi-input entities") reworked pipeline routing configuration and
introduced a bug by writing to the entities routing registers without
first checking whether the entity had a routing register. This results
in overwriting the value at offset 0 of the device register space when
stopping the stream.

Fix this by skipping routing register write for entities without a
routing register.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: vb2: Fix stream start and buffer completion race
Laurent Pinchart [Mon, 23 Jun 2014 21:00:22 +0000 (18:00 -0300)]
[media] v4l: vb2: Fix stream start and buffer completion race

videobuf2 stores the driver streaming state internally in the queue in
the start_streaming_called variable. The state is set right after the
driver start_stream operation returns, and checked in the
vb2_buffer_done() function, typically called from the frame completion
interrupt handler. A race condition exists if the hardware finishes
processing the first frame before the start_stream operation returns.

Fix this by setting start_streaming_called to 1 before calling the
start_stream operation, and resetting it to 0 if the operation fails.

Cc: stable@vger.kernel.org # for v3.15 and up
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: Add premultiplied alpha flag for pixel formats
Laurent Pinchart [Tue, 27 May 2014 13:12:43 +0000 (10:12 -0300)]
[media] v4l: Add premultiplied alpha flag for pixel formats

When set, the new V4L2_PIX_FMT_FLAG_PREMUL_ALPHA flag indicates that the
pixel values are premultiplied by the alpha channel value.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: Support extending the v4l2_pix_format structure
Laurent Pinchart [Tue, 27 May 2014 12:41:05 +0000 (09:41 -0300)]
[media] v4l: Support extending the v4l2_pix_format structure

The v4l2_pix_format structure has no reserved field. It is embedded in
the v4l2_framebuffer structure which has no reserved fields either, and
in the v4l2_format structure which has reserved fields that were not
previously required to be zeroed out by applications.

To allow extending v4l2_pix_format, inline it in the v4l2_framebuffer
structure, and use the priv field as a magic value to indicate that the
application has set all v4l2_pix_format extended fields and zeroed all
reserved fields following the v4l2_pix_format field in the v4l2_format
structure.

The availability of this API extension is reported to userspace through
the new V4L2_CAP_EXT_PIX_FORMAT capability flag. Just checking that the
priv field is still set to the magic value at [GS]_FMT return wouldn't
be enough, as older kernels don't zero the priv field on return.

To simplify the internal API towards drivers zero the extended fields
and set the priv field to the magic value for applications not aware of
the extensions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] DocBook: media: Document ALPHA_COMPONENT control usage on output devices
Laurent Pinchart [Wed, 21 May 2014 22:16:01 +0000 (19:16 -0300)]
[media] DocBook: media: Document ALPHA_COMPONENT control usage on output devices

Extend the V4L2_CID_ALPHA_COMPONENT control for use on output devices,
to set the alpha component value when the output format doesn't have an
alpha channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: Add ARGB and XRGB pixel formats
Laurent Pinchart [Thu, 22 May 2014 01:07:55 +0000 (22:07 -0300)]
[media] v4l: Add ARGB and XRGB pixel formats

The existing RGB pixel formats are ill-defined in respect to their alpha
bits and their meaning is driver dependent. Create new standard ARGB and
XRGB variants with clearly defined meanings and make the existing
variants deprecated.

The new pixel formats 4CC values have been selected to match the DRM
4CCs for the same in-memory formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] Fix 64-bit division fall-out from 64-bit control ranges
Hans Verkuil [Thu, 17 Jul 2014 15:31:23 +0000 (12:31 -0300)]
[media] Fix 64-bit division fall-out from 64-bit control ranges

Commit 0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3 increased the internal control ranges
to 64 bit, but that caused problems in drivers that use the minimum/maximum/step/default_value
control values in a division or modulus operations since not all architectures support
those natively.

Luckily, in almost all cases it is possible to just cast to 32 bits (the control value
is known to be 32 bits, so it is safe to cast). Only in v4l2-ctrls.c was it necessary to
use do_div in one function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>