patch?
We went separate paths :), I tried to make everything const (and
therefore the remoteproc changes) and he removed the const.
His patch looks good to me. Shall I resend the series without this
patch or you can ignore 3/3 and take 1 and 2?
Thanks!
>
> Regards,
>
> Ha
*)' to 'pvr2_stream_callback' (aka 'void (*)(void
*)') converts to incompatible function type [-Wcast-function-type-strict]
Reviewed-by: Nathan Chancellor
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/pvrusb2/pvrusb2-context.c | 5 +++--
drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 7 ---
drivers/media
Hi
On Mon, 26 Feb 2024 at 18:32, Ricardo Ribalda wrote:
>
> Building with LLVM=1 throws the following warning:
> drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c:38:32:
> warning: cast from 'mtk_vcodec_ipi_handler' (aka 'void (*)(void *, unsigned
to incompatible function type [-Wcast-function-type-strict]
Reviewed-by: Nathan Chancellor
Signed-off-by: Ricardo Ribalda
---
drivers/media/pci/sta2x11/sta2x11_vip.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c
b/drivers/media/pci
to incompatible function type [-Wcast-function-type-strict]
Constify the types to avoid the warning.
Signed-off-by: Ricardo Ribalda
---
drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c | 12 ++--
.../media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h| 2
LLVM does check -Wcast-function-type-sctrict, which is triggered in a
couple of places in the media subsystem.
Signed-off-by: Ricardo Ribalda
---
Changes in v2:
- Refactor media: mediatek patchset
- sta2x11: Fix Christmas tree order
- Link to v1:
https://lore.kernel.org/r/20240128-fix-clang
s.
Cc: sta...@vger.kernel.org
Fixes: ad91849996f9 ("media: staging/intel-ipu3: Fix set_fmt error handling")
Reviewed-by: Tomasz Figa
Signed-off-by: Ricardo Ribalda
Signed-off-by: Sakari Ailus
---
drivers/staging/media/ipu3/ipu3-v4l2.c | 30 --
1 file change
681021] sg_alloc_table_from_pages+0x11/0x30
[7.681511] vb2_dma_sg_alloc+0x162/0x280 [videobuf2_dma_sg]
Cc: sta...@vger.kernel.org
Fixes: efc42bc98058 ("scatterlist: add sg_alloc_table_from_pages function")
Signed-off-by: Ricardo Ribalda
---
lib/scatterlist.c | 3 +++
1 file chang
Hi
Friendly ping?
On Tue, Mar 9, 2021 at 9:51 PM Ricardo Ribalda wrote:
>
> When sg_alloc_table_from_pages is called with n_pages = 0, we write in a
> non-allocated page. Fix it by checking early the error condition.
>
> [7.666801] BUG: kernel NULL pointer deref
Hi Bingbu
Maybe you want to add your Reviewed-by ? ;)
Thanks!
On Wed, Mar 17, 2021 at 7:48 AM Bingbu Cao wrote:
>
>
> On 3/17/21 1:50 AM, Ricardo Ribalda wrote:
> > Hi Bingbu
> >
> > Thanks for your review
> >
> > On Tue, Mar 16, 2021 at 12:29 PM Bingbu
ima_file_mprotect does not return EACCES but EPERM.
Signed-off-by: Ricardo Ribalda
---
security/integrity/ima/ima_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/ima/ima_main.c
b/security/integrity/ima/ima_main.c
index 9ef748ea829f..716ea29cf897
Hello Hans
On Fri, Mar 26, 2021 at 11:01 AM Ricardo Ribalda wrote:
>
> From: Hans Verkuil
>
> Check for inactive controls in uvc_ctrl_is_accessible().
> Use the new value for the master_id controls if present,
> otherwise use the existing value to determine if it is OK
&g
Hi Hans
Thanks for your review!
On Sat, Mar 27, 2021 at 12:19 PM Hans Verkuil wrote:
>
> On 26/03/2021 10:58, Ricardo Ribalda wrote:
> > The uvc driver relies on the camera firmware to keep the control states
> > and therefore is not capable of changing an inactive cont
From: Hans Verkuil
When uvc was written the vb2 ioctl and file operation helpers didn't exist.
This patch switches uvc over to those helpers, which removes a lot of
boilerplate
code and simplifies VIDIOC_G/S_PRIORITY handling and allows us to drop the
'privileges' scheme, since that's now
From: Hans Verkuil
Don't report the restored controls with dev_info, use dev_dbg instead.
This prevents a lot of noise in the kernel log.
Signed-off-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_ctrl.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
From: Hans Verkuil
Check for inactive controls in uvc_ctrl_is_accessible().
Use the new value for the master_id controls if present,
otherwise use the existing value to determine if it is OK
to set the control. Doing this here avoids attempting to
set an inactive control, which will return an
From: Hans Verkuil
- If __uvc_query_ctrl() failed with a non-EPIPE error, then
report that with dev_err. If an error code is obtained, then
report that with dev_dbg.
- For error 2 (Wrong state) return -EACCES instead of -EILSEQ.
EACCES is a much more appropriate error code. EILSEQ will
If we have an error setting a control, return the affected control in
the error_idx field.
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 42 ++--
drivers/media/usb/uvc/uvc_v4l2.c | 2 +-
drivers/media/usb/uvc
The uvc driver relies on the camera firmware to keep the control states
and therefore is not capable of changing an inactive control.
Allow returning -EACESS in those cases.
Signed-off-by: Ricardo Ribalda
---
Documentation/userspace-api/media/v4l/vidioc-g-ctrl.rst | 5 +
Documentation
Convert the error into a debug message, so they are still valid for
debugging but do not fill dmesg.
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/uvc/uvc_video.c
b/drivers/media/usb
-to: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 8 +---
drivers/media/usb/uvc/uvcvideo.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_video.c
b/drivers/media/usb/uvc/uvc_video.c
C_G/S/TRY_EXT_CTRLS: FAIL
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 22 ++
drivers/media/usb/uvc/uvc_v4l2.c | 39
drivers/media/usb/uvc/uvcvideo.h | 2 ++
3 files changed, 58 insertions(+)
If a control is inactive return -EACCES to let the userspace know that
the value will not be applied automatically when the control is active
again.
Suggested-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 71 +---
1 file
The framework already contains a map of IDs to names, lets use it when
possible.
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
Suggested-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_ctrl.c | 57
drivers/media/usb/uvc/uvc_v4l2.c | 8 -
drivers
ind(key)
!= v2_entity_names_set.end()
test MEDIA_IOC_G_TOPOLOGY: FAIL
fail: v4l2-test-media.cpp(394): num_data_links != num_links
test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_drive
Use the device name for the card name instead of vdev->name.
Signed-off-by: Hans Verkuil
Suggested-by: Laurent Pinchart
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_metadata.c | 2 +-
drivers/media/usb/uvc/uvc_v4l2.c | 3 +--
2 files changed, 2 insertions(+), 3 deleti
Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 41 --
drivers/media/usb/uvc/uvc_driver.c | 8 +++---
2 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
hart
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index ac98869d5a05..1eeeb00280e4 100644
--- a/drivers
009a
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: FAIL
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 94
drivers/media/usb/uvc/uvcvideo.h | 5 ++
2 files changed, 99 insertions(+)
diff --git a/drivers/media/usb
/S_CTRL: FAIL
fail: v4l2-test-controls.cpp(698): s_ext_ctrls returned an
error (22)
test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
Reviewed-by: Laurent Pinchart
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 5 +
1 file changed
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Cc: Mike Isely
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
---
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
b
If we do not implement these callbacks the framework will call the
ext_ctrl callbaks instead, which are a superset of this functions.
Suggested-by: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 56
Fixes: 6fa6f831f095 ("media: v4l2-ctrls: add core request support")
Suggested-by: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/v4l2-core/v4l2-ioctl.c | 60 ++--
1 file changed, 39 insertions(+), 21 deletions(-)
diff --
value out
of range
fail: v4l2-test-controls.cpp(507): invalid control 00980900
test VIDIOC_G/S_CTRL: FAIL
Fixes: 35ea11ff8471 ("V4L/DVB (8430): videodev: move some functions from
v4l2-dev.h to v4l2-common.h or v4l2-ioctl.h")
Reviewed-by: Hans Verkuil
Signed-off-b
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
in uvc_ctrl_restore_values()
uvc: use vb2 ioctl and fop helpers
Ricardo Ribalda (18):
media: v4l2-ioctl: Fix check_ext_ctrls
media: pvrusb2: Do not check for V4L2_CTRL_WHICH_DEF_VAL
media: uvcvideo: Do not check for V4L2_CTRL_WHICH_DEF_VAL
media: v4l2-ioctl: S_CTRL output the right value
media
HI Sergey
On Wed, Mar 24, 2021 at 3:22 AM Sergey Senozhatsky
wrote:
>
> On (21/03/23 17:04), Ricardo Ribalda wrote:
> > On Fri, Mar 19, 2021 at 6:53 AM Sergey Senozhatsky
> > wrote:
> > >
> > > UVC 1.5 defines the following Region Of Interest auto con
1533,6 +1673,7 @@ const struct v4l2_ioctl_ops uvc_ioctl_ops = {
> .vidioc_try_ext_ctrls = uvc_ioctl_try_ext_ctrls,
> .vidioc_querymenu = uvc_ioctl_querymenu,
> .vidioc_g_selection = uvc_ioctl_g_selection,
> + .vidioc_s_selection = uvc_ioctl_s_selection,
> .vidioc_g_parm = uvc_ioctl_g_parm,
> .vidioc_s_parm = uvc_ioctl_s_parm,
> .vidioc_enum_framesizes = uvc_ioctl_enum_framesizes,
> diff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
> index d854cb19c42c..c87624962896 100644
> --- a/include/uapi/linux/usb/video.h
> +++ b/include/uapi/linux/usb/video.h
> @@ -104,6 +104,7 @@
> #define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
> #define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
> #define UVC_CT_PRIVACY_CONTROL 0x11
> +#define UVC_CT_REGION_OF_INTEREST_CONTROL 0x14
>
> /* A.9.5. Processing Unit Control Selectors */
> #define UVC_PU_CONTROL_UNDEFINED 0x00
> --
> 2.31.0.rc2.261.g7f71774620-goog
>
--
Ricardo Ribalda
inimum
> + auto-controls value. All valid ROI rectangles and auto-controls
> + should be within minimum-maximum range.
> + - Yes
> + - No
> +* - ``V4L2_SEL_TGT_ROI_BOUNDS_MAX``
> + - 0x0203
> + - Maximum bounds of the Region of Interest rectangle and maximum
> + auto-controls value. All valid ROI rectangles and auto-controls
> + should be within minimum-maximum range.
> + - Yes
> + - No
>
> .. raw:: latex
>
> --
> 2.31.0.rc2.261.g7f71774620-goog
>
--
Ricardo Ribalda
K(1 << 5)
> +#define V4L2_SEL_FLAG_ROI_AUTO_IMAGE_STABILIXATION (1 << 6)
> +#define V4L2_SEL_FLAG_ROI_AUTO_HIGHER_QUALITY (1 << 7)
> +
> struct v4l2_edid {
> __u32 pad;
> __u32 start_block;
> --
> 2.31.0.rc2.261.g7f71774620-goog
>
--
Ricardo Ribalda
From: Hans Verkuil
When uvc was written the vb2 ioctl and file operation helpers didn't exist.
This patch switches uvc over to those helpers, which removes a lot of
boilerplate
code and simplifies VIDIOC_G/S_PRIORITY handling and allows us to drop the
'privileges' scheme, since that's now
If a control is inactive return -EACCES to let the userspace know that
the value will not be applied automatically when the control is active
again.
Suggested-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 71 +---
1 file
Convert the error into a debug message, so they are still valid for
debugging but do not fill dmesg.
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/uvc/uvc_video.c
b/drivers/media/usb
ind(key)
!= v2_entity_names_set.end()
test MEDIA_IOC_G_TOPOLOGY: FAIL
fail: v4l2-test-media.cpp(394): num_data_links != num_links
test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_drive
C_G/S/TRY_EXT_CTRLS: FAIL
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 22 ++
drivers/media/usb/uvc/uvc_v4l2.c | 39
drivers/media/usb/uvc/uvcvideo.h | 2 ++
3 files changed, 58 insertions(+)
The uvc driver relies on the camera firmware to keep the control states
and therefore is not capable of changing an inactive control.
Allow returning -EACESS in those cases.
Signed-off-by: Ricardo Ribalda
---
Documentation/userspace-api/media/v4l/vidioc-g-ctrl.rst | 5 +
Documentation
If we have an error setting a control, return the affected control in
the error_idx field.
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 42 ++--
drivers/media/usb/uvc/uvc_v4l2.c | 2 +-
drivers/media/usb/uvc/uvcvideo.h | 10 +++-
3 files
The framework already contains a map of IDs to names, lets use it when
possible.
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
Suggested-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_ctrl.c | 57
drivers/media/usb/uvc/uvc_v4l2.c | 8 -
drivers
-to: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 8 +---
drivers/media/usb/uvc/uvcvideo.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_video.c
b/drivers/media/usb/uvc/uvc_video.c
/S_CTRL: FAIL
fail: v4l2-test-controls.cpp(698): s_ext_ctrls returned an
error (22)
test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
Reviewed-by: Laurent Pinchart
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 5 +
1 file changed
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 41 --
drivers/media/usb/uvc/uvc_driver.c | 8 +++---
2 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
009a
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: FAIL
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 94
drivers/media/usb/uvc/uvcvideo.h | 5 ++
2 files changed, 99 insertions(+)
diff --git a/drivers/media/usb
Use the device name for the card name instead of vdev->name.
Signed-off-by: Hans Verkuil
Suggested-by: Laurent Pinchart
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_metadata.c | 2 +-
drivers/media/usb/uvc/uvc_v4l2.c | 3 +--
2 files changed, 2 insertions(+), 3 deleti
If we do not implement these callback the framework will call the ext_ctrl
callbaks instead, which are a superset of this functions.
Suggested-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 56
1 file changed, 56
hart
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index ac98869d5a05..1eeeb00280e4 100644
--- a/drivers
value out
of range
fail: v4l2-test-controls.cpp(507): invalid control 00980900
test VIDIOC_G/S_CTRL: FAIL
Fixes: 35ea11ff8471 ("V4L/DVB (8430): videodev: move some functions from
v4l2-dev.h to v4l2-common.h or v4l2-ioctl.h")
Signed-off-by: Ricardo Ribalda
---
dri
Fixes: 6fa6f831f095 ("media: v4l2-ctrls: add core request support")
Suggested-by: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/v4l2-core/v4l2-ioctl.c | 60 ++--
1 file changed, 39 insertions(+), 21 deletions(-)
diff --
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Cc: Mike Isely
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
---
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
b
Verkuil (1):
uvc: use vb2 ioctl and fop helpers
Ricardo Ribalda (18):
media: v4l2-ioctl: Fix check_ext_ctrls
media: pvrusb2: Do not check for V4L2_CTRL_WHICH_DEF_VAL
media: uvcvideo: Do not check for V4L2_CTRL_WHICH_DEF_VAL
media: v4l2-ioctl: S_CTRL output the right value
media
Hi Sergey
On Fri, Mar 19, 2021 at 6:35 AM Sergey Senozhatsky
wrote:
>
> On (21/03/18 22:19), Ricardo Ribalda wrote:
> > >
> > > May I please ask for more opinions on this?
> >
> > Could you try setting the roi in a loop in your device and verif
Hello Hans
On Fri, Mar 19, 2021 at 9:35 AM Hans Verkuil wrote:
>
> On 18/03/2021 21:29, Ricardo Ribalda wrote:
> > Take a v4l2_ext_controls instead of an array of controls, this way we
> > can access the error_idx in future changes.
> >
> > Signed-off-by: Ricardo
Hi Christoph
On Fri, Mar 19, 2021 at 2:10 PM Christoph Hellwig wrote:
>
> On Fri, Mar 19, 2021 at 02:05:21PM +0100, Ricardo Ribalda wrote:
> > > + uvc_urb->sgt,
> > > + uvc_stream_dir(uvc_urb->
Hi Christoph
While backporting the patch I realised of a bug.
On Sat, Mar 13, 2021 at 12:55 AM Ricardo Ribalda wrote:
>
> On architectures where there is no coherent caching such as ARM use the
> dma_alloc_noncontiguous API and handle manually the cache flushing using
> dma_
Hi Hans
Thanks for testing this.
On Fri, Mar 19, 2021 at 10:10 AM Hans Verkuil wrote:
>
> On 18/03/2021 21:29, Ricardo Ribalda wrote:
> > If a control is inactive return -EACCES to let the userspace know that
> > the value will not be applied automatically when the
On Thu, Mar 18, 2021 at 10:19 PM Ricardo Ribalda wrote:
>
> Hi Sergey
>
> On Thu, Mar 18, 2021 at 5:47 AM Sergey Senozhatsky
> wrote:
> >
> > On (21/03/17 08:58), Ricardo Ribalda Delgado wrote:
> > [..]
> > > >
> > > > GET_CUR?
> >
Hi Sergey
On Thu, Mar 18, 2021 at 5:47 AM Sergey Senozhatsky
wrote:
>
> On (21/03/17 08:58), Ricardo Ribalda Delgado wrote:
> [..]
> > >
> > > GET_CUR?
> > yep
> >
> > >
> > > > https://www.kernel.org/doc/html/v4.13/media/u
If a control is inactive return -EACCES to let the userspace know that
the value will not be applied automatically when the control is active
again.
Reviewed-by: Hans Verkuil
Suggested-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 68
From: Hans Verkuil
When uvc was written the vb2 ioctl and file operation helpers didn't exist.
This patch switches uvc over to those helpers, which removes a lot of
boilerplate
code and simplifies VIDIOC_G/S_PRIORITY handling and allows us to drop the
'privileges' scheme, since that's now
If we have an error setting a control, return the affected control in
the error_idx field.
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 37
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b
The uvc driver relies on the camera firmware to keep the control states
and therefore is not capable of changing an inactive control.
Allow returning -EACESS in those cases.
Signed-off-by: Ricardo Ribalda
---
Documentation/userspace-api/media/v4l/vidioc-g-ctrl.rst | 5 +
Documentation
Take a v4l2_ext_controls instead of an array of controls, this way we
can access the error_idx in future changes.
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 5 ++---
drivers/media/usb/uvc/uvc_v4l2.c | 8 ++--
drivers/media/usb/uvc/uvcvideo.h | 10 --
3
C_G/S/TRY_EXT_CTRLS: FAIL
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 22 ++
drivers/media/usb/uvc/uvc_v4l2.c | 39
drivers/media/usb/uvc/uvcvideo.h | 2 ++
3 files changed, 58 insertions(+)
-to: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 8 +---
drivers/media/usb/uvc/uvcvideo.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_video.c
b/drivers/media/usb/uvc/uvc_video.c
ind(key)
!= v2_entity_names_set.end()
test MEDIA_IOC_G_TOPOLOGY: FAIL
fail: v4l2-test-media.cpp(394): num_data_links != num_links
test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_drive
The framework already contains a map of IDs to names, lets use it when
possible.
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
Suggested-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_ctrl.c | 57
drivers/media/usb/uvc/uvc_v4l2.c | 8 -
drivers
Use the device name for the card name instead of vdev->name.
Signed-off-by: Hans Verkuil
Suggested-by: Laurent Pinchart
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_metadata.c | 2 +-
drivers/media/usb/uvc/uvc_v4l2.c | 3 +--
2 files changed, 2 insertions(+), 3 deleti
009a
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: FAIL
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 94
drivers/media/usb/uvc/uvcvideo.h | 5 ++
2 files changed, 99 insertions(+)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Cc: Mike Isely
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
---
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
b
Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 41 --
drivers/media/usb/uvc/uvc_driver.c | 8 +++---
2 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
hart
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 47b0e3224205..397217171bbb 100644
--- a/drivers
Fixes: 6fa6f831f095 ("media: v4l2-ctrls: add core request support")
Suggested-by: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/v4l2-core/v4l2-ioctl.c | 59 ++--
1 file changed, 38 insertions(+), 21 deletions(-)
diff --
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
/S_CTRL: FAIL
fail: v4l2-test-controls.cpp(698): s_ext_ctrls returned an
error (22)
test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
Reviewed-by: Laurent Pinchart
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 5 +
1 file changed
ioctl and fop helpers
Ricardo Ribalda (16):
media: v4l2-ioctl: Fix check_ext_ctrls
media: pvrusb2: Do not check for V4L2_CTRL_WHICH_DEF_VAL
media: uvcvideo: Do not check for V4L2_CTRL_WHICH_DEF_VAL
media: uvcvideo: Set capability in s_param
media: uvcvideo: Return -EIO for control errors
Hi Hans
On Thu, Mar 18, 2021 at 8:48 AM Hans Verkuil wrote:
>
> On 18/03/2021 08:17, Ricardo Ribalda wrote:
> > Hi Hans
> >
> > Can I merge 1-3, but leave 4 as a separate one? It helps to tell a
> > story for 5 and 6.
>
> I really prefer it as a single p
Hi Hans
Can I merge 1-3, but leave 4 as a separate one? It helps to tell a
story for 5 and 6.
Thanks
On Thu, Mar 18, 2021 at 8:14 AM Hans Verkuil wrote:
>
> Hi Ricardo,
>
> On 17/03/2021 17:44, Ricardo Ribalda wrote:
> > Drivers that do not use the ctrl-framework use thi
From: Hans Verkuil
When uvc was written the vb2 ioctl and file operation helpers didn't exist.
This patch switches uvc over to those helpers, which removes a lot of
boilerplate
code and simplifies VIDIOC_G/S_PRIORITY handling and allows us to drop the
'privileges' scheme, since that's now
If a control is inactive return -EACCES to let the userspace know that
the value will not be applied automatically when the control is active
again.
Signed-off-by: Ricardo Ribalda
Suggested-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_ctrl.c | 73 +---
drivers
The framework already contains a map of IDs to names, lets use it when
possible.
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
Suggested-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_ctrl.c | 57
drivers/media/usb/uvc/uvc_v4l2.c | 8 -
drivers
C_G/S/TRY_EXT_CTRLS: FAIL
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 21 +
drivers/media/usb/uvc/uvc_v4l2.c | 39
drivers/media/usb/uvc/uvcvideo.h | 1 +
3 files changed, 56 insertions(+), 5 deletions(-)
diff --
ind(key)
!= v2_entity_names_set.end()
test MEDIA_IOC_G_TOPOLOGY: FAIL
fail: v4l2-test-media.cpp(394): num_data_links != num_links
test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL
Signed-off-by: Ricardo Ribalda
Reviewed-by: Hans Verkuil
---
drivers/media/usb/uvc/uvc_drive
Use the device name for the card name instead of vdev->name.
Suggested-by: Laurent Pinchart
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/
-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 41 --
drivers/media/usb/uvc/uvc_driver.c | 8 +++---
2 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index b3dde98499f4
-to: Hans Verkuil
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_video.c | 8 +---
drivers/media/usb/uvc/uvcvideo.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_video.c
b/drivers/media/usb/uvc/uvc_video.c
unt
warn: v4l2-test-controls.cpp(855): error_idx should be equal to count
Cc: sta...@vger.kernel.org
Fixes: 6fa6f831f095 ("media: v4l2-ctrls: add core request support")
Signed-off-by: Ricardo Ribalda
---
drivers/media/v4l2-core/v4l2-ioctl.c | 3 ++-
1 file changed, 2 insertions(+), 1 dele
009a
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: FAIL
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_ctrl.c | 94
drivers/media/usb/uvc/uvcvideo.h | 5 ++
2 files changed, 99 insertions(+)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers
hart
Reviewed-by: Hans Verkuil
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 47b0e3224205..397217171bbb 100644
--- a/drivers
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Cc: Mike Isely
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
b/drivers/media/usb/pvrusb2
The framework already checks for us if V4L2_CTRL_WHICH_DEF_VAL is
written.
Signed-off-by: Ricardo Ribalda
---
drivers/media/usb/uvc/uvc_v4l2.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 252136cc885c
1 - 100 of 2371 matches
Mail list logo