[PATCH for v4.4 00/14] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-02-14 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. This was tested with a VM running 4.4, the vivid driver (since that emulates almost all V4L2 ioctls that need to pass through

[PATCH for v4.4 14/14] media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a upstream. 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

[PATCH for v4.4 10/14] media: v4l2-compat-ioctl32: Copy v4l2_window->global_alpha

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit 025a26fa14f8fd55d50ab284a30c016a5be953d0 upstream. Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output overlays.") added the field global_alpha to struct v4l2_window but did not update the compat layer accordingly. This change

[PATCH for v4.4 13/14] media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit d83a8243aaefe62ace433e4384a4f077bed86acb upstream. 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

[PATCH for v4.4 02/14] vb2: V4L2_BUF_FLAG_DONE is set after DQBUF

2018-02-14 Thread Hans Verkuil
From: Ricardo Ribalda commit 3171cc2b4eb9831ab4df1d80d0410a945b8bc84e upstream. According to the doc, V4L2_BUF_FLAG_DONE is cleared after DQBUF: V4L2_BUF_FLAG_DONE 0x0004 ... After calling the VIDIOC_QBUF or VIDIOC_DQBUF it is always cleared ... Unfortunately,

[PATCH for v4.4 07/14] media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 8ed5a59dcb47a6f76034ee760b36e089f3e82529 upstream. 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

[PATCH for v4.4 06/14] media: v4l2-compat-ioctl32.c: avoid sizeof(type)

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream. 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

[PATCH for v4.4 05/14] media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 486c521510c44a04cd756a9267e7d1e271c8a4ba upstream. 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

[PATCH for v4.4 03/14] media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 3ee6d040719ae09110e5cdf24d5386abe5d1b776 upstream. 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

[PATCH for v4.4 12/14] media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 169f24ca68bf0f247d111aef07af00dd3a02ae88 upstream. 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

[PATCH for v4.4 11/14] media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit a751be5b142ef6bcbbb96d9899516f4d9c8d0ef4 upstream. 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 Acked-by:

[PATCH for v4.4 04/14] media: v4l2-compat-ioctl32.c: fix the indentation

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b7b957d429f601d6d1942122b339474f31191d75 upstream. 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

[PATCH for v4.4 01/14] media: v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream. If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus

[PATCH for v3.2 08/12] media: v4l2-compat-ioctl32: Copy v4l2_window->global_alpha

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit 025a26fa14f8fd55d50ab284a30c016a5be953d0 upstream. Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output overlays.") added the field global_alpha to struct v4l2_window but did not update the compat layer accordingly. This change

[PATCH for v3.2 04/12] media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 486c521510c44a04cd756a9267e7d1e271c8a4ba upstream. 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

[PATCH for v3.2 12/12] media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a upstream. 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

[PATCH for v3.2 03/12] media: v4l2-compat-ioctl32.c: fix the indentation

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b7b957d429f601d6d1942122b339474f31191d75 upstream. 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

[PATCH for v3.2 02/12] media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 3ee6d040719ae09110e5cdf24d5386abe5d1b776 upstream. 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

[PATCH for v3.2 06/12] media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 8ed5a59dcb47a6f76034ee760b36e089f3e82529 upstream. 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

[PATCH for v3.2 07/12] media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b8c601e8af2d08f733d74defa8465303391bb930 upstream. 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

[PATCH for v3.2 09/12] media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit a751be5b142ef6bcbbb96d9899516f4d9c8d0ef4 upstream. 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 Acked-by:

[PATCH for v3.2 00/12] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-02-14 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. This was tested with a VM running 3.2, the vivi driver (a poor substitute for the much improved vivid driver that's available

[PATCH for v3.2 11/12] media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit d83a8243aaefe62ace433e4384a4f077bed86acb upstream. 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

[PATCH for v3.2 10/12] media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 169f24ca68bf0f247d111aef07af00dd3a02ae88 upstream. 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

Re: exposing a large-ish calibration table through V4L2?

2018-02-14 Thread Hans Verkuil
Hi Florian, On 14/02/18 13:09, Florian Echtler wrote: > Hello Hans, > > I've picked up work on the sur40 driver again recently. There is one major > feature left that is currently unsupported by the Linux driver, which is the > hardware-based calibration. > > The internal device memory contains

media: v4l: alsa: Associating V4L2 and ALSA devices coming from the same device (a webcam for example)

2018-02-14 Thread Carlos Rafael Giani
I have an application that allows for recording audio/video from input devices. I now want to add to it the ability to autodetect plugged-in USB webcams via udev. The problem is that audio and video are handled separately, by a video4linux and an ALSA device. The goal is to discover the ALSA

[PATCH for v4.9 10/13] media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit a751be5b142ef6bcbbb96d9899516f4d9c8d0ef4 upstream. 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 Acked-by:

[PATCH for v4.9 09/13] media: v4l2-compat-ioctl32: Copy v4l2_window->global_alpha

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit 025a26fa14f8fd55d50ab284a30c016a5be953d0 upstream. Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output overlays.") added the field global_alpha to struct v4l2_window but did not update the compat layer accordingly. This change

[PATCH for v4.9 11/13] media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 169f24ca68bf0f247d111aef07af00dd3a02ae88 upstream. 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

[PATCH for v4.9 06/13] media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 8ed5a59dcb47a6f76034ee760b36e089f3e82529 upstream. 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

[PATCH for v4.9 05/13] media: v4l2-compat-ioctl32.c: avoid sizeof(type)

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream. 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

[PATCH for v4.9 01/13] media: v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream. If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus

[PATCH for v4.9 07/13] media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b8c601e8af2d08f733d74defa8465303391bb930 upstream. 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

[PATCH for v4.9 03/13] media: v4l2-compat-ioctl32.c: fix the indentation

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b7b957d429f601d6d1942122b339474f31191d75 upstream. 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

[PATCH for v4.9 04/13] media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 486c521510c44a04cd756a9267e7d1e271c8a4ba upstream. 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

[PATCH for v4.9 02/13] media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 3ee6d040719ae09110e5cdf24d5386abe5d1b776 upstream. 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

[PATCH for v4.9 00/13] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-02-14 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. This was tested with a VM running 4.9, the vivid driver (since that emulates almost all V4L2 ioctls that need to pass through

[PATCH for v4.9 08/13] media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 273caa260035c03d89ad63d72d8cd3d9e5c5e3f1 upstream. 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 crash. Add a test for !ops to the condition. All sub-devices that have

[PATCH for v3.16 13/14] media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit d83a8243aaefe62ace433e4384a4f077bed86acb upstream. 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

[PATCH for v3.16 12/14] media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 169f24ca68bf0f247d111aef07af00dd3a02ae88 upstream. 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

[PATCH for v3.16 11/14] media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit a751be5b142ef6bcbbb96d9899516f4d9c8d0ef4 upstream. 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 Acked-by:

[PATCH for v3.16 14/14] media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a upstream. 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

[PATCH for v3.16 09/14] media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b8c601e8af2d08f733d74defa8465303391bb930 upstream. 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

[PATCH for v3.16 01/14] adv7604: use correct drive strength defines

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil The prefix is ADV7604_, not ADV76XX. Fixes: f31b62e14a ("adv7604: add hdmi driver strength adjustment") Signed-off-by: Hans Verkuil --- drivers/media/i2c/adv7604.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[no subject]

2018-02-14 Thread Scott Tisdale
hi Linux https://goo.gl/jMp8sb Scott Tisdale

Re: exposing a large-ish calibration table through V4L2?

2018-02-14 Thread Hans Verkuil
On 14/02/18 13:27, Florian Echtler wrote: > Hello Hans, > > On 14.02.2018 13:13, Hans Verkuil wrote: >> >> On 14/02/18 13:09, Florian Echtler wrote: >>> >>> The internal device memory contains a table with two bytes for each sensor >>> pixel >>> (i.e. 960x540x2 = 1036800 bytes) that basically

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

2018-02-14 Thread Maxime Ripard
Hi Laurent, On Thu, Feb 08, 2018 at 08:17:19PM +0200, Laurent Pinchart wrote: > > + /* > > +* Create a static mapping between the CSI virtual channels > > +* and the output stream. > > +* > > +* This should be enhanced, but v4l2 lacks the support for > > +* changing that

[PATCH for v4.14 13/13] media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 273caa260035c03d89ad63d72d8cd3d9e5c5e3f1 upstream. 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 crash. Add a test for !ops to the condition. All sub-devices that have

[PATCH for v4.14 11/13] media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit d83a8243aaefe62ace433e4384a4f077bed86acb upstream. 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

[PATCH for v3.16 06/14] media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 486c521510c44a04cd756a9267e7d1e271c8a4ba upstream. 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

[PATCH for v3.16 10/14] media: v4l2-compat-ioctl32: Copy v4l2_window->global_alpha

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit 025a26fa14f8fd55d50ab284a30c016a5be953d0 upstream. Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output overlays.") added the field global_alpha to struct v4l2_window but did not update the compat layer accordingly. This change

[PATCH for v3.16 07/14] media: v4l2-compat-ioctl32.c: avoid sizeof(type)

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream. 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

[PATCH for v3.16 00/14] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-02-14 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. This was tested with a VM running 3.16, the vivi driver (a poor substitute for the much improved vivid driver that's

[PATCH for v3.16 08/14] media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 8ed5a59dcb47a6f76034ee760b36e089f3e82529 upstream. 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

[PATCH for v3.16 05/14] media: v4l2-compat-ioctl32.c: fix the indentation

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b7b957d429f601d6d1942122b339474f31191d75 upstream. 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

[PATCH for v3.16 04/14] media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 3ee6d040719ae09110e5cdf24d5386abe5d1b776 upstream. 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

[PATCH for v3.16 02/14] media: v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream. If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus

[PATCH for v3.16 03/14] vb2: V4L2_BUF_FLAG_DONE is set after DQBUF

2018-02-14 Thread Hans Verkuil
From: Ricardo Ribalda commit 3171cc2b4eb9831ab4df1d80d0410a945b8bc84e upstream. According to the doc, V4L2_BUF_FLAG_DONE is cleared after DQBUF: V4L2_BUF_FLAG_DONE 0x0004 ... After calling the VIDIOC_QBUF or VIDIOC_DQBUF it is always cleared ... Unfortunately,

[PATCH for v3.2 01/12] media: v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream. If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus

[PATCH for v3.2 05/12] media: v4l2-compat-ioctl32.c: avoid sizeof(type)

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream. 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

Re: exposing a large-ish calibration table through V4L2?

2018-02-14 Thread Florian Echtler
Hello Hans, On 14.02.2018 13:13, Hans Verkuil wrote: > > On 14/02/18 13:09, Florian Echtler wrote: >> >> The internal device memory contains a table with two bytes for each sensor >> pixel >> (i.e. 960x540x2 = 1036800 bytes) that basically provide individual black and >> white levels per-pixel

Re: [PATCH v10 6/8] media: i2c: Add TDA1997x HDMI receiver driver

2018-02-14 Thread Hans Verkuil
Hi Tim, On 12/02/18 23:27, Tim Harvey wrote: > On Fri, Feb 9, 2018 at 12:08 AM, Hans Verkuil wrote: >> Hi Tim, >> >> We're almost there. Two more comments: >> >> On 02/09/2018 07:32 AM, Tim Harvey wrote: >>> +static int >>> +tda1997x_detect_std(struct tda1997x_state *state,

[PATCH 1/1] media: request: Add support for tagged request-based objects

2018-02-14 Thread Sakari Ailus
Allow binding objects to requests that can be later on fetched based on that tag. The intent is that the objects are bound at the time data is bound to a request and later retrieved for validation (and finally applied) when the request is queued. A tag can be any pointer, as long as it is unique

[PATCH for v4.14 12/13] media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a upstream. 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

[PATCH for v4.14 07/13] media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 8ed5a59dcb47a6f76034ee760b36e089f3e82529 upstream. 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

[PATCH for v4.14 02/13] media: v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream. If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus

[PATCH for v4.14 01/13] media: v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b2469c814fbc8f1f19676dd4912717b798df511e upstream. 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

[PATCH for v4.14 00/13] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-02-14 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. This was tested with a VM running 4.14, the vivid driver (since that emulates almost all V4L2 ioctls that need to pass

[PATCH for v4.14 06/13] media: v4l2-compat-ioctl32.c: avoid sizeof(type)

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream. 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

[PATCH for v4.14 04/13] media: v4l2-compat-ioctl32.c: fix the indentation

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b7b957d429f601d6d1942122b339474f31191d75 upstream. 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

[PATCH for v4.14 08/13] media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b8c601e8af2d08f733d74defa8465303391bb930 upstream. 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

[PATCH for v4.14 10/13] media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 169f24ca68bf0f247d111aef07af00dd3a02ae88 upstream. 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

[PATCH for v4.14 09/13] media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit a751be5b142ef6bcbbb96d9899516f4d9c8d0ef4 upstream. 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 Acked-by:

[PATCH for v4.14 05/13] media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 486c521510c44a04cd756a9267e7d1e271c8a4ba upstream. 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

[PATCH for v4.14 03/13] media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 3ee6d040719ae09110e5cdf24d5386abe5d1b776 upstream. 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

[PATCH for v4.1 00/14] v4l2-compat-ioctl32.c: remove set_fs(KERNEL_DS)

2018-02-14 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. This was tested with a VM running 4.1, the vivid driver (since that emulates almost all V4L2 ioctls that need to pass through

[PATCH for v4.1 07/14] media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 8ed5a59dcb47a6f76034ee760b36e089f3e82529 upstream. 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

[PATCH for v4.1 09/14] media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 273caa260035c03d89ad63d72d8cd3d9e5c5e3f1 upstream. 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 crash. Add a test for !ops to the condition. All sub-devices that have

[PATCH for v4.1 12/14] media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 169f24ca68bf0f247d111aef07af00dd3a02ae88 upstream. 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

[PATCH for v4.1 04/14] media: v4l2-compat-ioctl32.c: fix the indentation

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b7b957d429f601d6d1942122b339474f31191d75 upstream. 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

[PATCH for v4.1 14/14] media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a upstream. 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

[PATCH for v4.1 03/14] media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 3ee6d040719ae09110e5cdf24d5386abe5d1b776 upstream. 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

[PATCH for v4.1 13/14] media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit d83a8243aaefe62ace433e4384a4f077bed86acb upstream. 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

[PATCH for v4.1 05/14] media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 486c521510c44a04cd756a9267e7d1e271c8a4ba upstream. 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

[PATCH for v4.1 10/14] media: v4l2-compat-ioctl32: Copy v4l2_window->global_alpha

2018-02-14 Thread Hans Verkuil
From: Daniel Mentz commit 025a26fa14f8fd55d50ab284a30c016a5be953d0 upstream. Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output overlays.") added the field global_alpha to struct v4l2_window but did not update the compat layer accordingly. This change

[PATCH for v4.1 02/14] vb2: V4L2_BUF_FLAG_DONE is set after DQBUF

2018-02-14 Thread Hans Verkuil
From: Ricardo Ribalda commit 3171cc2b4eb9831ab4df1d80d0410a945b8bc84e upstream. According to the doc, V4L2_BUF_FLAG_DONE is cleared after DQBUF: V4L2_BUF_FLAG_DONE 0x0004 ... After calling the VIDIOC_QBUF or VIDIOC_DQBUF it is always cleared ... Unfortunately,

[PATCH for v4.1 06/14] media: v4l2-compat-ioctl32.c: avoid sizeof(type)

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream. 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

[PATCH for v4.1 08/14] media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b8c601e8af2d08f733d74defa8465303391bb930 upstream. 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

[PATCH for v4.1 11/14] media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit a751be5b142ef6bcbbb96d9899516f4d9c8d0ef4 upstream. 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 Acked-by:

[PATCH for v4.1 01/14] media: v4l2-ioctl.c: don't copy back the result for -ENOTTY

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream. If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus

[PATCH for v4.4 09/14] media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit 273caa260035c03d89ad63d72d8cd3d9e5c5e3f1 upstream. 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 crash. Add a test for !ops to the condition. All sub-devices that have

[PATCH for v4.4 08/14] media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer

2018-02-14 Thread Hans Verkuil
From: Hans Verkuil commit b8c601e8af2d08f733d74defa8465303391bb930 upstream. 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

exposing a large-ish calibration table through V4L2?

2018-02-14 Thread Florian Echtler
Hello Hans, I've picked up work on the sur40 driver again recently. There is one major feature left that is currently unsupported by the Linux driver, which is the hardware-based calibration. The internal device memory contains a table with two bytes for each sensor pixel (i.e. 960x540x2 =

[PATCH v2] videodev2.h: add helper to validate colorspace

2018-02-14 Thread Niklas Söderlund
There is no way for drivers to validate a colorspace value, which could be provided by user-space by VIDIOC_S_FMT for example. Add a helper to validate that the colorspace value is part of enum v4l2_colorspace. Signed-off-by: Niklas Söderlund ---

Re: [PATCH v2] videodev2.h: add helper to validate colorspace

2018-02-14 Thread Sakari Ailus
On Wed, Feb 14, 2018 at 11:36:43AM +0100, Niklas Söderlund wrote: > There is no way for drivers to validate a colorspace value, which could > be provided by user-space by VIDIOC_S_FMT for example. Add a helper to > validate that the colorspace value is part of enum v4l2_colorspace. > >

Re: i.MX53 using imx-media to capture analog video through ADV7180

2018-02-14 Thread Fabio Estevam
[Adding Steve and Philipp in case they could provide some suggestions] On Wed, Feb 14, 2018 at 1:21 PM, Matthew Starr wrote: > I have successfully modified device tree files in the mainline 4.15.1 kernel > to get a display product using the i.MX53 processor to initialize

Re: [PATCH v4 16/18] scripts: kernel-doc: improve nested logic to handle multiple identifiers

2018-02-14 Thread Jani Nikula
On Mon, 18 Dec 2017, Mauro Carvalho Chehab wrote: > It is possible to use nested structs like: > > struct { > struct { > void *arg1; > } st1, st2, *st3, st4; > }; > > Handling it requires to split each parameter. Change the logic > to allow such

Re: [PATCHv2 3/9] staging: atomisp: Kill subdev s_parm abuse

2018-02-14 Thread Mauro Carvalho Chehab
Sakari, Em Mon, 22 Jan 2018 13:31:19 +0100 Hans Verkuil escreveu: > From: Sakari Ailus > > Remove sensor driver's interface that made use of use case specific > knowledge of platform capabilities. Could you better describe it? What s_param

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

2018-02-14 Thread Laurent Pinchart
Hi Maxime, On Wednesday, 14 February 2018 15:19:33 EET Maxime Ripard wrote: > On Thu, Feb 08, 2018 at 08:17:19PM +0200, Laurent Pinchart wrote: > >> + /* > >> + * Create a static mapping between the CSI virtual channels > >> + * and the output stream. > >> + * > >> + * This should be

Re: [PATCH v10 6/8] media: i2c: Add TDA1997x HDMI receiver driver

2018-02-14 Thread Tim Harvey
On Wed, Feb 14, 2018 at 6:08 AM, Hans Verkuil wrote: > Hi Tim, > > On 12/02/18 23:27, Tim Harvey wrote: >> On Fri, Feb 9, 2018 at 12:08 AM, Hans Verkuil wrote: >>> Hi Tim, >>> >>> We're almost there. Two more comments: >>> >>> On 02/09/2018 07:32 AM, Tim

  1   2   >