Re: [RFC PATCH 0/8] [media] Request API, take three

2018-01-30 Thread Hans Verkuil
On 01/30/2018 07:31 AM, Alexandre Courbot wrote: > Hi Hans, > > On Mon, Jan 29, 2018 at 8:21 PM, Hans Verkuil wrote: >> On 01/26/2018 07:02 AM, Alexandre Courbot wrote: >>> Howdy. Here is your bi-weekly request API redesign! ;) >>> >>> Again, this is a simple version that only implements the flow

Re: [linux-sunxi] Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.

2018-01-30 Thread Maxime Ripard
Hi Liviu, On Wed, Jan 31, 2018 at 03:08:08AM +, Liviu Dudau wrote: > On Fri, Jan 26, 2018 at 11:00:41AM +0800, Yong wrote: > > Hi Maxime, > > > > On Fri, 26 Jan 2018 09:46:58 +0800 > > Yong wrote: > > > > > Hi Maxime, > > > > > > Do you have any experience in solving this problem? > > > It

Re: [PATCH v6 4/6] media: i2c: Add TDA1997x HDMI receiver driver

2018-01-30 Thread Hans Verkuil
On 01/31/2018 05:51 AM, Tim Harvey wrote: > On Mon, Jan 29, 2018 at 4:00 AM, Hans Verkuil wrote: >> On 01/25/2018 05:15 PM, Tim Harvey wrote: > Hmm. This receiver supports multiple output formats, but you advertise only one. That looks wrong. If nothing else, you should be ab

Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.

2018-01-30 Thread Maxime Ripard
Hi Thierry, On Tue, Jan 30, 2018 at 11:01:50AM +0100, Thierry Reding wrote: > On Tue, Jan 30, 2018 at 10:59:16AM +0100, Thierry Reding wrote: > > On Tue, Jan 30, 2018 at 10:24:48AM +0100, Arnd Bergmann wrote: > > > On Tue, Jan 30, 2018 at 8:54 AM, Maxime Ripard > > > wrote: > > > > On Mon, Jan 29

Re: [PATCH v6 4/6] media: i2c: Add TDA1997x HDMI receiver driver

2018-01-30 Thread Tim Harvey
On Mon, Jan 29, 2018 at 4:00 AM, Hans Verkuil wrote: > On 01/25/2018 05:15 PM, Tim Harvey wrote: >>> >>> Hmm. This receiver supports multiple output formats, but you advertise only >>> one. >>> That looks wrong. If nothing else, you should be able to switch between RGB >>> and >>> YUV 4:4:4 sin

cron job: media_tree daily build: ERRORS

2018-01-30 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Wed Jan 31 05:00:21 CET 2018 media-tree git hash:a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a media_build git

[PATCH v7 0/6] TDA1997x HDMI video receiver

2018-01-30 Thread Tim Harvey
This is a v4l2 subdev driver supporting the TDA1997x HDMI video receiver. I've tested this on a Gateworks GW54xx/GW551x with an IMX6Q/IMX6DL which uses the TDA19971 with 16bits connected to the IMX6 CSI and single-lane I2S audio providing 2-channel audio. For this configuration I've tested both 1

[PATCH v7 1/6] v4l2-dv-timings: add v4l2_hdmi_colorimetry()

2018-01-30 Thread Tim Harvey
From: Hans Verkuil Add the v4l2_hdmi_colorimetry() function so we have a single function that determines the colorspace, YCbCr encoding, quantization range and transfer function from the InfoFrame data. Signed-off-by: Hans Verkuil Signed-off-by: Tim Harvey --- drivers/media/v4l2-core/v4l2-dv-

[PATCH v7 3/6] media: dt-bindings: Add bindings for TDA1997X

2018-01-30 Thread Tim Harvey
Acked-by: Rob Herring Acked-by: Sakari Ailus Signed-off-by: Tim Harvey --- v6: - replace copyright with SPDX tag - added Rob's ack v5: - added Sakari's ack v4: - move include/dt-bindings/media/tda1997x.h to bindings patch - clarify port node details v3: - fix typo v2: - add vendor pre

[PATCH v7 2/6] MAINTAINERS: add entry for NXP TDA1997x driver

2018-01-30 Thread Tim Harvey
Signed-off-by: Tim Harvey --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index aa71ab52f..502bc97 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13244,6 +13244,14 @@ T: git git://linuxtv.org/mkrufky/tuners.git S: Maintained F: d

[PATCH v7 4/6] media: i2c: Add TDA1997x HDMI receiver driver

