GitHub/LineageOS/android_kernel_motorola_exynos9610.git
7 years ago[media] v4l: Define a pixel format for the R-Car VSP1 1-D histogram engine
Laurent Pinchart [Sun, 10 Apr 2016 07:37:48 +0000 (04:37 -0300)]
[media] v4l: Define a pixel format for the R-Car VSP1 1-D histogram engine

The format is used on the R-Car VSP1 video queues that carry
1-D histogram statistics data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Fix HGO and HGT routing register addresses
Laurent Pinchart [Wed, 7 Sep 2016 12:36:31 +0000 (09:36 -0300)]
[media] v4l: vsp1: Fix HGO and HGT routing register addresses

The addresses are incorrect, fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Support histogram generators in pipeline configuration
Laurent Pinchart [Wed, 7 Sep 2016 12:09:53 +0000 (09:09 -0300)]
[media] v4l: vsp1: Support histogram generators in pipeline configuration

Histogram generators are single-pad entities that branch as leaf nodes
at any point in the pipeline. Make sure that pipeline traversal and
routing configuration support them correctly.

Support for the actual HGO and HGT operation will come later.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Add histogram support
Laurent Pinchart [Wed, 7 Sep 2016 11:58:49 +0000 (08:58 -0300)]
[media] v4l: vsp1: Add histogram support

The histogram common code will be used to implement support for both the
HGO and HGT histogram computation engines.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: Add metadata buffer type and format
Laurent Pinchart [Tue, 12 Apr 2016 22:40:46 +0000 (19:40 -0300)]
[media] v4l: Add metadata buffer type and format

The metadata buffer type is used to transfer metadata between userspace
and kernelspace through a V4L2 buffers queue. It comes with a new
metadata capture capability and format description.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: removed left-over 'experimental' note]
[hans.verkuil@cisco.com: add newline after _v4l2-meta-format label]

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: wpf: Implement rotation support
Laurent Pinchart [Mon, 20 Jun 2016 09:07:08 +0000 (06:07 -0300)]
[media] v4l: vsp1: wpf: Implement rotation support

Some WPF instances, on Gen3 devices, can perform 90° rotation when
writing frames to memory. Implement support for this using the
V4L2_CID_ROTATE control.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: Clearly document interactions between formats, controls and buffers
Laurent Pinchart [Sun, 26 Feb 2017 12:44:18 +0000 (09:44 -0300)]
[media] v4l: Clearly document interactions between formats, controls and buffers

V4L2 exposes parameters that influence buffers sizes through the format
ioctls (VIDIOC_G_FMT, VIDIOC_TRY_FMT, VIDIOC_S_FMT, and possibly
VIDIOC_G_SELECTION and VIDIOC_S_SELECTION). Other parameters not part of
the format structure may also influence buffer sizes or buffer layout in
general. One existing such parameter is rotation, which is implemented
by the V4L2_CID_ROTATE control and thus exposed through the V4L2 control
ioctls.

The interaction between those parameters and buffers is currently only
partially specified by the V4L2 API. In particular interactions between
controls and buffers isn't specified at all. The behaviour of the
VIDIOC_S_FMT and VIDIOC_S_SELECTION ioctls when buffers are allocated is
also not fully specified.

This patch clearly defines and documents the interactions between
formats, selections, controls and buffers.

The preparatory discussions for the documentation change considered
completely disallowing controls that change the buffer size or layout,
in favour of extending the format API with a new ioctl that would bundle
those controls with format information. The idea has been rejected, as
this would essentially be a restricted version of the upcoming request
API that wouldn't bring any additional value.

Another option we have considered was to mandate the use of the request
API to modify controls that influence buffer size or layout. This has
also been rejected on the grounds that requiring the request API to
change rotation even when streaming is stopped would significantly
complicate implementation of drivers and usage of the V4L2 API for
applications.

Applications will however be required to use the upcoming request API to
change at runtime formats or controls that influence the buffer size or
layout, because of the need to synchronize buffers with the formats and
controls. Otherwise there would be no way to interpret the content of a
buffer correctly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov2640: avoid calling ov2640_select_win() twice
Hans Verkuil [Mon, 4 May 2015 10:25:51 +0000 (07:25 -0300)]
[media] ov2640: avoid calling ov2640_select_win() twice

Simplify ov2640_set_params and ov2640_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov9740: avoid calling ov9740_res_roundup() twice
Hans Verkuil [Mon, 4 May 2015 10:25:55 +0000 (07:25 -0300)]
[media] ov9740: avoid calling ov9740_res_roundup() twice

Simplify ov9740_s_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov9640: avoid calling ov9640_res_roundup() twice
Hans Verkuil [Mon, 4 May 2015 10:25:54 +0000 (07:25 -0300)]
[media] ov9640: avoid calling ov9640_res_roundup() twice

