Declare mb86a16_config structure as const as it is either passed as
an argument to the function dvb_attach or is dereferenced. dvb_attach
calls its first argument on the rest of its arguments. The first argument
of dvb_attach in the changed case is mb86a16_attach and the parameter of
this function to which the object reference is passed is of type
const. So, mb86a16_config structures having this property can be made
const.
Bhumika Goyal [Sun, 19 Feb 2017 17:29:07 +0000 (14:29 -0300)]
[media] cx88: constify mb86a16_config structure
Declare mb86a16_config structure as const as it is only passed as
an argument to the function dvb_attach. dvb_attach calls its first
argument on the rest of its arguments. The first argument of
dvb_attach in the changed case is mb86a16_attach and the parameter of
this function to which the object reference is passed is of type
const. So, mb86a16_config structures having this property can be made
const.
Declare nxt200x_config structures as const as they are only passed as
an argument to the function dvb_attach. dvb_attach calls its first
argument on the rest of its arguments. The first argument of
dvb_attach in the changed cases is nxt200x_attach and the parameter of
this function to which the object references are passed is of type
const. So, nxt200x_config structures having this property can be made
const.
File size before:
text data bss dec hex filename
21320 3776 16 25112 6218 saa7134/saa7134-dvb.o
File size after:
text data bss dec hex filename
21384 3744 16 25144 6238 saa7134/saa7134-dvb.o
Bhumika Goyal [Sun, 19 Feb 2017 12:59:52 +0000 (09:59 -0300)]
[media] b2c2: constify nxt200x_config structure
Declare nxt200x_config structure as const as it is only passed as
an argument to the function dvb_attach. dvb_attach calls its first
argument on the rest of its arguments. The first argument of
dvb_attach in the changed case is nxt200x_attach and the parameter of
this function to which the object reference is passed is of type
const. So, nxt200x_config structures having this property can be made
const.
File size before:
text data bss dec hex filename
7566 568 0 8134 1fc6 common/b2c2/flexcop-fe-tuner.o
File size after:
text data bss dec hex filename
7582 536 0 8118 1fb6 common/b2c2/flexcop-fe-tuner.o
Colin Ian King [Fri, 17 Feb 2017 16:17:30 +0000 (14:17 -0200)]
[media] Staging: media/lirc: don't call put_ir_rx on rx twice
There is an exit path where rx is kfree'd on put_ir_rx and then
a jump to label out_put_xx will again kfree it with another
call to put_ir_rx. Fix this by adding a new label that avoids
this 2nd call to put_ir_rx for this specific case.
Detected with CoverityScan, CID#145119 ("Use after free")
Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Helen Koike [Fri, 7 Apr 2017 17:55:19 +0000 (14:55 -0300)]
[media] vimc: Virtual Media Controller core, capture and sensor
First version of the Virtual Media Controller.
Add a simple version of the core of the driver, the capture and
sensor nodes in the topology, generating a grey image in a hardcoded
format.
Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fix small typo in Kconfig]
The HGT is a Histogram Generator Two-Dimensions. It computes a weighted
frequency histograms for hue and saturation areas over a configurable
region of the image with optional subsampling.
[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.
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]
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.
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
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.
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>
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>
[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>