Hans Verkuil [Wed, 11 Dec 2019 16:22:25 +0000 (17:22 +0100)]
media: pulse8-cec: add 2nd debug level
Use debug level 2 to show the low-level Pulse-Eight commands.
Also show the message to transmit on debug level 1 and add a
debug log to show where the transmit failed.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Wed, 11 Dec 2019 16:22:24 +0000 (17:22 +0100)]
media: pulse8-cec: locking improvements
Drop the write_lock, rename config_lock to plain lock since this
now locks access to the adapter. Use 'lock' when transmitting
a message, ensuring that nothing interferes with the transmit.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Wed, 11 Dec 2019 16:22:23 +0000 (17:22 +0100)]
media: pulse8-cec: reorganize function order
Reorganize the order of the functions in the source, going from
low-level to high-level.
No functional changes were made.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Wed, 11 Dec 2019 16:22:22 +0000 (17:22 +0100)]
media: pulse8-cec: improve debugging
Add and use pulse8_msgname() to show the message codes as a
human readable text instead of a number.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Nathan Chancellor [Sun, 8 Dec 2019 21:11:40 +0000 (22:11 +0100)]
media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros
When building with Clang + -Wtautological-constant-compare, several of
the ivtv and cx18 drivers warn along the lines of:
drivers/media/pci/cx18/cx18-driver.c:1005:21: warning: converting the
result of '<<' to a boolean always evaluates to true
[-Wtautological-constant-compare]
cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL,
^
drivers/media/pci/cx18/cx18-cards.h:18:37: note: expanded from macro
'CX18_HW_GPIO_RESET_CTRL'
#define CX18_HW_GPIO_RESET_CTRL (1 << 6)
^
1 warning generated.
This warning happens because the shift operation is implicitly converted
to a boolean in v4l2_device_mask_call_all before being negated. This can
be solved by just comparing the mask result to 0 explicitly so that
there is no boolean conversion. The ultimate goal is to enable
-Wtautological-compare globally because there are several subwarnings
that would be helpful to have.
For visual consistency and avoidance of these warnings in the future,
all of the implicitly boolean conversions in the v4l2_device macros
are converted to explicit ones as well.
Link: https://github.com/ClangBuiltLinux/linux/issues/752
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Ezequiel Garcia [Thu, 5 Dec 2019 14:24:43 +0000 (15:24 +0100)]
media: hantro: Support color conversion via post-processing
The Hantro G1 decoder is able to enable a post-processor
on the decoding pipeline, which can be used to perform
scaling and color conversion.
The post-processor is integrated to the decoder, and it's
possible to use it in a way that is completely transparent
to the user.
This commit enables color conversion via post-processing,
which means the driver now exposes YUV packed, in addition to NV12.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Ezequiel Garcia [Thu, 5 Dec 2019 14:24:42 +0000 (15:24 +0100)]
media: hantro: Rename {prepare,finish}_run to {start,end}_prepare_run
hantro_prepare_run() and hantro_finish_run() are
slightly misleading, so let's rename it to something
a bit more clear.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Ezequiel Garcia [Thu, 5 Dec 2019 14:24:41 +0000 (15:24 +0100)]
media: hantro: Cleanup format negotiation helpers
Format negotiation helpers, hantro_find_format()
and hantro_get_default_fmt() can be simplified,
making the code a little bit clearer.
More importantly, this change is preparation work
for the post-processor usage.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Ezequiel Garcia [Thu, 5 Dec 2019 14:24:40 +0000 (15:24 +0100)]
media: vidioc-enum-fmt.rst: clarify format preference
It has been decided to use the ENUM_FMT index value
as a hint for driver preference. This is defined purposedly
in a very liberal way, letting drivers define what "preference"
means.
For instance, the Hantro VPU driver indicates additional
processing to output a given format, and thus implicates
more CPU usage, which is enumerated after native (non-processed)
formats.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dragos Bogdan [Fri, 18 Oct 2019 11:29:55 +0000 (13:29 +0200)]
media: adv7604: extend deep color mode to ADV7611
The AD7611 chip supports the same Deep Color Mode settings as the AD7604.
This change extends support for this feature to the AD7611 by adding a
wrapper function for the `read_hdmi_pixelclock` hook and adding the same
frequency adjustment logic.
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Guilherme Alcarde Gallo [Sun, 10 Nov 2019 18:33:21 +0000 (19:33 +0100)]
media: vimc: Implement get/set selection in sink
Add support for the sink pad of scaler subdevice to respond
VIDIOC_G_SELECTION and VIDIOC_S_SELECTION ioctls with the following
targets: V4L2_SEL_TGT_COMPOSE_BOUNDS and V4L2_SEL_TGT_CROP.
* Add new const struct crop_rect_default to initialize subdev scaler
properly.
* Make changes in sink pad format reflect to the crop rectangle. E.g.
changing the frame format to a smaller size one can make the former
crop rectangle selects a non existing frame area. To solve this
situation the crop rectangle is clamped to the frame boundaries.
* Clamp crop rectangle respecting the sink bounds during set_selection
ioctl.
Co-developed-by: Danilo Figueiredo Rocha <drocha.figueiredo@gmail.com>
Signed-off-by: Guilherme Alcarde Gallo <gagallo7@gmail.com>
Signed-off-by: Danilo Figueiredo Rocha <drocha.figueiredo@gmail.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Tue, 19 Nov 2019 10:51:16 +0000 (11:51 +0100)]
media: pixfmt-tch-td16/tu16.rst: document that this is little endian
Testing with the rmi_f54 driver on the Lenovo X1 Carbon 6th gen
laptop showed that the data is in little endian format. Update
the documentation accordingly.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Rui Miguel Silva [Thu, 12 Dec 2019 19:17:14 +0000 (20:17 +0100)]
media: imx7-mipi-csis: remove subdev_notifier
It was defined a notifier in the csi_state structure that is never
allocated. And besides that it's unregister in the remove, even though
it is a no-op, just remove both.
Fixes:
7807063b862b ("media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7")
Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wei Yongjun [Wed, 6 Nov 2019 15:32:12 +0000 (16:32 +0100)]
media: sun8i: Remove redundant dev_err call in deinterlace_probe()
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hirokazu Honda [Thu, 7 Nov 2019 03:30:57 +0000 (04:30 +0100)]
media: mtk-vcodec: Remove extra area allocation in an input buffer on encoding
MediaTek encoder allocates non pixel data area for an input buffer every
plane. As the input buffer should be read-only, the driver should not write
anything in the buffer. Therefore, the extra data should be unnecessary.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Niklas Söderlund [Fri, 8 Nov 2019 02:16:08 +0000 (03:16 +0100)]
media: dt-bindings: rcar-vin: Document compatibility string for R8A77470
When adding the compatibility string for R8A77470 (RZ/G1C) to the
rcar-vin driver the string was never documented in the bindings, add it
now.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Niklas Söderlund [Fri, 8 Nov 2019 02:16:07 +0000 (03:16 +0100)]
media: dt-bindings: rcar-vin: Remove paragraph about aliases
It might be convenient to have aliases but it's not required, drop the
sentence as it's not true and not used in Gen3 DTS files.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Fri, 29 Nov 2019 14:10:43 +0000 (15:10 +0100)]
media: atmel: atmel-isi: initialize the try_crop for the pads in try_fmt
When requesting format from sensor, some sensors call the
subdev_get_try_crop which for ISI was not properly initialized, and this
causes errors in determining proper image resolutions.
To accommodate for this, when trying a format (in try_fmt), first attempt
to obtain the framesize for this format from sensor.
In case this fails, use the maximum ISI width/height as try_crop, otherwise
provide the first size height/width from the sensor.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Fri, 29 Nov 2019 14:10:42 +0000 (15:10 +0100)]
media: atmel: atmel-isi: properly initialize pad_cfg
In try_fmt, properly initialize the pad_cfg variable to zeros.
This can be used by various calls from the subdev, so it's better
to have it initialized.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
[hverkuil-cisco@xs4all.nl: changed {0} to {}]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Fri, 29 Nov 2019 14:10:38 +0000 (15:10 +0100)]
media: atmel: atmel-isi: add support for mono sensors, GRAY and Y16
This adds support for GREY and Y16 formats, based on Y10 mbus codes.
Y16 needs to go through preview path in the ISI, with 2 pixels per word,
and it fits the Y16 format. The ISI data lines need to be MSB aligned with
the sensor data lines.
GREY format in 8 bits per pixel is done by dropping the 2 LSB bits
from the Y10 format, and packed as 4 pixels per word.
Suggested-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Mon, 25 Nov 2019 08:32:54 +0000 (09:32 +0100)]
media: atmel: atmel-isc-base: initialize the try_crop for the pads in try_fmt
When requesting format from sensor, some sensors call the
subdev_get_try_crop which for ISC was not properly initialized, and this
causes errors in determining proper image resolutions.
To accommodate for this, when trying a format (in try_fmt), first attempt
to obtain the framesize for this format from sensor.
In case this fails, use the maximum ISC width/height as try_crop, otherwise
provide the first size height/width from the sensor.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
[hverkuil-cisco@xs4all.nl: changed {0} to {}]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Mon, 25 Nov 2019 08:32:53 +0000 (09:32 +0100)]
media: atmel: atmel-isc-base: fix enum calls default format
With some sensors, the mbus code must match the one that sensor supports.
In this case we should initialize the mbus_code of the fse/fie before
calling the subdev, and not after.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Mon, 25 Nov 2019 08:32:51 +0000 (09:32 +0100)]
media: atmel: atmel-isc-base: properly initialize pad_cfg
In try_fmt, properly initialize the pad_cfg variable to zeros.
This can be used by various calls from the subdev, so it's better
to have it initialized.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
[hverkuil-cisco@xs4all.nl: changed {0} to {}]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Mon, 25 Nov 2019 08:32:49 +0000 (09:32 +0100)]
media: atmel: atmel-isc-base: add support for Y10 format
The ISC can receive input from sensors using Y10 format directly
(10 bits greyscale). In this case, the ISC must dump the data directly,
either as GREY (8bit) or Y10 (10bit).
Y16 is not supported because we cannot align the MSB 10 bits to the MSB
inside the 16bit container.
For this format, the ISC internal pipeline cannot work (only works with
BAYER), so we must dump the data directly as 8bit/10bit.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Eugen Hristev [Mon, 25 Nov 2019 08:32:48 +0000 (09:32 +0100)]
media: atmel: atmel-isc-base: allow 8 bit direct dump
In case the format that the sensor sends is 8 bit only (like GREY for
example) we need to be able to bypass ISC pipeline and directly dump
8 bits.
That's why the hardcoded value of 16 bpp is not correct in all cases.
This change allows the output format to decide what is the correct bpp
(bits per pixel) such that the result is in the proper format.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Neil Armstrong [Thu, 21 Nov 2019 10:14:28 +0000 (11:14 +0100)]
media: meson: vdec: add sm1 platform
Add support for the Amlogic SM1 platform for the current MPEG1 & MPEG2
support.
The SM1 family, very close to the G12A SoCs, has a slighly different power
management control, thus needing a separate compatible and family id.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Neil Armstrong [Thu, 21 Nov 2019 10:14:27 +0000 (11:14 +0100)]
media: dt-bindings: media: amlogic,gx-vdec: add bindings for SM1 family
Add bindings to support the Amlogic Video Decoder on the Amlogic
SM1 family.
SM1 has a slightly different power management handling, thus needing a
separate compatible.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Maxime Jourdan [Thu, 5 Dec 2019 15:34:07 +0000 (16:34 +0100)]
media: meson: vdec: add g12a platform
Add support for the G12A platform by:
- adding the G12A codec support, here MPEG1 & MPEG2
- getting the new hevcf clock for the upcoming HEVC/VP9 decoding support
Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Neil Armstrong [Thu, 5 Dec 2019 15:34:06 +0000 (16:34 +0100)]
media: dt-bindings: media: amlogic,gx-vdec: add bindings for G12A family
Add bindings to support the Amlogic Video Decoder on the Amlogic G12A
family.
For the G12A family, a supplementary clock is needed to operate the
HEVC/VP9 decoder.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Neil Armstrong [Thu, 5 Dec 2019 15:34:05 +0000 (16:34 +0100)]
media: dt-bindings: media: amlogic,vdec: convert to yaml
Now that we have the DT validation in place, let's convert the device tree
bindings for the Amlogic Video Controller over to YAML schemas.
This yaml bindings will then be extended to support new SoCs.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Philipp Zabel [Thu, 12 Dec 2019 14:23:27 +0000 (15:23 +0100)]
media: coda: avoid hardware lockups with more than 13 capture buffers
When decoding using the CODA internal rotator (for example NV12
capture), currently the value vb2_buf.index + CODA_MAX_FRAMEBUFFERS (19)
is written into the DEC_PIC_ROT_INDEX register. At least with firmware
version 3.1.1 this causes CODA hangups as soon as the register value
reaches 32. Instead, always write CODA_MAX_FRAMEBUFFERS.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Philipp Zabel [Thu, 12 Dec 2019 14:20:25 +0000 (15:20 +0100)]
media: coda: remove redundant platform_get_irq error message
Both platform_get_irq_byname() and platform_get_irq() already print an
error. Remove the redundant error message.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Philipp Zabel [Thu, 12 Dec 2019 14:02:55 +0000 (15:02 +0100)]
media: coda: jpeg: add CODA960 JPEG encoder support
This patch adds JPEG encoding support for CODA960, handling the JPEG
hardware directly. A separate JPEG encoder video device is created due
to the separate hardware unit and different supported pixel formats.
While the hardware can not change subsampling on the fly, it can encode
4:2:2 subsampled images into JPEGs of the same subsampling.
There are two additional tracepoints added to the coda driver that can
be used together with the v4l2:v4l2_qbuf and v4l2:v4l2_dqbuf tracepoints
to to follow video frames through the mem2mem device when encoding or
decoding with the CODA960 JPEG codec:
coda:coda_jpeg_run
coda:coda_jpeg_done
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Richard Leitner <richard.leitner@skidata.com>
[hverkuil-cisco@xs4all.nl: removed unused k and q_data_dst variables]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Philipp Zabel [Thu, 12 Dec 2019 14:02:54 +0000 (15:02 +0100)]
media: coda: jpeg: add JPEG register definitions for CODA960
The CODA960 JPEG codec is controlled directly from the host, there is no
support in the BIT processor firmware. This patch adds the necessary
register definitions.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Philipp Zabel [Thu, 12 Dec 2019 14:02:53 +0000 (15:02 +0100)]
media: coda: jpeg: merge Huffman table bits and values
The Huffman bits tables are always 16 bytes long, and they are always
followed directly by the values tables, both in hardware and in JPEG
files. Just merge the two tables.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Philipp Zabel [Thu, 12 Dec 2019 14:02:52 +0000 (15:02 +0100)]
media: coda: do not skip finish_run if aborting
Always call finish_run when the hardware signals completion. This
will allow JPEG contexts to clean up even if job_abort was called
during the device_run.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:49 +0000 (14:58 +0100)]
media: Drop superfluous ioctl PCM ops
PCM core deals the empty ioctl field now as default.
Let's kill the redundant lines.
Cc: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
Cc: Anton Sviridenko <anton@corp.bluecherry.net>
Cc: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Cc: Ismael Luceno <ismael@iodev.co.uk>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:48 +0000 (14:58 +0100)]
media: ivtv: Drop superfluous ioctl PCM ops
snd_ivtv_pcm_ioctl() does nothing but calling the default handler.
Now PCM core accepts NULL as the default ioctl ops, so let's drop
altogether.
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:47 +0000 (14:58 +0100)]
media: cx18: Drop superfluous ioctl PCM ops
snd_cx18_pcm_ioctl() does nothing but calling the default handler.
Now PCM core accepts NULL as the default ioctl ops, so let's drop
altogether.
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:46 +0000 (14:58 +0100)]
media: cobalt: Drop superfluous ioctl PCM ops
snd_cobalt_pcm_ioctl() does nothing but calling the default handler.
Now PCM core accepts NULL as the default ioctl ops, so let's drop
altogether.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:45 +0000 (14:58 +0100)]
media: tm6000: Clean up ALSA PCM API usages
With the recent change in ALSA PCM core, the whole open-coded vmalloc
buffer handling in this driver can be dropped by replacing with the
managed buffer allocation.
Also, snd_tm6000_capture_free() is dropped since the check of
stream_started flag makes no sense; hw_free callback is guaranteed to
be called after the stream gets stopped.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:44 +0000 (14:58 +0100)]
media: go7007: Clean up ALSA PCM API usages
With the recent change in ALSA PCM core, the whole open-coded vmalloc
buffer handling in this driver can be dropped by replacing with the
managed buffer allocation.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:43 +0000 (14:58 +0100)]
media: em28xx: Clean up ALSA PCM API usages
With the recent change in ALSA PCM core, the whole open-coded vmalloc
buffer handling in this driver can be dropped by replacing with the
managed buffer allocation.
Also, snd_em28xx_hw_capture_free() is dropped since the check of
stream_started flag makes no sense; hw_free callback is guaranteed to
be called after the stream gets stopped.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:42 +0000 (14:58 +0100)]
media: cs231xx: Clean up ALSA PCM API usages
With the recent change in ALSA PCM core, the whole open-coded vmalloc
buffer handling in this driver can be dropped by replacing with the
managed buffer allocation.
Also, snd_cx231xx_hw_capture_free() is dropped since the check of
stream_started flag makes no sense; hw_free callback is guaranteed to
be called after the stream gets stopped.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:41 +0000 (14:58 +0100)]
media: ivtv: Clean up ALSA PCM API usages
With the recent change in ALSA PCM core, the whole open-coded vmalloc
buffer handling in this driver can be dropped by replacing with the
managed buffer allocation.
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:40 +0000 (14:58 +0100)]
media: cx18: Clean up ALSA PCM API usages
With the recent change in ALSA PCM core, the whole open-coded vmalloc
buffer handling in this driver can be dropped by replacing with the
managed buffer allocation.
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:39 +0000 (14:58 +0100)]
media: cobalt: Clean up ALSA PCM API usages
With the recent change in ALSA PCM core, the whole open-coded vmalloc
buffer handling in this driver can be dropped by replacing with the
managed buffer allocation.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:38 +0000 (14:58 +0100)]
media: usbtv: Use managed buffer allocation
Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and dropped.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:37 +0000 (14:58 +0100)]
media: tw686x: Use managed buffer allocation
Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and dropped.
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Takashi Iwai [Tue, 10 Dec 2019 13:58:36 +0000 (14:58 +0100)]
media: solo6x10: Use managed buffer allocation
Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and dropped.
Cc: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
Cc: Anton Sviridenko <anton@corp.bluecherry.net>
Cc: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Cc: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Chuhong Yuan [Tue, 10 Dec 2019 03:15:48 +0000 (04:15 +0100)]
media: go7007: fix a miss of snd_card_free
go7007_snd_init() misses a snd_card_free() in an error path.
Add the missed call to fix it.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Fri, 6 Dec 2019 19:51:32 +0000 (20:51 +0100)]
media: ti-vpe: csc: fix single vs multiplanar format handling
In csc_set_coeff() we were previously checking if the format type was
V4L2_BUF_TYPE_VIDEO_OUTPUT or V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE as a
mean to figure out if the format was multiplanar or not. This was not
entirely accurate as the format type could also be a CAPTURE type
instead.
Fix this by removing the 'switch' construct and replacing them with
"if (V4L2_TYPE_IS_MULTIPLANAR(type))" instead.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Thu, 5 Dec 2019 15:07:39 +0000 (16:07 +0100)]
media: cec-ioc-g-mode.rst: remove trailing 'i'
Remove spurious trailing 'i'.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Colin Ian King [Wed, 4 Dec 2019 14:11:59 +0000 (15:11 +0100)]
media: meson: add missing allocation failure check on new_buf
Currently if the allocation of new_buf fails then a null pointer
dereference occurs when assiging new_buf->vb. Avoid this by returning
early on a memory allocation failure as there is not much more can
be done at this point.
Addresses-Coverity: ("Dereference null return")
Fixes:
3e7f51bd9607 ("media: meson: add v4l2 m2m video decoder driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Wed, 4 Dec 2019 11:57:10 +0000 (12:57 +0100)]
media: ivtv/cx18: remove ivtvdriver.org references
That URL is no longer valid, so either remove references to it or
replace it with linuxtv.org.
Rather than updating the URL I've just dropped the cx18.rst driver
documentation since it was really out of date.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: awalls@md.metrocast.net
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel Gomez [Tue, 3 Dec 2019 15:12:00 +0000 (16:12 +0100)]
media: v4l2: Fix fourcc names for BAYER12P
Fix documentation fourcc names for the 12-bit packed Bayer formats.
Signed-off-by: Daniel Gomez <daniel@qtec.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Chuhong Yuan [Tue, 3 Dec 2019 11:13:24 +0000 (12:13 +0100)]
media: pxa_camera: add missed tasklet_kill
This driver forgets to kill tasklet when probe fails and remove.
Add the calls to fix it.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Mon, 2 Dec 2019 11:46:17 +0000 (12:46 +0100)]
media: vidioc-g-dv-timings.rst: fix wrong porch
It is the vfrontporch of field 1 that is one half-line longer,
not the backporch.
The order of the vertical signals in an interlaced system is:
Field 1:
vsync
vbackporch
active video of field 1
vfrontporch + 0.5
Field 2:
il_vsync
il_vbackporch - 0.5
active video of field 2
il_vfrontporch
Interlaced systems that use HALF_LINE set the il_ fields as follows:
il_vfrontporch = vfrontporch
il_vsync = vsync
il_vbackporch = vbackporch + 1
So the total vertical blanking for field 1 is:
vsync + vbackporch + vfrontporch + 0.5
and for field 2:
vsync + vbackporch + 1 + vfrontporch - 0.5 ==
vsync + vbackporch + vfrontporch + 0.5
So each field has the same number of half-lines.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Vandana BN [Tue, 26 Nov 2019 14:16:50 +0000 (15:16 +0100)]
media: vivid: Add touch support
Support to emulate touch devices in vivid driver.
It generates touch patterns simulating single tap, double tap, triple
tap, move from left to right, zoom in, zoom out, palm press simulating
large area being pressed on screen, and simulating 16 different
simultaneous touch points.The values generated are based on
behavior of the rmi_f54 driver.
Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Chuhong Yuan [Mon, 18 Nov 2019 11:40:41 +0000 (12:40 +0100)]
media: usb: go7007: s2250-board: add missed i2c_unregister_device
The driver forgets to call i2c_unregister_device in remove like what is
done in probe failure.
Add the missed call to fix it.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Forest Crossman [Sat, 16 Nov 2019 22:38:40 +0000 (23:38 +0100)]
media: cx23885: Add support for AVerMedia CE310B
The AVerMedia CE310B is a simple composite + S-Video + stereo audio
capture card, and uses only the CX23888 to perform all of these
functions.
I've tested both video inputs and the audio interface and confirmed that
they're all working. However, there are some issues:
* Sometimes when I switch inputs the video signal turns black and can't
be recovered until the system is rebooted. I haven't been able to
determine the cause of this behavior, nor have I found a solution to
fix it or any workarounds other than rebooting.
* The card sometimes seems to have trouble syncing to the video signal,
and some of the VBI data appears as noise at the top of the frame, but
I assume that to be a result of my very noisy RF environment and the
card's unshielded input traces rather than a configuration issue.
Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Chuhong Yuan [Wed, 13 Nov 2019 06:37:59 +0000 (07:37 +0100)]
media: platform: mtk-mdp: add missed destroy_workqueue in remove
The driver misses destroying wdt_wq when remove like what is done when
probe fails.
Add the missed calls like what is done to job_wq to fix it.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Chuhong Yuan [Wed, 13 Nov 2019 06:37:30 +0000 (07:37 +0100)]
media: bdisp: add missed destroy_workqueue in remove and probe failure
The driver forgets to call destroy_workqueue when remove and probe fails.
Add the missed calls to fix it.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Tue, 12 Nov 2019 09:22:28 +0000 (10:22 +0100)]
media: dvb-usb/dvb-usb-urb.c: initialize actlen to 0
This fixes a syzbot failure since actlen could be uninitialized,
but it was still used.
Syzbot link:
https://syzkaller.appspot.com/bug?extid=
6bf9606ee955b646c0e1
Reported-and-tested-by: syzbot+6bf9606ee955b646c0e1@syzkaller.appspotmail.com
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Tue, 12 Nov 2019 09:22:24 +0000 (10:22 +0100)]
media: gspca: zero usb_buf
Allocate gspca_dev->usb_buf with kzalloc instead of kmalloc to
ensure it is property zeroed. This fixes various syzbot errors
about uninitialized data.
Syzbot links:
https://syzkaller.appspot.com/bug?extid=
32310fc2aea76898d074
https://syzkaller.appspot.com/bug?extid=
99706d6390be1ac542a2
https://syzkaller.appspot.com/bug?extid=
64437af5c781a7f0e08e
Reported-and-tested-by: syzbot+32310fc2aea76898d074@syzkaller.appspotmail.com
Reported-and-tested-by: syzbot+99706d6390be1ac542a2@syzkaller.appspotmail.com
Reported-and-tested-by: syzbot+64437af5c781a7f0e08e@syzkaller.appspotmail.com
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wolfram Sang [Sun, 10 Nov 2019 14:36:07 +0000 (15:36 +0100)]
media: v4l2-subdev: remove wrong @cond from kdocs
v4l2_subdev_call() is unconditional, so don't mention in the docs a
@cond parameter which does not exist.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Gustavo A. R. Silva [Tue, 22 Oct 2019 13:25:22 +0000 (15:25 +0200)]
media: i2c: adv748x: Fix unsafe macros
Enclose multiple macro parameters in parentheses in order to
make such macros safer and fix the Clang warning below:
drivers/media/i2c/adv748x/adv748x-afe.c:452:12: warning: operator '?:'
has lower precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-parentheses]
ret = sdp_clrset(state, ADV748X_SDP_FRP, ADV748X_SDP_FRP_MASK, enable
? ctrl->val - 1 : 0);
Fixes:
3e89586a64df ("media: i2c: adv748x: add adv748x driver")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Sat, 7 Dec 2019 22:43:23 +0000 (23:43 +0100)]
media: pulse8-cec: fix lost cec_transmit_attempt_done() call
The periodic PING command could interfere with the result of
a CEC transmit, causing a lost cec_transmit_attempt_done()
call.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: <stable@vger.kernel.org> # for v4.10 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Wed, 11 Dec 2019 11:47:57 +0000 (12:47 +0100)]
media: cec: check 'transmit_in_progress', not 'transmitting'
Currently wait_event_interruptible_timeout is called in cec_thread_func()
when adap->transmitting is set. But if the adapter is unconfigured
while transmitting, then adap->transmitting is set to NULL. But the
hardware is still actually transmitting the message, and that's
indicated by adap->transmit_in_progress and we should wait until that
is finished or times out before transmitting new messages.
As the original commit says: adap->transmitting is the userspace view,
adap->transmit_in_progress reflects the hardware state.
However, if adap->transmitting is NULL and adap->transmit_in_progress
is true, then wait_event_interruptible is called (no timeout), which
can get stuck indefinitely if the CEC driver is flaky and never marks
the transmit-in-progress as 'done'.
So test against transmit_in_progress when deciding whether to use
the timeout variant or not, instead of testing against adap->transmitting.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes:
32804fcb612b ("media: cec: keep track of outstanding transmits")
Cc: <stable@vger.kernel.org> # for v4.19 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Sat, 7 Dec 2019 22:48:09 +0000 (23:48 +0100)]
media: cec: avoid decrementing transmit_queue_sz if it is 0
WARN if transmit_queue_sz is 0 but do not decrement it.
The CEC adapter will become unresponsive if it goes below
0 since then it thinks there are 4 billion messages in the
queue.
Obviously this should not happen, but a driver bug could
cause this.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: <stable@vger.kernel.org> # for v4.12 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Wed, 4 Dec 2019 07:52:08 +0000 (08:52 +0100)]
media: cec: CEC 2.0-only bcast messages were ignored
Some messages are allowed to be a broadcast message in CEC 2.0
only, and should be ignored by CEC 1.4 devices.
Unfortunately, the check was wrong, causing such messages to be
marked as invalid under CEC 2.0.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: <stable@vger.kernel.org> # for v4.10 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:47 +0000 (15:53 +0100)]
media: dt-bindings: media: cal: convert binding to yaml
Convert ti-cal.txt to ti,cal.yaml.
Add ti,cal.yaml to the MAINTAINERS file.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:46 +0000 (15:53 +0100)]
media: ti-vpe: cal: fix enum_mbus_code/frame_size subdev arguments
Make sure that both enum_mbus_code() and enum_framesize() properly
populate the .which parameter member, otherwise -EINVAL is return
causing the subdev asynchronous registration handshake to fail.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:45 +0000 (15:53 +0100)]
media: ti-vpe: cal: Fix a WARN issued when start streaming fails
When start_streaming fails after the buffers have been queued we have to
make sure all buffers are returned to user-space properly otherwise a
v4l2 level WARN is generated.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:44 +0000 (15:53 +0100)]
media: ti-vpe: cal: Properly calculate max resolution boundary
Currently we were using an arbitrarily small maximum resolution mostly
based on available sensor capabilities. However the hardware DMA limits
are much higher than the statically define maximum resolution we were
using.
There we rework the boundary check code to handle the maximum width and
height based on the maximum line width in bytes and re-calculating the
pixel width based on the given pixel format.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:43 +0000 (15:53 +0100)]
media: ti-vpe: cal: Add subdev s_power hooks
Because V4L2 still uses a specific way to manage power state of devices
that predates runtime PM, bridge driver should power on and off sub
device explicitly.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:42 +0000 (15:53 +0100)]
media: ti-vpe: cal: Add AM654 support
Add the needed control module register bit layout to support the AM654
family of devices.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:41 +0000 (15:53 +0100)]
media: dt-bindings: media: cal: update binding to add AM654 support
Update Device Tree bindings for the CAL driver to add AM654 support.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:40 +0000 (15:53 +0100)]
media: ti-vpe: cal: Add DRA76x support
Add the needed control module register bit layout to support
the DRA76x family of devices.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:39 +0000 (15:53 +0100)]
media: dt-bindings: media: cal: update binding to add DRA76x support
Update Device Tree bindings for the CAL driver to add DRA76x support.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:38 +0000 (15:53 +0100)]
media: ti-vpe: cal: Align DPHY init sequence with docs
The current CSI2 DPHY initialization sequence although
functional does not match with the documented sequence
in the Technical Reference Manual.
This may affect capture re-startability in stop/start
situations.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:37 +0000 (15:53 +0100)]
media: ti-vpe: cal: Fix pixel processing parameters
The pixel processing unit was hard coded to only handle 8 bits per pixel
from input to output.
We now add handling for 10, 12 and 16 bits per pixel at the source and
setting the in-memory size (i.e. container size) to 16 bits for these 3
cases.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:36 +0000 (15:53 +0100)]
media: ti-vpe: cal: Fix ths_term/ths_settle parameters
The current method to calculate the ddr clk period is wrong.
Therefore the ths_term calculation is incorrect.
Also it was wrongly assumed that the ths_settle parameter
was based on the control clock instead of the pixel clock.
Since the DPHY can tolerate quite a bit a of variation,
capture was still mostly working with the 2 tested modes
when the pixel clock was close to the control clock
(i.e. 96 Mhz). But it would quickly stops working when
using different modes or when customers used different
sensors altogether.
Calculating the DDRClk period needs to take into account
the pixel bit width and the number of active data lanes.
Based on the latest technical reference manual these
parameters should now be calculated as follows:
THS_TERM: Programmed value = floor(20 ns/DDRClk period)
THS_SETTLE: Programmed value = floor(105 ns/DDRClk period) + 4
Also originally 'depth' was used to represent the number of
bits a pixel would use once stored in memory (i.e. the
container size). To accurately calculate the THS_* parameters
we need to use the actual number of bits per pixels coming
in from the sensor. So we are renaming 'depth' to 'bpp' (bits
per pixels) and update the format table to show the actual
number of bits per pixel being received.
The "container" size will be derived from the "bpp" value.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:35 +0000 (15:53 +0100)]
media: ti-vpe: cal: add CSI2 PHY LDO errata support
Apply Errata i913 every time the functional clock is enabled.
This should take care of suspend/resume case as well.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:34 +0000 (15:53 +0100)]
media: dt-bindings: media: cal: update binding to add PHY LDO errata support
Update Device Tree bindings for the CAL driver to add support for
the CSI2 PHY LDO errata workaround for pre-es2 devices.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Nikhil Devshatwar [Tue, 12 Nov 2019 14:53:33 +0000 (15:53 +0100)]
media: ti-vpe: cal: Restrict DMA to avoid memory corruption
When setting DMA for video capture from CSI channel, if the DMA size
is not given, it ends up writing as much data as sent by the camera.
This may lead to overwriting the buffers causing memory corruption.
Observed green lines on the default framebuffer.
Restrict the DMA to maximum height as specified in the S_FMT ioctl.
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:32 +0000 (15:53 +0100)]
media: ti-vpe: cal: Enable DMABUF export
Allow CAL to be able to export DMA buffer.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:31 +0000 (15:53 +0100)]
media: ti-vpe: cal: Add per platform data support
First this patch adds a method to access the CTRL_CORE_CAMERRX_CONTROL
register to use the syscon mechanism. For backward compatibility we also
handle using the existing camerrx_control "reg" entry if a syscon node
is not found.
In addition the register bit layout for the CTRL_CORE_CAMERRX_CONTROL
changes depending on the device. In order to support this we need to use
a register access scheme based on data configuration instead of using
static macro.
In this case we make use of the regmap facility and create data set
based on the various device and phy available.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:30 +0000 (15:53 +0100)]
media: ti-vpe: cal: switch BIT_MASK to BIT
Looks like the preferred macro to define a single bit mask is BIT() and
not BIT_MASK().
Signed-off-by: Benoit Parrot <bparrot@ti.com>
[hverkuil-cisco@xs4all.nl: fix checkpatch warnings for CAL_HL_IRQ_MASK]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:29 +0000 (15:53 +0100)]
media: dt-bindings: media: cal: update binding example
Update binding example to show proper endpoint properties and linkage.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Benoit Parrot [Tue, 12 Nov 2019 14:53:28 +0000 (15:53 +0100)]
media: dt-bindings: media: cal: update binding to use syscon
Update Device Tree bindings for the CAL driver to use syscon to access
the phy config register instead of trying to map it directly.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Linus Torvalds [Sun, 8 Dec 2019 22:57:55 +0000 (14:57 -0800)]
Linux 5.5-rc1
Linus Torvalds [Sun, 8 Dec 2019 21:28:11 +0000 (13:28 -0800)]
Merge git://git./linux/kernel/git/netdev/net
Pull networking fixes from David Miller:
1) More jumbo frame fixes in r8169, from Heiner Kallweit.
2) Fix bpf build in minimal configuration, from Alexei Starovoitov.
3) Use after free in slcan driver, from Jouni Hogander.
4) Flower classifier port ranges don't work properly in the HW offload
case, from Yoshiki Komachi.
5) Use after free in hns3_nic_maybe_stop_tx(), from Yunsheng Lin.
6) Out of bounds access in mqprio_dump(), from Vladyslav Tarasiuk.
7) Fix flow dissection in dsa TX path, from Alexander Lobakin.
8) Stale syncookie timestampe fixes from Guillaume Nault.
[ Did an evil merge to silence a warning introduced by this pull - Linus ]
* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits)
r8169: fix rtl_hw_jumbo_disable for RTL8168evl
net_sched: validate TCA_KIND attribute in tc_chain_tmplt_add()
r8169: add missing RX enabling for WoL on RTL8125
vhost/vsock: accept only packets with the right dst_cid
net: phy: dp83867: fix hfs boot in rgmii mode
net: ethernet: ti: cpsw: fix extra rx interrupt
inet: protect against too small mtu values.
gre: refetch erspan header from skb->data after pskb_may_pull()
pppoe: remove redundant BUG_ON() check in pppoe_pernet
tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE()
tcp: tighten acceptance of ACKs not matching a child socket
tcp: fix rejected syncookies due to stale timestamps
lpc_eth: kernel BUG on remove
tcp: md5: fix potential overestimation of TCP option space
net: sched: allow indirect blocks to bind to clsact in TC
net: core: rename indirect block ingress cb function
net-sysfs: Call dev_hold always in netdev_queue_add_kobject
net: dsa: fix flow dissection on Tx path
net/tls: Fix return values to avoid ENOTSUPP
net: avoid an indirect call in ____sys_recvmsg()
...
Linus Torvalds [Sun, 8 Dec 2019 20:23:42 +0000 (12:23 -0800)]
Merge tag 'scsi-misc' of git://git./linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley:
"Eleven patches, all in drivers (no core changes) that are either minor
cleanups or small fixes.
They were late arriving, but still safe for -rc1"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: MAINTAINERS: Add the linux-scsi mailing list to the ISCSI entry
scsi: megaraid_sas: Make poll_aen_lock static
scsi: sd_zbc: Improve report zones error printout
scsi: qla2xxx: Fix qla2x00_request_irqs() for MSI
scsi: qla2xxx: unregister ports after GPN_FT failure
scsi: qla2xxx: fix rports not being mark as lost in sync fabric scan
scsi: pm80xx: Remove unused include of linux/version.h
scsi: pm80xx: fix logic to break out of loop when register value is 2 or 3
scsi: scsi_transport_sas: Fix memory leak when removing devices
scsi: lpfc: size cpu map by last cpu id set
scsi: ibmvscsi_tgt: Remove unneeded variable rc
Linus Torvalds [Sun, 8 Dec 2019 20:12:18 +0000 (12:12 -0800)]
Merge tag '5.5-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French:
"Nine cifs/smb3 fixes:
- one fix for stable (oops during oplock break)
- two timestamp fixes including important one for updating mtime at
close to avoid stale metadata caching issue on dirty files (also
improves perf by using SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB over the
wire)
- two fixes for "modefromsid" mount option for file create (now
allows mode bits to be set more atomically and accurately on create
by adding "sd_context" on create when modefromsid specified on
mount)
- two fixes for multichannel found in testing this week against
different servers
- two small cleanup patches"
* tag '5.5-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
smb3: improve check for when we send the security descriptor context on create
smb3: fix mode passed in on create for modetosid mount option
cifs: fix possible uninitialized access and race on iface_list
cifs: Fix lookup of SMB connections on multichannel
smb3: query attributes on file close
smb3: remove unused flag passed into close functions
cifs: remove redundant assignment to pointer pneg_ctxt
fs: cifs: Fix atime update check vs mtime
CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks
Linus Torvalds [Sun, 8 Dec 2019 19:08:28 +0000 (11:08 -0800)]
Merge branch 'work.misc' of git://git./linux/kernel/git/viro/vfs
Pull misc vfs cleanups from Al Viro:
"No common topic, just three cleanups".
* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
make __d_alloc() static
fs/namespace: add __user to open_tree and move_mount syscalls
fs/fnctl: fix missing __user in fcntl_rw_hint()
Linus Torvalds [Sun, 8 Dec 2019 02:38:17 +0000 (18:38 -0800)]
Merge tag 'ntb-5.5' of git://github.com/jonmason/ntb
Pull NTB update from Jon Mason:
"Just a simple patch to add a new Hygon Device ID to the AMD NTB device
driver"
* tag 'ntb-5.5' of git://github.com/jonmason/ntb:
NTB: Add Hygon Device ID
Linus Torvalds [Sun, 8 Dec 2019 02:33:01 +0000 (18:33 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input
Pull more input updates from Dmitry Torokhov:
- fixups for Synaptics RMI4 driver
- a quirk for Goodinx touchscreen on Teclast tablet
- a new keycode definition for activating privacy screen feature found
on a few "enterprise" laptops
- updates to snvs_pwrkey driver
- polling uinput device for writing (which is always allowed) now works
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers
Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflash
Input: goodix - add upside-down quirk for Teclast X89 tablet
Input: add privacy screen toggle keycode
Input: uinput - fix returning EPOLLOUT from uinput_poll
Input: snvs_pwrkey - remove gratuitous NULL initializers
Input: snvs_pwrkey - send key events for i.MX6 S, DL and Q
Linus Torvalds [Sun, 8 Dec 2019 01:07:18 +0000 (17:07 -0800)]
Merge tag 'iomap-5.5-merge-14' of git://git./fs/xfs/xfs-linux
Pull iomap fixes from Darrick Wong:
"Fix a race condition and a use-after-free error:
- Fix a UAF when reporting writeback errors
- Fix a race condition when handling page uptodate on fragmented file
with blocksize < pagesize"
* tag 'iomap-5.5-merge-14' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
iomap: stop using ioend after it's been freed in iomap_finish_ioend()
iomap: fix sub-page uptodate handling
Linus Torvalds [Sun, 8 Dec 2019 01:05:33 +0000 (17:05 -0800)]
Merge tag 'xfs-5.5-merge-17' of git://git./fs/xfs/xfs-linux
Pull xfs fixes from Darrick Wong:
"Fix a couple of resource management errors and a hang:
- fix a crash in the log setup code when log mounting fails
- fix a hang when allocating space on the realtime device
- fix a block leak when freeing space on the realtime device"
* tag 'xfs-5.5-merge-17' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: fix mount failure crash on invalid iclog memory access
xfs: don't check for AG deadlock for realtime files in bunmapi
xfs: fix realtime file data space leak