Simplify ov9640_s_fmt and ov9640_set_fmt

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov772x: avoid calling ov772x_select_params() twice
Hans Verkuil [Mon, 4 May 2015 10:25:53 +0000 (07:25 -0300)]
[media] ov772x: avoid calling ov772x_select_params() twice

Merge ov772x_s_fmt into ov772x_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov5642: avoid calling ov5642_find_datafmt() twice
Hans Verkuil [Mon, 4 May 2015 10:25:52 +0000 (07:25 -0300)]
[media] ov5642: avoid calling ov5642_find_datafmt() twice

Simplify ov5642_set_fmt().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] mt9v022: avoid calling mt9v022_find_datafmt() twice
Hans Verkuil [Mon, 4 May 2015 10:25:50 +0000 (07:25 -0300)]
[media] mt9v022: avoid calling mt9v022_find_datafmt() twice

Simplify mt9v022_s_fmt and mt9v022_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] mt9m001: avoid calling mt9m001_find_datafmt() twice
Hans Verkuil [Mon, 4 May 2015 10:25:49 +0000 (07:25 -0300)]
[media] mt9m001: avoid calling mt9m001_find_datafmt() twice

Simplify mt9m001_s_fmt and mt9m001_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] imx074: avoid calling imx074_find_datafmt() twice
Hans Verkuil [Mon, 4 May 2015 10:25:48 +0000 (07:25 -0300)]
[media] imx074: avoid calling imx074_find_datafmt() twice

Simplify imx074_set_fmt().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] si2157: Add support for Si2141-A10
Stefan Brüns [Fri, 17 Feb 2017 00:55:31 +0000 (22:55 -0200)]
[media] si2157: Add support for Si2141-A10

The Si2141 needs two distinct commands for powerup/reset, otherwise it
will not respond to chip revision requests. It also needs a firmware
to run properly.

Cc: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] si2157: revert si2157: Si2141/2151 tuner support
Antti Palosaari [Thu, 6 Apr 2017 12:17:42 +0000 (09:17 -0300)]
[media] si2157: revert si2157: Si2141/2151 tuner support

'Reset' loop does not look correct. I tested it very many times and
it never repeated those commands. If problem, it tries to solve,
really occurs on some situations better solution should be find out.

There is another patch which does not have such hackish looking loop.
Lets change to it.

Cc: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l2-tpg: don't clamp XV601/709 to lim range
Hans Verkuil [Mon, 10 Apr 2017 07:54:30 +0000 (04:54 -0300)]
[media] v4l2-tpg: don't clamp XV601/709 to lim range

The XV601/709 encodings are special: they signal limited range, but use the full range
to encode a larger gamut with R', G' and B' values outside the [0-1] range.

So don't clamp to limited range for these two encodings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] videodev2.h: fix outdated comment
Hans Verkuil [Mon, 10 Apr 2017 07:51:44 +0000 (04:51 -0300)]
[media] videodev2.h: fix outdated comment

The XV601/709 Y'CbCr encoding was changed to limited range, but the comment
still indicates full range.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] imon: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:08 +0000 (22:34 -0300)]
[media] imon: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] wl128x: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:07 +0000 (22:34 -0300)]
[media] wl128x: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] c8sectpfe: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:06 +0000 (22:34 -0300)]
[media] c8sectpfe: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] fsl-viu: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:04 +0000 (22:34 -0300)]
[media] fsl-viu: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] av7110: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:03 +0000 (22:34 -0300)]
[media] av7110: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] netup_unidvb: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:02 +0000 (22:34 -0300)]
[media] netup_unidvb: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ivtv: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:01 +0000 (22:34 -0300)]
[media] ivtv: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cx18: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:34:00 +0000 (22:34 -0300)]
[media] cx18: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] bt8xx: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:33:59 +0000 (22:33 -0300)]
[media] bt8xx: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] saa7146: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:33:58 +0000 (22:33 -0300)]
[media] saa7146: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] saa7134: use setup_timer
Geliang Tang [Sun, 9 Apr 2017 01:33:57 +0000 (22:33 -0300)]
[media] saa7134: use setup_timer

Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] media: bcm2048: fix several macros
Nikola Jelic [Sat, 8 Apr 2017 15:44:41 +0000 (12:44 -0300)]
[media] media: bcm2048: fix several macros

Some of the macros didn't use the parenthesis around the parameters when
used in the body of the macro.

Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] m2m-deinterlace: don't return zero on failure paths in deinterlace_probe()
Alexey Khoroshilov [Fri, 7 Apr 2017 23:09:17 +0000 (20:09 -0300)]
[media] m2m-deinterlace: don't return zero on failure paths in deinterlace_probe()

If DMA does not support INTERLEAVE, deinterlace_probe() breaks off
initialization, releases dma channel, but returns zero.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] coda: do not enumerate YUYV if VDOA is not available
Philipp Zabel [Thu, 6 Apr 2017 14:03:40 +0000 (11:03 -0300)]
[media] coda: do not enumerate YUYV if VDOA is not available