2018-01-30 Thread Tim Harvey
Add support for the TDA1997x HDMI receivers. Cc: Hans Verkuil Signed-off-by: Tim Harvey --- v7: - fix interlaced mode - support no AVI infoframe (ie DVI) (Hans) - add support for multiple output formats (Hans) v6: - fix return on regulator enablei in tda1997x_set_power() - replace copyrigh

[PATCH v7 5/6] ARM: dts: imx: Add TDA19971 HDMI Receiver to GW54xx

2018-01-30 Thread Tim Harvey
The GW54xx has a front-panel microHDMI connector routed to a TDA19971 which is connected the the IPU CSI when using IMX6Q. Signed-off-by: Tim Harvey --- v5: - remove leading 0 from unit address - add newline between property list and child node v4: no changes v3: no changes v2: - add HDMI au

[PATCH v7 6/6] ARM: dts: imx: Add TDA19971 HDMI Receiver to GW551x

2018-01-30 Thread Tim Harvey
Signed-off-by: Tim Harvey --- v5: - add missing audmux config --- arch/arm/boot/dts/imx6qdl-gw551x.dtsi | 138 ++ 1 file changed, 138 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl-gw551x.dtsi b/arch/arm/boot/dts/imx6qdl-gw551x.dtsi index 30d4662..749548a

Re: [linux-sunxi] Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.

2018-01-30 Thread Chen-Yu Tsai
On Wed, Jan 31, 2018 at 11:08 AM, Liviu Dudau wrote: > On Fri, Jan 26, 2018 at 11:00:41AM +0800, Yong wrote: >> Hi Maxime, >> >> On Fri, 26 Jan 2018 09:46:58 +0800 >> Yong wrote: >> >> > Hi Maxime, >> > >> > Do you have any experience in solving this problem? >> > It seems the PHYS_OFFSET maybe u

Re: [linux-sunxi] Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.

2018-01-30 Thread Liviu Dudau
On Fri, Jan 26, 2018 at 11:00:41AM +0800, Yong wrote: > Hi Maxime, > > On Fri, 26 Jan 2018 09:46:58 +0800 > Yong wrote: > > > Hi Maxime, > > > > Do you have any experience in solving this problem? > > It seems the PHYS_OFFSET maybe undeclared when the ARCH is not arm. > > Got it. > Should I ad

Re: [PATCH 2/9] em28xx: Bulk transfer implementation fix

2018-01-30 Thread Brad Love
On 2018-01-05 08:20, Devin Heitmueller wrote: > Hi Brad, > > My documents indicate that Register 0x5D and 0x5E are read-only, and > populated based on the eeprom programming. > > On your device, what is the value of those registers prior to you changing > them? > > If you write to those registers

Re: [PATCH 2/9] em28xx: Bulk transfer implementation fix

2018-01-30 Thread Brad Love
On 2018-01-30 06:07, Mauro Carvalho Chehab wrote: > Em Thu, 4 Jan 2018 18:04:12 -0600 > Brad Love escreveu: > >> Set appropriate bulk/ISOC transfer multiplier on capture start. >> This sets ISOC transfer to 940 bytes (188 * 5) >> This sets bulk transfer to 48128 bytes (188 * 256) >> >> The above

[GIT PULL FOR v4.16] v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-01-30 Thread Hans Verkuil
The following changes since commit a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a: media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic (2018-01-30 07:40:41 -0500) are available in the Git repository at: git://linuxtv.org/hverkuil/media_tree.git compatcve for you to fetch changes up to 36

Re: [PATCH] v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-01-30 Thread Laurent Pinchart
Hi Hans, Thank you for the patch. On Tuesday, 30 January 2018 17:18:32 EET Hans Verkuil wrote: > If the device is of type VFL_TYPE_SUBDEV then vdev->ioctl_ops > is NULL so the 'if (!ops->vidioc_query_ext_ctrl)' check would fail. More than that, it would crash. > Add a test for !ops to the condi

[PATCH v5 0/6] IR support for A83T

2018-01-30 Thread Philipp Rossak
This patch series adds support for the sunxi A83T ir module and enhances the sunxi-ir driver. Right now the base clock frequency for the ir driver is a hard coded define and is set to 8 MHz. This works for the most common ir receivers. On the Sinovoip Bananapi M3 the ir receiver needs, a 3 MHz ba

[PATCH v5 2/6] media: dt: bindings: Update binding documentation for sunxi IR controller