TRY_FMT already disables the YUYV format if the VDOA is not available.
ENUM_FMT must do the same.

Fixes: d40e98c13b3e ("[media] coda: support YUYV output if VDOA is used")

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] tvp5150: fix pad format frame height
Philipp Zabel [Fri, 31 Mar 2017 13:33:26 +0000 (10:33 -0300)]
[media] tvp5150: fix pad format frame height

Even if field order is set to V4L2_FIELD_ALTERNATE, the width and height
values in struct v4l2_mbus_framefmt still refer to frame size, not field
size.

Fixes: 4f57d27be2a5 ("[media] tvp5150: fix tvp5150_fill_fmt()")

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] tvp5150: allow get/set_fmt on the video source pad
Philipp Zabel [Fri, 31 Mar 2017 13:33:25 +0000 (10:33 -0300)]
[media] tvp5150: allow get/set_fmt on the video source pad

To let userspace propagate formats downstream in a media controller
scenario, the video source pad (now pad 1, DEMOD_PAD_VID_OUT) must allow
setting and getting the format. Incidentally, tvp5150_fill_fmt was
implemented for this pad, not for the new analog input pad (now pad 0,
DEMOD_PAD_IF_INPUT).

Fixes: 55606310e77f ("[media] tvp5150: create the expected number of pads")

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] coda: remove redundant call to v4l2_m2m_get_vq
Colin Ian King [Thu, 23 Mar 2017 11:57:46 +0000 (08:57 -0300)]
[media] coda: remove redundant call to v4l2_m2m_get_vq

The call to v4ls_m2m_get_vq is only used to get the return value
which is not being used, so it appears to be redundant and can
be removed.

Detected with CoverityScan, CID#1420674 ("Useless call")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] em28xx: drop last soc_camera link
Hans Verkuil [Thu, 24 Nov 2016 07:49:35 +0000 (05:49 -0200)]
[media] em28xx: drop last soc_camera link

The em28xx driver still used the soc_camera.h header for the ov2640
driver. Since this driver no longer uses soc_camera, that include can
be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov2640: add MC support
Hans Verkuil [Mon, 30 Jan 2017 13:50:45 +0000 (11:50 -0200)]
[media] ov2640: add MC support

The MC support is needed by the em28xx driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov2640: use standard clk and enable it
Hans Verkuil [Thu, 24 Nov 2016 07:41:42 +0000 (05:41 -0200)]
[media] ov2640: use standard clk and enable it

Convert v4l2_clk to normal clk and enable the clock.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov2640: convert from soc-camera to a standard subdev sensor driver
Hans Verkuil [Tue, 22 Nov 2016 16:44:37 +0000 (14:44 -0200)]
[media] ov2640: convert from soc-camera to a standard subdev sensor driver

Convert ov2640 to a standard subdev driver. The soc-camera driver no longer
uses this driver, so it can safely be converted.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cec: fix confusing CEC_CAP_RC and IS_REACHABLE(CONFIG_RC_CORE) code
Hans Verkuil [Tue, 4 Apr 2017 16:43:33 +0000 (13:43 -0300)]
[media] cec: fix confusing CEC_CAP_RC and IS_REACHABLE(CONFIG_RC_CORE) code

It is a bit confusing how CEC_CAP_RC and IS_REACHABLE(CONFIG_RC_CORE)
interact. By stripping CEC_CAP_RC at the beginning rather than after #else
it should be a bit clearer what is going on.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cec: Fix runtime BUG when (CONFIG_RC_CORE && !CEC_CAP_RC)
Lee Jones [Tue, 4 Apr 2017 12:32:19 +0000 (09:32 -0300)]
[media] cec: Fix runtime BUG when (CONFIG_RC_CORE && !CEC_CAP_RC)

Currently when the RC Core is enabled (reachable) core code located
in cec_register_adapter() attempts to populate the RC structure with
a pointer to the 'parent' passed in by the caller.

Unfortunately if the caller did not specify RC capability when calling
cec_allocate_adapter(), then there will be no RC structure to populate.

This causes a "NULL pointer dereference" error.

Fixes: f51e80804f0 ("[media] cec: pass parent device in register(), not allocate()")

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: <stable@vger.kernel.org> # for v4.10 and up
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-cec: add cec-notifier support, move out of staging
Hans Verkuil [Tue, 13 Dec 2016 14:37:16 +0000 (12:37 -0200)]
[media] s5p-cec: add cec-notifier support, move out of staging

By using the CEC notifier framework there is no longer any reason
to manually set the physical address. This was the one blocking
issue that prevented this driver from going out of staging, so do
this move as well.

Update the bindings documenting the new hdmi phandle and
update exynos4.dtsi accordingly.

Tested with my Odroid U3.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
CC: linux-samsung-soc@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-cec.txt: document the HDMI controller phandle
Hans Verkuil [Tue, 13 Dec 2016 14:37:16 +0000 (12:37 -0200)]
[media] s5p-cec.txt: document the HDMI controller phandle

Update the bindings documenting the new hdmi phandle.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
CC: linux-samsung-soc@vger.kernel.org
CC: devicetree@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
Hans Verkuil [Tue, 13 Dec 2016 14:37:16 +0000 (12:37 -0200)]
[media] ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi

Add the new hdmi phandle to exynos4.dtsi. This phandle is needed by the
s5p-cec driver to initialize the CEC notifier framework.

Tested with my Odroid U3.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: linux-samsung-soc@vger.kernel.org
CC: devicetree@vger.kernel.org
CC: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] exynos_hdmi: add CEC notifier support
Hans Verkuil [Tue, 13 Dec 2016 13:07:17 +0000 (11:07 -0200)]
[media] exynos_hdmi: add CEC notifier support

Implement the CEC notifier support to allow CEC drivers to
be informed when there is a new physical address.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ARM: dts: STiH410: update sti-cec for CEC notifier support
Benjamin Gaignard [Tue, 3 Jan 2017 14:54:57 +0000 (12:54 -0200)]
[media] ARM: dts: STiH410: update sti-cec for CEC notifier support

To use CEC notifier sti CEC driver needs to get phandle
of the hdmi device.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: Patrice CHOTARD <patrice.chotard@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] stih-cec: add CEC notifier support
Benjamin Gaignard [Tue, 3 Jan 2017 14:54:56 +0000 (12:54 -0200)]
[media] stih-cec: add CEC notifier support

By using the CEC notifier framework there is no longer any reason
to manually set the physical address. This was the one blocking
issue that prevented this driver from going out of staging, so do
this move as well.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] stih-cec.txt: document new hdmi phandle
Benjamin Gaignard [Tue, 3 Jan 2017 14:54:56 +0000 (12:54 -0200)]
[media] stih-cec.txt: document new hdmi phandle

Update the bindings documentation with the new hdmi phandle.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] sti: hdmi: add CEC notifier support
Benjamin Gaignard [Tue, 3 Jan 2017 14:54:55 +0000 (12:54 -0200)]
[media] sti: hdmi: add CEC notifier support

Implement the CEC notifier support to allow CEC drivers to
be informed when there is a new physical address.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cec: integrate CEC notifier support
Hans Verkuil [Tue, 13 Dec 2016 14:15:57 +0000 (12:15 -0200)]
[media] cec: integrate CEC notifier support

Support the CEC notifier framework, simplifying drivers that
depend on this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] media: add CEC notifier support
Hans Verkuil [Mon, 14 Nov 2016 13:55:20 +0000 (11:55 -0200)]
[media] media: add CEC notifier support

Add support for CEC notifiers, which is used to convey CEC physical address
information from video drivers to their CEC counterpart driver(s).

Based on an earlier version from Russell King:

https://patchwork.kernel.org/patch/9277043/

The cec_notifier is a reference counted object containing the CEC physical address
state of a video device.

When a new notifier is registered the current state will be reported to
that notifier at registration time.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] mn88472: implement PER statistics
Antti Palosaari [Fri, 17 Mar 2017 16:45:48 +0000 (13:45 -0300)]
[media] mn88472: implement PER statistics

Implement DVBv5 PER.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] mn88472: implement cnr statistics
Antti Palosaari [Fri, 17 Mar 2017 16:34:44 +0000 (13:34 -0300)]
[media] mn88472: implement cnr statistics

Implement DVBv5 CNR.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] mn88472: implement signal strength statistics
Antti Palosaari [Fri, 17 Mar 2017 15:43:06 +0000 (12:43 -0300)]
[media] mn88472: implement signal strength statistics

Implement DVBv5 signal strength on relative scale.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] rainshadow-cec: new RainShadow Tech HDMI CEC driver
Hans Verkuil [Sat, 5 Nov 2016 10:39:58 +0000 (08:39 -0200)]
[media] rainshadow-cec: new RainShadow Tech HDMI CEC driver

This driver supports the RainShadow Tech USB HDMI CEC adapter.

See: http://rainshadowtech.com/HdmiCecUsb.html

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] serio.h: add SERIO_RAINSHADOW_CEC ID
Hans Verkuil [Sat, 5 Nov 2016 10:39:58 +0000 (08:39 -0200)]
[media] serio.h: add SERIO_RAINSHADOW_CEC ID

Add a new serio ID for the RainShadow Tech USB HDMI CEC adapter.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Register pipe with output WPF
Kieran Bingham [Mon, 27 Feb 2017 13:40:34 +0000 (10:40 -0300)]
[media] v4l: vsp1: Register pipe with output WPF

The DRM object does not register the pipe with the WPF object. This is
used internally throughout the driver as a means of accessing the pipe.
As such this breaks operations which require access to the pipe from WPF
interrupts.

Register the pipe inside the WPF object after it has been declared as
the output.