2018-01-30 Thread Philipp Rossak
This patch updates documentation for Device-Tree bindings for sunxi IR controller and adds the new optional property for the base clock frequency. Signed-off-by: Philipp Rossak Acked-by: Maxime Ripard Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/media/sunxi-ir.txt | 3 +++ 1

[PATCH v5 1/6] media: rc: update sunxi-ir driver to get base clock frequency from devicetree

2018-01-30 Thread Philipp Rossak
This patch updates the sunxi-ir driver to set the base clock frequency from devicetree. This is necessary since there are different ir receivers on the market, that operate with different frequencies. So this value could be set if the attached ir receiver needs a different base clock frequency, th

[PATCH v5 3/6] arm: dts: sun8i: a83t: Add the cir pin for the A83T

2018-01-30 Thread Philipp Rossak
The CIR Pin of the A83T is located at PL12. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-a83t.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi index 7f4955a5fab7..f7f78a27e21d 100644 --- a/arch/arm/b

[PATCH v5 4/6] arm: dts: sun8i: a83t: Add support for the cir interface

2018-01-30 Thread Philipp Rossak
The cir interface is like on the H3 located at 0x01f02000 and is exactly the same. This patch adds support for the ir interface on the A83T. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sun8i-a83t.dtsi | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/su

[PATCH v5 5/6] arm: dts: sun8i: a83t: bananapi-m3: Enable IR controller

2018-01-30 Thread Philipp Rossak
The Bananapi M3 has an onboard IR receiver. This enables the onboard IR receiver subnode. Unlike the other IR receivers this one needs a base clock frequency of 300 Hz (3 MHz), to be able to work. Signed-off-by: Philipp Rossak Acked-by: Chen-Yu Tsai --- arch/arm/boot/dts/sun8i-a83t-bananapi

[PATCH v5 6/6] arm: dts: sun8i: h3-h5: ir register size should be the whole memory block

2018-01-30 Thread Philipp Rossak
The size of the register should be the size of the whole memory block, not just the registers, that are needed. Signed-off-by: Philipp Rossak --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/

Re: MT9M131 on I.MX6DL CSI color issue

2018-01-30 Thread Florian Boor
Hello all, On 22.01.2018 15:52, Florian Boor wrote: >> Have you ever tried to capture images in one of the RGB formats? > Not so far but I just tried. The JPEG compressor does not seem to like it but > I > can import the raw frame as ARGB into i.e. ImageJ and what I get is a RGB > image > with q

Re: [PATCH v4 1/2] media: dt-bindings: Add OF properties to ov7670

2018-01-30 Thread Rob Herring
On Wed, Jan 24, 2018 at 10:30:49AM +0100, Jacopo Mondi wrote: > Describe newly introduced OF properties for ov7670 image sensor. > The driver supports two standard properties to configure synchronism > signals polarities and one custom property already supported as > platform data options to suppre

Re: [PATCH] v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-01-30 Thread Sakari Ailus
On Tue, Jan 30, 2018 at 04:18:32PM +0100, Hans Verkuil wrote: > If the device is of type VFL_TYPE_SUBDEV then vdev->ioctl_ops > is NULL so the 'if (!ops->vidioc_query_ext_ctrl)' check would fail. > Add a test for !ops to the condition. > > All sub-devices that have controls will use the control fr

Re: [PATCH v5 2/2] v4l: cadence: Add Cadence MIPI-CSI2 RX driver

2018-01-30 Thread Simon Hatliff
On 30 Jan 2018, at 15:41, Maxime Ripard wrote: > > Since the lanes are not in use, I'm not sure we have to worry about > lanes collision. Simon, would it cause any trouble if we map to lanes > to the same physical lane? Yes IIRC it would cause trouble. Due to the internals of the design each l

Re: [PATCH v5 2/2] v4l: cadence: Add Cadence MIPI-CSI2 RX driver