Fixes: ff7e97c94d9f ("[media] v4l: vsp1: Store pipeline pointer in rwpf")

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Fix struct vsp1_drm documentation
Kieran Bingham [Thu, 2 Mar 2017 10:12:22 +0000 (07:12 -0300)]
[media] v4l: vsp1: Fix struct vsp1_drm documentation

The struct vsp1_drm references a member 'planes' which doesn't exist.
Correctly identify this documentation against the 'inputs'

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Disable HSV formats on Gen3 hardware
Laurent Pinchart [Tue, 28 Feb 2017 22:44:55 +0000 (19:44 -0300)]
[media] v4l: vsp1: Disable HSV formats on Gen3 hardware

While all VSP instances can process HSV internally, on Gen3 hardware
reading or writing HSV24 or HSV32 from/to memory causes the device to
hang. Disable those pixel formats on Gen3 hardware.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Fix multi-line comment style
Laurent Pinchart [Sun, 26 Feb 2017 13:29:50 +0000 (10:29 -0300)]
[media] v4l: vsp1: Fix multi-line comment style

Fix all multi-line comments to comply with the kernel coding style.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Remove redundant pipe->dl usage from drm
Kieran Bingham [Fri, 6 Jan 2017 12:15:31 +0000 (10:15 -0200)]
[media] v4l: vsp1: Remove redundant pipe->dl usage from drm

The pipe->dl is used only inside vsp1_du_atomic_flush(), and can be
obtained and stored locally to simplify the code.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Prevent multiple streamon race commencing pipeline early
Kieran Bingham [Fri, 6 Jan 2017 12:15:28 +0000 (10:15 -0200)]
[media] v4l: vsp1: Prevent multiple streamon race commencing pipeline early

With multiple inputs through the BRU it is feasible for the streams to
race each other at stream-on.

Multiple VIDIOC_STREAMON calls racing each other could have process
N-1 skipping over the pipeline setup section and then start the pipeline
early, if videobuf2 has already enqueued buffers to the driver for
process N but not called the .start_streaming() operation yet

In the case of the video pipelines, this
can present two serious issues.

 1) A null-dereference if the pipe->dl is committed at the same time as
    the vsp1_video_setup_pipeline() is processing

 2) A hardware hang, where a display list is committed without having
    called vsp1_video_setup_pipeline() first

Repair this issue, by ensuring that only the stream which configures the
pipeline is able to start it.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Fix RPF/WPF U/V order in 3-planar formats on Gen3
Laurent Pinchart [Sun, 12 Feb 2017 22:58:20 +0000 (20:58 -0200)]
[media] v4l: vsp1: Fix RPF/WPF U/V order in 3-planar formats on Gen3

The RPF and WPF U/V order bits have no effect for 3-planar formats on
Gen3 hardware. Swap the U and V planes addresses manually instead in
that case.

Fixes: b915bd24a034 ("[media] v4l: vsp1: Add tri-planar memory formats support")

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Clean up file handle in open() error path
Shailendra Verma [Fri, 25 Nov 2016 05:07:57 +0000 (03:07 -0200)]
[media] v4l: vsp1: Clean up file handle in open() error path

v4l2_fh_init is already done. So call the v4l2_fh_exit in error
condition before returing from the function.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Fix format-info documentation
Kieran Bingham [Thu, 9 Jun 2016 17:57:02 +0000 (14:57 -0300)]
[media] v4l: vsp1: Fix format-info documentation

Minor tweaks to document the swap register and make the documentation
match the struct ordering

Signed-off-by: Kieran Bingham <kieran@bingham.xyz>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] dev-capture.rst/dev-output.rst: video standards ioctls are optional
Hans Verkuil [Wed, 29 Mar 2017 07:56:47 +0000 (09:56 +0200)]
[media] dev-capture.rst/dev-output.rst: video standards ioctls are optional

The documentation for video capture and output devices claims that the video standard
ioctls are required. This is not the case, they are only required for PAL/NTSC/SECAM
type inputs and outputs. Sensors do not implement this at all and e.g. HDMI inputs
implement the DV Timings ioctls.

Just drop the mention of 'video standard' ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] MAINTAINERS: update atmel-isi.c path
Hans Verkuil [Mon, 3 Apr 2017 14:50:53 +0000 (11:50 -0300)]
[media] MAINTAINERS: update atmel-isi.c path

The driver moved to drivers/media/platform/atmel.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov2640: update bindings
Hans Verkuil [Mon, 12 Dec 2016 13:11:25 +0000 (11:11 -0200)]
[media] ov2640: update bindings

Update the bindings for this device based on a working DT example.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov2640: fix colorspace handling
Hans Verkuil [Tue, 16 Aug 2016 19:56:43 +0000 (16:56 -0300)]
[media] ov2640: fix colorspace handling

The colorspace is independent of whether YUV or RGB is sent to the SoC.
Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] atmel-isi: move out of soc_camera to atmel
Hans Verkuil [Wed, 21 Sep 2016 06:53:25 +0000 (03:53 -0300)]
[media] atmel-isi: move out of soc_camera to atmel

Move this out of the soc_camera directory into the atmel directory
where it belongs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] atmel-isi: remove dependency of the soc-camera framework
Hans Verkuil [Tue, 16 Aug 2016 19:56:43 +0000 (16:56 -0300)]
[media] atmel-isi: remove dependency of the soc-camera framework

This patch converts the atmel-isi driver from a soc-camera driver to a driver
that is stand-alone.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] atmel-isi: update device tree bindings documentation
Hans Verkuil [Mon, 12 Dec 2016 13:11:35 +0000 (11:11 -0200)]
[media] atmel-isi: update device tree bindings documentation

The original bindings documentation was incomplete (missing pinctrl-names,
missing endpoint node properties) and the example was out of date.

Add the missing information and tidy up the text.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov7670: add devicetree support
Hans Verkuil [Mon, 12 Dec 2016 14:08:18 +0000 (12:08 -0200)]
[media] ov7670: add devicetree support

Add DT support. Use it to get the reset and pwdn pins (if there are any).
Tested with one sensor requiring reset/pwdn and one sensor that doesn't
have reset/pwdn pins.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov7670: get xclk
Hans Verkuil [Tue, 16 Aug 2016 19:00:57 +0000 (16:00 -0300)]
[media] ov7670: get xclk

Get the clock for this sensor.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov7670: fix g/s_parm
Hans Verkuil [Tue, 16 Aug 2016 18:57:46 +0000 (15:57 -0300)]
[media] ov7670: fix g/s_parm

Drop unnecesary memset. Drop the unnecessary extendedmode check and
set the V4L2_CAP_TIMEPERFRAME capability.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov7670: call v4l2_async_register_subdev
Hans Verkuil [Tue, 16 Aug 2016 18:55:58 +0000 (15:55 -0300)]
[media] ov7670: call v4l2_async_register_subdev

Add v4l2-async support for this driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] ov7670: document device tree bindings
Hans Verkuil [Mon, 12 Dec 2016 14:08:30 +0000 (12:08 -0200)]
[media] ov7670: document device tree bindings

Add binding documentation and add that file to the MAINTAINERS entry.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] uvcvideo: Add support for Intel SR300 depth camera
Daniel Patrick Johnson [Thu, 2 Mar 2017 23:43:20 +0000 (20:43 -0300)]
[media] uvcvideo: Add support for Intel SR300 depth camera

Add support for Intel SR300 depth camera in uvc driver.
This includes adding three uvc GUIDs for the required pixel formats
and updating the uvc driver GUID-to-4cc tables with the new formats.

Signed-off-by: Daniel Patrick Johnson <teknotus@teknot.us>
Signed-off-by: Aviv Greenberg <avivgr@gmail.com>
Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] Documentation: Intel SR300 Depth camera INZI format
Evgeni Raikhel [Thu, 2 Mar 2017 23:43:19 +0000 (20:43 -0300)]
[media] Documentation: Intel SR300 Depth camera INZI format

Provide the frame structure and data layout of V4L2-PIX-FMT-INZI
format utilized by Intel SR300 Depth camera.

Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] uvcvideo: Don't record timespec_sub
Kieran Bingham [Mon, 3 Apr 2017 11:25:31 +0000 (08:25 -0300)]
[media] uvcvideo: Don't record timespec_sub

The statistics function subtracts two timespecs manually. A helper is
provided by the kernel to do this.

Replace the implementation, using the helper.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] uvcvideo: Fix empty packet statistic
Kieran Bingham [Mon, 3 Apr 2017 11:25:32 +0000 (08:25 -0300)]
[media] uvcvideo: Fix empty packet statistic

The frame counters are inadvertently counting packets with content as
empty.

Fix it by correcting the logic expression

Fixes: 7bc5edb00bbd [media] uvcvideo: Extract video stream statistics

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l2-ctrls.c: fix RGB quantization range control menu
Hans Verkuil [Mon, 3 Apr 2017 08:21:07 +0000 (05:21 -0300)]
[media] v4l2-ctrls.c: fix RGB quantization range control menu

All control menus use the english capitalization rules of titles.

The only menu not following these rules is the RGB Quantization Range control
menu. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cx231xx-audio: fix NULL-deref at probe
Johan Hovold [Mon, 13 Mar 2017 12:53:58 +0000 (09:53 -0300)]
[media] cx231xx-audio: fix NULL-deref at probe

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer or accessing memory beyond the endpoint array should a
malicious device lack the expected endpoints.

Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver")

Cc: stable <stable@vger.kernel.org> # 2.6.30
Cc: Sri Deevi <Srinivasa.Deevi@conexant.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cx231xx-audio: fix init error path
Johan Hovold [Mon, 13 Mar 2017 12:53:57 +0000 (09:53 -0300)]
[media] cx231xx-audio: fix init error path