2018-01-30 Thread Maxime Ripard
Hi Benoit, On Mon, Jan 29, 2018 at 01:10:36PM -0600, Benoit Parrot wrote: > > + reg = csi2rx->num_lanes << 8; > > + for (i = 0; i < csi2rx->num_lanes; i++) > > + reg |= CSI2RX_STATIC_CFG_DLANE_MAP(i, csi2rx->lanes[i]); > > + > > + for (i = csi2rx->num_lanes; i < csi2rx->max_lanes;

Re: [PATCH v2 2/2] v4l: cadence: Add Cadence MIPI-CSI2 TX driver

2018-01-30 Thread Maxime Ripard
Hi Benoit, On Mon, Jan 29, 2018 at 01:30:46PM -0600, Benoit Parrot wrote: > > +++ b/drivers/media/platform/cadence/cdns-csi2tx.c > > @@ -0,0 +1,586 @@ > > +/* > > + * Driver for Cadence MIPI-CSI2 TX Controller > > + * > > + * Copyright (C) 2017 Cadence Design Systems Inc. > > + * > > + * This prog

[PATCH] v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-01-30 Thread Hans Verkuil
If the device is of type VFL_TYPE_SUBDEV then vdev->ioctl_ops is NULL so the 'if (!ops->vidioc_query_ext_ctrl)' check would fail. Add a test for !ops to the condition. All sub-devices that have controls will use the control framework, so they do not have an equivalent to ops->vidioc_query_ext_ctrl

Re: [PATCHv2 00/13] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-01-30 Thread Laurent Pinchart
Hi Hans, Thank you for the patches. For patches 01/13 to 08/13 and 10/13 to 12/13, Reviewed-by: Laurent Pinchart On Tuesday, 30 January 2018 12:26:48 EET Hans Verkuil wrote: > From: Hans Verkuil > > This patch series fixes a number of bugs and culminates in the removal > of the set_fs(KERNEL

Re: [PATCHv2 12/13] v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-01-30 Thread Hans Verkuil
On 01/30/18 15:32, Laurent Pinchart wrote: > Hi Hans, > > Thank you for the patch. > > On Tuesday, 30 January 2018 12:27:00 EET Hans Verkuil wrote: >> From: Hans Verkuil >> >> Some ioctls need to copy back the result even if the ioctl returned >> an error. However, don't do this for the error co

Re: [PATCHv2 09/13] v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-01-30 Thread Laurent Pinchart
Hi Hans, Thank you for the patch. On Tuesday, 30 January 2018 12:26:57 EET Hans Verkuil wrote: > From: Hans Verkuil > > ctrl_is_pointer just hardcoded two known string controls, but that > caused problems when using e.g. custom controls that use a pointer > for the payload. > > Reimplement thi

Re: [PATCHv2 12/13] v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-01-30 Thread Laurent Pinchart
Hi Hans, Thank you for the patch. On Tuesday, 30 January 2018 12:27:00 EET Hans Verkuil wrote: > From: Hans Verkuil > > Some ioctls need to copy back the result even if the ioctl returned > an error. However, don't do this for the error code -ENOTTY. > It makes no sense in that cases. > > Sign

Re: [PATCHv2 10/13] v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-01-30 Thread Laurent Pinchart
Hi Hans, Thank you for the patch. On Tuesday, 30 January 2018 12:26:58 EET Hans Verkuil wrote: > From: Hans Verkuil > > put_v4l2_window32() didn't copy back the clip list to userspace. > Drivers can update the clip rectangles, so this should be done. > > Signed-off-by: Hans Verkuil > Cc:

Re: [PATCH v5 1/2] dt-bindings: media: Add Allwinner V3s Camera Sensor Interface (CSI)

2018-01-30 Thread Sakari Ailus
Hi Yong, On Thu, Jan 11, 2018 at 11:03:43AM +0800, Yong Deng wrote: > Add binding documentation for Allwinner V3s CSI. > > Signed-off-by: Yong Deng Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3 1/1] imx258: Fix sparse warnings

2018-01-30 Thread Sakari Ailus
Hi Andy, On Sat, Jan 27, 2018 at 04:24:39PM +, Yeh, Andy wrote: > Fix a few sparse warnings related to conversion between CPU and big endian. > Also simplify the code in the process. > > Signed-off-by: Sakari Ailus > Acked-by: Andy Yeh Thanks for the ack. There's no need to resend the pat

Re: [PATCH v1] media: ov13858: Avoid possible null first frame

2018-01-30 Thread Sakari Ailus
On Thu, Jan 25, 2018 at 05:36:44PM +, Rapolu, Chiranjeevi wrote: > Hi Sakari, > > >I'll apply this now, however I see that most of the registers in the > > four modes are the same. In the future it'd be good to separate the > > parts that are common in all of them (to be written in sensor powe

Re: [PATCH 2/9] em28xx: Bulk transfer implementation fix

2018-01-30 Thread Mauro Carvalho Chehab
Em Thu, 4 Jan 2018 18:04:12 -0600 Brad Love escreveu: > Set appropriate bulk/ISOC transfer multiplier on capture start. > This sets ISOC transfer to 940 bytes (188 * 5) > This sets bulk transfer to 48128 bytes (188 * 256) > > The above values are maximum allowed according to Empia. > > Signed-

[GIT PULL FOR v4.16] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-01-30 Thread Hans Verkuil
This patch series fixes a number of bugs and culminates in the removal of the set_fs(KERNEL_DS) call in v4l2-compat-ioctl32.c. See http://people.canonical.com/~ubuntu-security/cve/2017/CVE-2017-13166.html for why this set_fs call is a bad idea. In order to test this I used vivid and a 32-bit v4l2

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : On 01/30/18 12:43, Gustavo A. R. Silva wrote: Quoting Hans Verkuil : [...] What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. Well, in this case the operator precedence takes place

Re: [PATCHv2 13/13] v4l2-compat-ioctl32.c: refactor, fix security bug in compat ioctl32

2018-01-30 Thread Hans Verkuil
On 01/30/18 12:46, Sakari Ailus wrote: > Hi Hans, > > Thanks for the update. Please see a few additional comments below. > > On Tue, Jan 30, 2018 at 11:27:01AM +0100, Hans Verkuil wrote: > ... >> @@ -891,30 +1057,53 @@ static long do_video_ioctl(struct file *file, >> unsigned int cmd, unsigned l

Re: [PATCHv2 09/13] v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-01-30 Thread Sakari Ailus
On Tue, Jan 30, 2018 at 11:26:57AM +0100, Hans Verkuil wrote: > From: Hans Verkuil > > ctrl_is_pointer just hardcoded two known string controls, but that > caused problems when using e.g. custom controls that use a pointer > for the payload. > > Reimplement this function: it now finds the v4l2_c

Re: [PATCHv2 03/13] v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-01-30 Thread Sakari Ailus
On Tue, Jan 30, 2018 at 11:26:51AM +0100, Hans Verkuil wrote: > From: Hans Verkuil > > If the ioctl returned -ENOTTY, then don't bother copying > back the result as there is no point. > > Signed-off-by: Hans Verkuil > Cc: # for v4.15 and up Acked-by: Sakari Ailus > --- > drivers/media

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Hans Verkuil
On 01/30/18 12:43, Gustavo A. R. Silva wrote: > > Quoting Hans Verkuil : > > [...] > What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. >>> >>> Well, in this case the operator precedence t

Re: [PATCHv2 10/13] v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-01-30 Thread Sakari Ailus
On Tue, Jan 30, 2018 at 11:26:58AM +0100, Hans Verkuil wrote: > From: Hans Verkuil > > put_v4l2_window32() didn't copy back the clip list to userspace. > Drivers can update the clip rectangles, so this should be done. > > Signed-off-by: Hans Verkuil > Cc: # for v4.15 and up Acked-by: Sak

Re: [PATCHv2 13/13] v4l2-compat-ioctl32.c: refactor, fix security bug in compat ioctl32

2018-01-30 Thread Sakari Ailus
Hi Hans, Thanks for the update. Please see a few additional comments below. On Tue, Jan 30, 2018 at 11:27:01AM +0100, Hans Verkuil wrote: ... > @@ -891,30 +1057,53 @@ static long do_video_ioctl(struct file *file, unsigned > int cmd, unsigned long ar > case VIDIOC_STREAMOFF: > case VI

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : [...] What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. Well, in this case the operator precedence takes place and the expression len * 10 * CEC_TIM_DATA_BIT_TOTAL is computed first.

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : On 01/30/2018 09:51 AM, Gustavo A. R. Silva wrote: Hi Hans, Quoting Hans Verkuil : Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: Cast len to const u64 in order to avoid a potential integer overflow. This variable is being used in a context that expe

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Hans Verkuil
On 01/30/18 11:55, Gustavo A. R. Silva wrote: > > Quoting Hans Verkuil : > >> On 01/30/2018 09:51 AM, Gustavo A. R. Silva wrote: >>> Hi Hans, >>> >>> Quoting Hans Verkuil : >>> Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: > Cast len to const u64 in order to av

Re: [PATCH 02/12] v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt

2018-01-30 Thread Sakari Ailus
On Tue, Jan 30, 2018 at 09:44:25AM +0100, Hans Verkuil wrote: > On 01/26/2018 03:41 PM, Sakari Ailus wrote: > > Hi Hans, > > > > On Fri, Jan 26, 2018 at 01:43:17PM +0100, Hans Verkuil wrote: > >> From: Hans Verkuil > >> > >> Don't duplicate the buffer type checks in enum/g/s/try_fmt. > >> The che

[PATCHv2 02/13] v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil Don't duplicate the buffer type checks in enum/g/s/try_fmt. The check_fmt function does that already. It is hard to keep the checks in sync for all these functions and in fact the check for VBI was wrong in the _fmt functions as it allowed SDR types as well. This caused a v4l2

[PATCHv2 05/13] v4l2-compat-ioctl32.c: fix the indentation

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil The indentation of this source is all over the place. Fix this. This patch only changes whitespace. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # for v4.15 and up --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 212 +- 1 file cha

[PATCHv2 04/13] v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil The result of the VIDIOC_PREPARE_BUF ioctl was never copied back to userspace since it was missing in the switch. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # for v4.15 and up --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 + 1 file changed, 1 inser

[PATCHv2 03/13] v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Cc: # for v4.15 and up --- drivers/media/v4l2-core/v4l2-ioctl.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/me

[PATCHv2 08/13] v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil The struct v4l2_plane32 should set m.userptr as well. The same happens in v4l2_buffer32 and v4l2-compliance tests for this. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # for v4.15 and up --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 47 +++

[PATCHv2 12/13] v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil Some ioctls need to copy back the result even if the ioctl returned an error. However, don't do this for the error code -ENOTTY. It makes no sense in that cases. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # for v4.15 and up --- drivers/media/v4l2-core/v4l2

[PATCHv2 09/13] v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil ctrl_is_pointer just hardcoded two known string controls, but that caused problems when using e.g. custom controls that use a pointer for the payload. Reimplement this function: it now finds the v4l2_ctrl (if the driver uses the control framework) or it calls vidioc_query_ext_

[PATCHv2 07/13] v4l2-compat-ioctl32.c: avoid sizeof(type)

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil Instead of doing sizeof(struct foo) use sizeof(*up). There even were cases where 4 * sizeof(__u32) was used instead of sizeof(kp->reserved), which is very dangerous when the size of the reserved array changes. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # fo

[PATCHv2 13/13] v4l2-compat-ioctl32.c: refactor, fix security bug in compat ioctl32

2018-01-30 Thread Hans Verkuil
From: Daniel Mentz The 32-bit compat v4l2 ioctl handling is implemented based on its 64-bit equivalent. It converts 32-bit data structures into its 64-bit equivalents and needs to provide the data to the 64-bit ioctl in user space memory which is commonly allocated using compat_alloc_user_space()

[PATCHv2 10/13] v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil put_v4l2_window32() didn't copy back the clip list to userspace. Drivers can update the clip rectangles, so this should be done. Signed-off-by: Hans Verkuil Cc: # for v4.15 and up --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 59 ++- 1 fil

[PATCHv2 11/13] v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil There is nothing wrong with using an unknown buffer type. So stop spamming the kernel log whenever this happens. The kernel will just return -EINVAL to signal this. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # for v4.15 and up --- drivers/media/v4l2-core/v

[PATCHv2 06/13] v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil These helper functions do not really help. Move the code to the __get/put_v4l2_format32 functions. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # for v4.15 and up --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 124 +- 1 file chan

[PATCHv2 00/13] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil This patch series fixes a number of bugs and culminates in the removal of the set_fs(KERNEL_DS) call in v4l2-compat-ioctl32.c. See http://people.canonical.com/~ubuntu-security/cve/2017/CVE-2017-13166.html for why this set_fs call is a bad idea. In order to test this I used vi

[PATCHv2 01/13] vivid: fix module load error when enabling fb and no_error_inj=1

2018-01-30 Thread Hans Verkuil
From: Hans Verkuil If the framebuffer is enabled and error injection is disabled, then creating the controls for the video output device would fail with an error. This is because the Clear Framebuffer control uses the 'vivid control class' and that control class isn't added if error injection is

[PATCH v8 01/11] dt-bindings: media: Add Renesas CEU bindings

2018-01-30 Thread Jacopo Mondi
Add bindings documentation for Renesas Capture Engine Unit (CEU). Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart Acked-by: Hans Verkuil --- .../devicetree/bindings/media/renesas,ceu.txt | 81 ++ 1 file changed, 81 insertions(+) cre

[PATCH v8 00/11] Renesas Capture Engine Unit (CEU) V4L2 driver

2018-01-30 Thread Jacopo Mondi
Hello, this 8th round has two minor modifications compared to v7: - Fixed Geert's comments on RZ/A1-H/L/M in bindings documentation - Calculate the PLL divisor/multiplier to generate the proper pixel clock for ov772x in place of using static tables. Series based on top of Hans': [PATCHv2 0/9

[PATCH v8 04/11] ARM: dts: r7s72100: Add Capture Engine Unit (CEU)

2018-01-30 Thread Jacopo Mondi
Add Capture Engine Unit (CEU) node to device tree. Signed-off-by: Jacopo Mondi Reviewed-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Acked-by: Hans Verkuil --- arch/arm/boot/dts/r7s72100.dtsi | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/arm

[PATCH v8 02/11] include: media: Add Renesas CEU driver interface

2018-01-30 Thread Jacopo Mondi
Add renesas-ceu header file. Do not remove the existing sh_mobile_ceu.h one as long as the original driver does not go away. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Acked-by: Hans Verkuil --- include/media/drv-intf/renesas-ceu.h | 26 ++ 1 file change

[PATCH v8 06/11] media: i2c: ov772x: Remove soc_camera dependencies

2018-01-30 Thread Jacopo Mondi
Remove soc_camera framework dependencies from ov772x sensor driver. - Handle clock and gpios - Register async subdevice - Remove soc_camera specific g/s_mbus_config operations - Change image format colorspace from JPEG to SRGB as the two use the same colorspace information but JPEG makes assumpti

Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.

2018-01-30 Thread Thierry Reding
On Tue, Jan 30, 2018 at 10:24:48AM +0100, Arnd Bergmann wrote: > On Tue, Jan 30, 2018 at 8:54 AM, Maxime Ripard > wrote: > > On Mon, Jan 29, 2018 at 03:34:02PM +0100, Arnd Bergmann wrote: > >> On Mon, Jan 29, 2018 at 10:25 AM, Linus Walleij > >> wrote: > >> > On Mon, Jan 29, 2018 at 9:25 AM, Maxi

[PATCH v8 05/11] media: i2c: Copy ov772x soc_camera sensor driver

2018-01-30 Thread Jacopo Mondi
Copy the soc_camera based driver in v4l2 sensor driver directory. This commit just copies the original file without modifying it. No modification to KConfig and Makefile as soc_camera framework dependencies need to be removed first in next commit. Signed-off-by: Jacopo Mondi Acked-by: Laurent Pin

[PATCH v8 07/11] media: i2c: ov772x: Support frame interval handling

2018-01-30 Thread Jacopo Mondi
Add support to ov772x driver for frame intervals handling and enumeration. Tested with 10MHz and 24MHz input clock at VGA and QVGA resolutions for 10, 15 and 30 frame per second rates. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/ov772x.c | 210 +

Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.

2018-01-30 Thread Thierry Reding
On Tue, Jan 30, 2018 at 10:59:16AM +0100, Thierry Reding wrote: > On Tue, Jan 30, 2018 at 10:24:48AM +0100, Arnd Bergmann wrote: > > On Tue, Jan 30, 2018 at 8:54 AM, Maxime Ripard > > wrote: > > > On Mon, Jan 29, 2018 at 03:34:02PM +0100, Arnd Bergmann wrote: > > >> On Mon, Jan 29, 2018 at 10:25 A

[PATCH v8 09/11] media: i2c: tw9910: Remove soc_camera dependencies

2018-01-30 Thread Jacopo Mondi
Remove soc_camera framework dependencies from tw9910 sensor driver. - Handle clock and gpios - Register async subdevice - Remove soc_camera specific g/s_mbus_config operations - Add kernel doc to driver interface header file - Adjust build system This commit does not remove the original soc_camera

[PATCH v8 08/11] media: i2c: Copy tw9910 soc_camera sensor driver

2018-01-30 Thread Jacopo Mondi
Copy the soc_camera based driver in v4l2 sensor driver directory. This commit just copies the original file without modifying it. No modification to KConfig and Makefile as soc_camera framework dependencies need to be removed first in next commit. Signed-off-by: Jacopo Mondi Acked-by: Laurent Pin

[PATCH v8 10/11] arch: sh: migor: Use new renesas-ceu camera driver

2018-01-30 Thread Jacopo Mondi
Migo-R platform uses sh_mobile_ceu camera driver, which is now being replaced by a proper V4L2 camera driver named 'renesas-ceu'. Move Migo-R platform to use the v4l2 renesas-ceu camera driver interface and get rid of soc_camera defined components used to register sensor drivers and of platform sp

[PATCH v8 11/11] media: i2c: ov7670: Fully set mbus frame fmt

2018-01-30 Thread Jacopo Mondi
The sensor driver sets mbus format colorspace information and sizes, but not ycbcr encoding, quantization and xfer function. When supplied with an badly initialized mbus frame format structure, those fields need to be set explicitly not to leave them uninitialized. This is tested by v4l2-compliance

[PATCH v8 03/11] media: platform: Add Renesas CEU driver

2018-01-30 Thread Jacopo Mondi
Add driver for Renesas Capture Engine Unit (CEU). The CEU interface supports capturing 'data' (YUV422) and 'images' (NV[12|21|16|61]). This driver aims to replace the soc_camera-based sh_mobile_ceu one. Tested with ov7670 camera sensor, providing YUYV_2X8 data on Renesas RZ platform GR-Peach. T

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Hans Verkuil
On 01/30/2018 09:51 AM, Gustavo A. R. Silva wrote: > Hi Hans, > > Quoting Hans Verkuil : > >> Hi Gustavo, >> >> On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: >>> Cast len to const u64 in order to avoid a potential integer >>> overflow. This variable is being used in a context that expects >>

Re: [PATCH v7 07/11] media: i2c: ov772x: Support frame interval handling

2018-01-30 Thread jacopo mondi
Hi Laurent, On Mon, Jan 29, 2018 at 01:01:01PM +0200, Laurent Pinchart wrote: > Hi Jacopo, > > Thank you for the patch. > > On Friday, 26 January 2018 15:55:26 EET Jacopo Mondi wrote: > > Add support to ov772x driver for frame intervals handling and enumeration. > > Tested with 10MHz and 24MHz inp

Re: [PATCH 12/12] v4l2-compat-ioctl32.c: refactor, fix security bug in compat ioctl32

2018-01-30 Thread Hans Verkuil
Hi Sakari, On 01/29/2018 06:06 PM, Sakari Ailus wrote: > Hi Hans, > > Thanks for your efforts on this patch and the patchset. Please see my > comments below. > > On Fri, Jan 26, 2018 at 01:43:27PM +0100, Hans Verkuil wrote: >> From: Daniel Mentz >> >> The 32-bit compat v4l2 ioctl is implemente

Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.

2018-01-30 Thread Arnd Bergmann
On Tue, Jan 30, 2018 at 8:54 AM, Maxime Ripard wrote: > On Mon, Jan 29, 2018 at 03:34:02PM +0100, Arnd Bergmann wrote: >> On Mon, Jan 29, 2018 at 10:25 AM, Linus Walleij >> wrote: >> > On Mon, Jan 29, 2018 at 9:25 AM, Maxime Ripard >> > wrote: >> >> On Sat, Jan 27, 2018 at 05:14:26PM +0100, Linu

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Hi Hans, Quoting Hans Verkuil : Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: Cast len to const u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type const u64. Addresses-Coverity-ID: 1454996 ("Uninten

Re: [PATCH 02/12] v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt

2018-01-30 Thread Hans Verkuil
On 01/26/2018 03:41 PM, Sakari Ailus wrote: > Hi Hans, > > On Fri, Jan 26, 2018 at 01:43:17PM +0100, Hans Verkuil wrote: >> From: Hans Verkuil >> >> Don't duplicate the buffer type checks in enum/g/s/try_fmt. >> The check_fmt function does that already. >> >> It is hard to keep the checks in sync

Re: [PATCH v5 5/6] arm: dts: sun8i: a83t: bananapi-m3: Enable IR controller

2018-01-30 Thread Maxime Ripard
On Mon, Jan 29, 2018 at 04:58:09PM +0100, Philipp Rossak wrote: > The Bananapi M3 has an onboard IR receiver. > This enables the onboard IR receiver subnode. > Unlike the other IR receivers this one needs a base clock frequency > of 300 Hz (3 MHz), to be able to work. > > Signed-off-by: Philip

Re: [PATCH v4 4/6] arm: dts: sun8i: a83t: Add support for the cir interface

2018-01-30 Thread Maxime Ripard
hi, On Mon, Jan 29, 2018 at 04:58:08PM +0100, Philipp Rossak wrote: > The cir interface is like on the H3 located at 0x01f02000 and is exactly > the same. This patch adds support for the ir interface on the A83T. > > Signed-off-by: Philipp Rossak > --- > arch/arm/boot/dts/sun8i-a83t.dtsi | 10 +

Re: [PATCH v4 3/6] arm: dts: sun8i: a83t: Add the cir pin for the A83T

2018-01-30 Thread Maxime Ripard
hi, On Mon, Jan 29, 2018 at 04:58:07PM +0100, Philipp Rossak wrote: > The CIR Pin of the A83T is located at PL12. > > Signed-off-by: Philipp Rossak > --- > arch/arm/boot/dts/sun8i-a83t.dtsi | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi > b/arc