Make sure to release the snd_card also on a late allocation error.

Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver")

Cc: stable <stable@vger.kernel.org> # 2.6.30
Cc: Sri Deevi <Srinivasa.Deevi@conexant.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cx231xx-cards: fix NULL-deref at probe
Johan Hovold [Mon, 13 Mar 2017 12:53:56 +0000 (09:53 -0300)]
[media] cx231xx-cards: fix NULL-deref at probe

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer or accessing memory beyond the endpoint array should a
malicious device lack the expected endpoints.

Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver")

Cc: stable <stable@vger.kernel.org> # 2.6.30
Cc: Sri Deevi <Srinivasa.Deevi@conexant.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] usbvision: fix NULL-deref at probe
Johan Hovold [Mon, 13 Mar 2017 12:53:55 +0000 (09:53 -0300)]
[media] usbvision: fix NULL-deref at probe

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer or accessing memory beyond the endpoint array should a
malicious device lack the expected endpoints.

Fixes: 2a9f8b5d25be ("V4L/DVB (5206): Usbvision: set alternate interface
modification")

Cc: stable <stable@vger.kernel.org> # 2.6.21
Cc: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] dib0700: fix NULL-deref at probe
Johan Hovold [Mon, 13 Mar 2017 12:53:54 +0000 (09:53 -0300)]
[media] dib0700: fix NULL-deref at probe

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer should a malicious device lack endpoints.

Fixes: c4018fa2e4c0 ("[media] dib0700: fix RC support on Hauppauge
Nova-TD")

Cc: stable <stable@vger.kernel.org> # 3.16
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] vidioc-enumin/output.rst: improve documentation
Hans Verkuil [Fri, 31 Mar 2017 08:58:39 +0000 (05:58 -0300)]
[media] vidioc-enumin/output.rst: improve documentation

The V4L2_INPUT_TYPE_CAMERA and V4L2_OUTPUT_TYPE_ANALOG descriptions were
hopelessly out of date. Fix this, and also fix a few style issues in these
documents. Finally add the missing documentation for V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY
(only used by the zoran driver).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l2-compat-ioctl32: VIDIOC_S_EDID should return all fields on error
Hans Verkuil [Thu, 30 Mar 2017 12:05:25 +0000 (09:05 -0300)]
[media] v4l2-compat-ioctl32: VIDIOC_S_EDID should return all fields on error

Most ioctls do not have to write back the contents of the argument
if an error is returned. But VIDIOC_S_EDID is an exception together
with the EXT_CTRLS ioctls (already handled correctly).

Add this exception to v4l2-compat-ioctl32.

This fixes a compliance error when using compat32 and trying to
set a new EDID with more blocks than the hardware supports. In
that case the driver will return -E2BIG and set edid.blocks to the
actual maximum number of blocks. This field was never copied back
to userspace due to this bug.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] video.rst: a sensor is also considered to be a physical input
Hans Verkuil [Wed, 29 Mar 2017 07:59:12 +0000 (04:59 -0300)]
[media] video.rst: a sensor is also considered to be a physical input

Add the line "Camera sensors are also considered to be a video input."

In practice all non-MC drivers for sensors support the input ioctls, and the
compliance test actually tests for the presence of these ioctls. So clarify
the documentation by explicitly mentioning sensors.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] vcodec: mediatek: mark pm functions as __maybe_unused
Arnd Bergmann [Mon, 20 Mar 2017 09:47:55 +0000 (06:47 -0300)]
[media] vcodec: mediatek: mark pm functions as __maybe_unused

When CONFIG_PM is disabled, we get a couple of unused functions:

drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c:927:13: error: 'mtk_jpeg_clk_off' defined but not used [-Werror=unused-function]
 static void mtk_jpeg_clk_off(struct mtk_jpeg_dev *jpeg)
             ^~~~~~~~~~~~~~~~
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c:916:13: error: 'mtk_jpeg_clk_on' defined but not used [-Werror=unused-function]
 static void mtk_jpeg_clk_on(struct mtk_jpeg_dev *jpeg)

Rather than adding more error-prone #ifdefs around those, this patch
removes the existing #ifdef checks and marks the PM functions as __maybe_unused
to let gcc do the right thing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Rick Chang <rick.chang@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-g2d: Fix error handling
Christophe JAILLET [Sun, 19 Feb 2017 17:30:22 +0000 (14:30 -0300)]
[media] s5p-g2d: Fix error handling

According to the surrounding goto, it is likely that 'unprep_clk_gate'
was expected here.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-mfc: Don't allocate codec buffers from pre-allocated region
Marek Szyprowski [Wed, 22 Mar 2017 10:34:28 +0000 (07:34 -0300)]
[media] s5p-mfc: Don't allocate codec buffers from pre-allocated region

Further investigation revealed that codec buffers also don't need to
be allocated at higher addresses than firmware base for MFC v6+ hardware.
Those buffers can be quite large and its size depends on the selected
format and framesize. This patch changes the way the codec buffers are
allocated - driver will use generic allocator for them instead of the
pre-allocated buffer for firmware and contexts.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-mfc: Fix unbalanced call to clock management
Marek Szyprowski [Wed, 22 Mar 2017 07:53:57 +0000 (04:53 -0300)]
[media] s5p-mfc: Fix unbalanced call to clock management

Clock should be turned off after calling s5p_mfc_init_hw() from the
watchdog worker, like it is already done in the s5p_mfc_open() which also
calls this function.

Fixes: af93574678108 ("[media] MFC: Add MFC 5.1 V4L2 driver")

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: stable@vger.kernel.org # v3.7+
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-mfc: Rename BANK1/2 to BANK_L/R to better match documentation
Marek Szyprowski [Mon, 20 Mar 2017 10:49:24 +0000 (07:49 -0300)]
[media] s5p-mfc: Rename BANK1/2 to BANK_L/R to better match documentation

Documentation for MFC hardware still uses 'left' and 'right' names for
the memory channel/banks, so replace BANK1/2 defines with more appropriate
BANK_L/R names.

Suggested-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-mfc: Use preallocated block allocator always for MFC v6+
Marek Szyprowski [Mon, 13 Feb 2017 10:58:14 +0000 (08:58 -0200)]
[media] s5p-mfc: Use preallocated block allocator always for MFC v6+

It turned out that all versions of MFC v6+ hardware doesn't have a strict
requirement for ALL buffers to be allocated on higher addresses than the
firmware base like it was documented for MFC v5. This requirement is true
only for the device and per-context buffers. All video data buffers can be
allocated anywhere for all MFC v6+ versions. Basing on this fact, the
special DMA configuration based on two reserved memory regions is not
really needed for MFC v6+ devices, because the memory requirements for the
firmware, device and per-context buffers can be fulfilled by the simple
probe-time pre-allocated block allocator introduced in previous patch.

This patch enables support for such pre-allocated block based allocator
always for MFC v6+ devices. Due to the limitations of the memory management
subsystem the largest supported size of the pre-allocated buffer when no
CMA (Contiguous Memory Allocator) is enabled is 4 MiB.

This patch also removes the requirement to provide two reserved memory
regions for MFC v6+ devices in device tree. Now the driver is fully
functional without them.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Smitha T Murthy <smitha.t@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-mfc: Remove special configuration of IOMMU domain
Marek Szyprowski [Mon, 13 Feb 2017 10:47:51 +0000 (08:47 -0200)]
[media] s5p-mfc: Remove special configuration of IOMMU domain

The main reason for using special configuration of IOMMU domain was the
problem with MFC firmware, which failed to operate properly when placed
at 0 DMA address. Instead of adding custom code for configuring each
variant of IOMMU domain and architecture specific glue code, simply use
what arch code provides and if the DMA base address equals zero, skip
first 128 KiB to keep required alignment. This patch also make the driver
operational on ARM64 architecture, because it no longer depends on ARM
specific DMA-mapping and IOMMU glue code functions.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Smitha T Murthy <smitha.t@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-mfc: Add support for probe-time preallocated block based allocator
Marek Szyprowski [Mon, 13 Feb 2017 10:57:11 +0000 (08:57 -0200)]
[media] s5p-mfc: Add support for probe-time preallocated block based allocator

Current MFC driver depends on the fact that when IOMMU is available, the
DMA-mapping framework and its IOMMU glue will use first-fit allocator.
This was true for ARM architecture, but its not for ARM64 arch. However, in
case of MFC v6+ hardware and latest firmware, it turned out that there is
no strict requirement for ALL buffers to be allocated on higher addresses
than the firmware base. This requirement is true only for the device and
per-context buffers. All video data buffers can be allocated anywhere for
all MFC v6+ versions.

Such relaxed requirements for the memory buffers can be easily fulfilled
by allocating firmware, device and per-context buffers from the probe-time
preallocated larger buffer. This patch adds support for it. This way the
driver finally works fine on ARM64 architecture. The size of the
preallocated buffer is 8 MiB, what is enough for three instances H264
decoders or encoders (other codecs have smaller memory requirements).
If one needs more for particular use case, one can use "mem" module
parameter to force larger (or smaller) buffer (for example by adding
"s5p_mfc.mem=16M" to kernel command line).

[mchehab@s-opensource.com: fix two checkpatch warnings: don't initialize
 static to NULL; don't use S_foo permisions]

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Smitha T Murthy <smitha.t@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-mfc: Split variant DMA memory configuration into separate functions
Marek Szyprowski [Mon, 20 Feb 2017 13:11:42 +0000 (10:11 -0300)]
[media] s5p-mfc: Split variant DMA memory configuration into separate functions

Move code for DMA memory configuration with IOMMU into separate function
to make it easier to compare what is being done in each case.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Smitha T Murthy <smitha.t@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>