Re: [PATCH v5 07/13] media: i2c: imx214: Add vblank and hblank controls

2024-12-19 Thread Ricardo Ribalda Delgado
On Tue, Dec 17, 2024 at 10:39 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Add vblank control to allow changing the framerate / > higher exposure values. > > The vblank and hblank controls are needed for libcamera support. > > While at it, fix the minimal exposure time accor

Re: [PATCH v5 12/13] media: i2c: imx214: Fix clock handling on probe error or remove

2024-12-19 Thread Ricardo Ribalda Delgado
off(). > > Signed-off-by: André Apitzsch Acked-by: Ricardo Ribalda > --- > drivers/media/i2c/imx214.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c > i

Re: [PATCH v4 01/13] media: i2c: imx214: Use subdev active state

2024-12-16 Thread Ricardo Ribalda Delgado
Hi Andre On Mon, Dec 16, 2024 at 10:01 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Port the imx214 sensor driver to use the subdev active state. > > Move all the format configuration to the subdevice state and simplify > the format handling, locking and initialization. > >

Re: [PATCH v3 07/12] media: i2c: imx214: Add vblank and hblank controls

2024-12-16 Thread Ricardo Ribalda Delgado
> > Is the handler->lock held when we call this function? > > I'm not sure how to test this. > > > Can you try > > running the code with lockdep? > > /proc/lockdep contains > > > f9299231 FD: 89 BD:6 +.+.: imx214:901:(&imx214->ctrls)->_lock > > (no idea how to interpret this line) > >

Re: [PATCH v3 07/12] media: i2c: imx214: Add vblank and hblank controls

2024-12-08 Thread Ricardo Ribalda Delgado
On Sun, Dec 8, 2024 at 10:35 PM André Apitzsch wrote: > > Hi Ricardo, > > Am Sonntag, dem 08.12.2024 um 21:59 +0100 schrieb Ricardo Ribalda > Delgado: > > In general it looks good to me (besides the comments, ignore the nits > > if you want to). > > > > I&#x

Re: [PATCH v3 07/12] media: i2c: imx214: Add vblank and hblank controls

2024-12-08 Thread Ricardo Ribalda Delgado
On Sun, Dec 8, 2024 at 9:59 PM Ricardo Ribalda Delgado wrote: > > In general it looks good to me (besides the comments, ignore the nits > if you want to). > > I'd recommend that you test with lockdep to make sure that we are not > missing anything, and I'd like to hea

Re: [PATCH v3 06/12] media: i2c: imx214: Check number of lanes from device tree

2024-12-08 Thread Ricardo Ribalda Delgado
Acked-by: Ricardo Ribalda On Sat, Dec 7, 2024 at 9:48 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The imx214 camera is capable of either two-lane or four-lane operation. > > Currently only the four-lane mode is supported, as proper pixel rates > an

Re: [PATCH v3 12/12] media: i2c: imx214: Fix link frequency

2024-12-08 Thread Ricardo Ribalda Delgado
Acked-by: Ricardo Ribalda nit: media: i2c: imx214: Fix link frequency validation On Sat, Dec 7, 2024 at 9:49 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The driver defines IMX214_DEFAULT_LINK_FREQ 48000, and then > IMX214_DEF

Re: [PATCH v3 07/12] media: i2c: imx214: Add vblank and hblank controls

2024-12-08 Thread Ricardo Ribalda Delgado
In general it looks good to me (besides the comments, ignore the nits if you want to). I'd recommend that you test with lockdep to make sure that we are not missing anything, and I'd like to hear back from Sakari regarding the get_locked_active Thanks! On Sat, Dec 7, 2024 at 9:48 PM André Apitzs

Re: [PATCH v2 09/13] media: i2c: imx214: Extract format and crop settings

2024-11-20 Thread Ricardo Ribalda Delgado
Hi André On Wed, Nov 20, 2024 at 9:07 PM André Apitzsch wrote: > > Hi Ricardo, > > Am Mittwoch, dem 30.10.2024 um 13:10 +0100 schrieb Ricardo Ribalda > Delgado: > > Hi > > > > Aren't you changing the binning mode for 1920x1080 with this patch? > > I

Re: [PATCH v2 02/13] media: i2c: imx214: Use subdev active state

2024-10-30 Thread Ricardo Ribalda Delgado
Hi It looks good to me, but I would like Sakari to review it. I am not sure if it is ok to keep the cur_mode variable. On Mon, Oct 21, 2024 at 12:14 AM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Port the imx214 sensor driver to use the subdev active state. > > Move all the

Re: [PATCH v2 10/13] media: i2c: imx214: Implement vflip/hflip controls

2024-10-30 Thread Ricardo Ribalda Delgado
On Mon, Oct 21, 2024 at 12:14 AM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The imx214 sensor supports horizontal and vertical flipping. Add > appropriate controls to the driver. > > Signed-off-by: André Apitzsch Acked-by: Ricardo Ribalda > --- >

Re: [PATCH v2 09/13] media: i2c: imx214: Extract format and crop settings

2024-10-30 Thread Ricardo Ribalda Delgado
Hi Aren't you changing the binning mode for 1920x1080 with this patch? I think that could be considered an ABI change. Also, if we are not letting the user change the value, I do not see much value in setting the cropping programmatically, I'd rather not take this change. On Mon, Oct 21, 2024 a

Re: [PATCH v2 08/13] media: i2c: imx214: Add vblank and hblank controls

2024-10-30 Thread Ricardo Ribalda Delgado
On Mon, Oct 21, 2024 at 12:14 AM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Add vblank control to allow changing the framerate / > higher exposure values. > > The vblank and hblank controls are needed for libcamera support. > > While at it, fix the minimal exposure time accor

Re: [PATCH v2 07/13] media: i2c: imx214: Check number of lanes from device tree

2024-10-30 Thread Ricardo Ribalda Delgado
On Mon, Oct 21, 2024 at 12:14 AM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The imx214 camera is capable of either two-lane or four-lane operation. > > Currently only the four-lane mode is supported, as proper pixel rates > and link frequences for the two-lane mode are unknow

Re: [PATCH v2 01/13] media: i2c: imx214: Fix link frequency

2024-10-30 Thread Ricardo Ribalda Delgado
Hi Andre On Mon, Oct 21, 2024 at 12:14 AM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The driver defines IMX214_DEFAULT_LINK_FREQ 48000, and then > IMX214_DEFAULT_PIXEL_RATE ((IMX214_DEFAULT_LINK_FREQ * 8LL) / 10), > which works out as 384MPix/s. (The 8 is 4 lanes and DDR

Re: [PATCH 02/13] media: i2c: imx214: Remove unneeded goto

2024-09-12 Thread Ricardo Ribalda Delgado
Hi Andre On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Simplify the imx214_start_streaming() by removing unneeded goto > statements, and the corresponding error label. Could you squash this patch with the previous one? Thanks! > > Signed-off

Re: [PATCH 01/13] media: i2c: imx214: Use subdev active state

2024-09-12 Thread Ricardo Ribalda Delgado
Hi Andre I don't have access to the hardware anymore, so I cannot test this... but looking at the code I am not sure how it is working... I would assume that after moving to the subdev active state, you need to remove struct v4l2_mbus_framefmt fmt; struct v4l2_rect crop; for struct imx214. Aft

Re: [PATCH 03/13] media: i2c: imx214: Simplify with dev_err_probe()

2024-09-12 Thread Ricardo Ribalda Delgado
On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Error handling in probe() can be a bit simpler with dev_err_probe(). > Acked-by: Ricardo Ribalda > Signed-off-by: André Apitzsch > --- > drivers

Re: [PATCH 04/13] media: i2c: imx214: Convert to CCI register access helpers

2024-09-12 Thread Ricardo Ribalda Delgado
On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Use the new common CCI register access helpers to replace the private > register access helpers in the imx214 driver. This simplifies the driver > by reducing the amount of code. &

Re: [PATCH 05/13] media: i2c: imx214: Replace register addresses with macros

2024-09-12 Thread Ricardo Ribalda Delgado
the documentation? > > Signed-off-by: André Apitzsch Acked-by: Ricardo Ribalda > --- > drivers/media/i2c/imx214.c | 407 > ++--- > 1 file changed, 236 insertions(+), 171 deletions(-) > > diff --git a/drivers/media/i2c/imx214.c b/drive

Re: [PATCH 06/13] media: i2c: imx214: Drop IMX214_REG_EXPOSURE from mode reg arrays

2024-09-12 Thread Ricardo Ribalda Delgado
gt; Signed-off-by: André Apitzsch Acked-by: Ricardo Ribalda > --- > drivers/media/i2c/imx214.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c > index 91664e188fd0..4507e12dd4cd 100644 > --- a/drivers/media/i2

Re: [PATCH 07/13] media: i2c: imx214: Use number of lanes from device tree

2024-09-12 Thread Ricardo Ribalda Delgado
Hi On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The imx214 camera is capable of either two-lane or four-lane operation. > > Currently only the four-lane mode is supported, as proper pixel rates > and link frequences for the two-lane mode are unk

Re: [PATCH 09/13] media: i2c: imx214: Extract format and crop settings

2024-09-12 Thread Ricardo Ribalda Delgado
On Mon, Sep 2, 2024 at 11:54 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Remove format and crop settings from register sequences and set them > programmatically. > > Signed-off-by: André Apitzsch > --- > drivers/media/i2c/imx214.c | 137 >

Re: [PATCH 10/13] media: i2c: imx214: Implement vflip/hflip controls

2024-09-12 Thread Ricardo Ribalda Delgado
On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The imx214 sensor supports horizontal and vertical flipping. Add > appropriate controls to the driver. > > Signed-off-by: André Apitzsch > --- > drivers/media/i2c/imx214.c | 73 > +++

Re: [PATCH 08/13] media: i2c: imx214: Add vblank and hblank controls

2024-09-12 Thread Ricardo Ribalda Delgado
Hi Arent you missing some chage in enum_frame_interval? On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Add vblank control to allow changing the framerate / > higher exposure values. > > The vblank and hblank controls are needed for libcamera supp

Re: [PATCH 11/13] media: i2c: imx214: Add analogue/digital gain control

2024-09-12 Thread Ricardo Ribalda Delgado
patch. > Acked-by: Ricardo Ribalda > Signed-off-by: André Apitzsch > > --- > > With the analogue gain control added by this patch, the kernel log shows > the following message when closing megapixels and a similar one when > closing qcam (from libcamera):

Re: [PATCH 12/13] media: i2c: imx214: Verify chip ID

2024-09-12 Thread Ricardo Ribalda Delgado
On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Check the chip ID and stop probing if it is no imx214 sensor. > > Signed-off-by: André Apitzsch Acked-by: Ricardo Ribalda > --- > drivers/media/i2c/imx214.c | 29 ++

Re: [PATCH 13/13] media: i2c: imx214: Add test pattern control

2024-09-12 Thread Ricardo Ribalda Delgado
On Mon, Sep 2, 2024 at 11:53 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > This adds V4L2_CID_TEST_PATTERN control support. > > Signed-off-by: André Apitzsch Acked-by: Ricardo Ribalda > --- > drivers

Re: [PATCH v2 3/3] media: mediatek: vcodedc: Fix Wcast-function-type-strict warnings

2024-02-27 Thread Ricardo Ribalda
your 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, > >

[PATCH v2 2/3] media: usb: pvrusb2: Fix Wcast-function-type-strict warnings

2024-02-26 Thread Ricardo Ribalda
ast from 'void (*)(struct pvr2_dvb_adapter *)' 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 |

Re: [PATCH v2 3/3] media: mediatek: vcodedc: Fix Wcast-function-type-strict warnings

2024-02-26 Thread Ricardo Ribalda
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 *, un

[PATCH v2 1/3] media: pci: sta2x11: Fix Wcast-function-type-strict warnings

2024-02-26 Thread Ricardo Ribalda
urn (*)(int, void *)') converts 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/st

[PATCH v2 3/3] media: mediatek: vcodedc: Fix Wcast-function-type-strict warnings

2024-02-26 Thread Ricardo Ribalda
, unsigned int, void *)') converts 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/mediat

[PATCH v2 0/3] media: Fix warnings building with LLVM=1

2024-02-26 Thread Ricardo Ribalda
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

[PATCH] media: staging/intel-ipu3: Fix race condition during set_fmt

2021-04-09 Thread Ricardo Ribalda
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

[PATCH RESEND] lib/scatterlist: Fix NULL pointer deference

2021-04-06 Thread Ricardo Ribalda
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

Re: [PATCH 1/2] lib/scatterlist: Fix NULL pointer deference

2021-04-06 Thread Ricardo Ribalda
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

Re: [PATCH v2 1/2] media: staging/intel-ipu3: Fix memory leak in imu_fmt

2021-04-06 Thread Ricardo Ribalda
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

[PATCH] IMA: Fix error in comment

2021-03-29 Thread Ricardo Ribalda
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

Re: [PATCH v9 19/22] uvcvideo: uvc_ctrl_is_accessible: check for INACTIVE

2021-03-27 Thread Ricardo Ribalda Delgado
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

Re: [PATCH v9 17/22] media: docs: Document the behaviour of uvcdriver

2021-03-27 Thread Ricardo Ribalda
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

[PATCH v9 22/22] uvc: use vb2 ioctl and fop helpers

2021-03-26 Thread 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 handl

[PATCH v9 21/22] uvcvideo: don't spam the log in uvc_ctrl_restore_values()

2021-03-26 Thread Ricardo Ribalda
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 a/drivers/media/u

[PATCH v9 19/22] uvcvideo: uvc_ctrl_is_accessible: check for INACTIVE

2021-03-26 Thread Ricardo Ribalda
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 err

[PATCH v9 20/22] uvcvideo: improve error handling in uvc_query_ctrl()

2021-03-26 Thread Ricardo Ribalda
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 ret

[PATCH v9 15/22] media: uvcvideo: Set error_idx during ctrl_commit errors

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 17/22] media: docs: Document the behaviour of uvcdriver

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 18/22] media: uvcvideo: Downgrade control error messages

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 12/22] media: uvcvideo: Increase the size of UVC_METADATA_BUF_SIZE

2021-03-26 Thread Ricardo Ribalda
: 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

[PATCH v9 14/22] media: uvcvideo: Check controls flags before accessing them

2021-03-26 Thread Ricardo Ribalda
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(+)

[PATCH v9 16/22] media: uvcvideo: Return -EACCES to inactive controls

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 13/22] media: uvcvideo: Use control names from framework

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 11/22] media: uvcvideo: Set unique vdev name based in type

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 10/22] media: uvcvideo: Use dev->name for querycap()

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 08/22] media: uvcvideo: refactor __uvc_ctrl_add_mapping

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 06/22] media: uvcvideo: Set capability in s_param

2021-03-26 Thread Ricardo Ribalda
Pinchart 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/dr

[PATCH v9 09/22] media: uvcvideo: Add support for V4L2_CTRL_TYPE_CTRL_CLASS

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 07/22] media: uvcvideo: Return -EIO for control errors

2021-03-26 Thread Ricardo Ribalda
/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

[PATCH v9 02/22] media: pvrusb2: Do not check for V4L2_CTRL_WHICH_DEF_VAL

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 05/22] media: uvcvideo: Remove s_ctrl and g_ctrl

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 04/22] media: v4l2-ioctl: S_CTRL output the right value

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 03/22] media: uvcvideo: Do not check for V4L2_CTRL_WHICH_DEF_VAL

2021-03-26 Thread Ricardo Ribalda
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

[PATCH v9 01/22] media: v4l2-ioctl: Fix check_ext_ctrls

2021-03-26 Thread Ricardo Ribalda
sta...@vger.kernel.org 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 deletio

[PATCH v9 00/22] uvcvideo: Fix v4l2-compliance errors

2021-03-26 Thread Ricardo Ribalda
og 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

Re: [PATCHv3 3/6] media: v4l UAPI: add ROI auto-controls flags

2021-03-24 Thread Ricardo Ribalda
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

Re: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control

2021-03-23 Thread Ricardo Ribalda
> @@ -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

Re: [PATCHv3 2/6] media: v4l UAPI: document ROI selection targets

2021-03-23 Thread Ricardo Ribalda
nterest rectangle and minimum > + 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

Re: [PATCHv3 3/6] media: v4l UAPI: add ROI auto-controls flags

2021-03-23 Thread 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

[PATCH v8 19/19] uvc: use vb2 ioctl and fop helpers

2021-03-19 Thread 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 handl

[PATCH v8 16/19] media: uvcvideo: Return -EACCES to inactive controls

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 18/19] media: uvcvideo: Downgrade control error messages

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 11/19] media: uvcvideo: Set unique vdev name based in type

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 14/19] media: uvcvideo: Check controls flags before accessing them

2021-03-19 Thread Ricardo Ribalda
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(+)

[PATCH v8 17/19] media: docs: Document the behaviour of uvcdriver

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 15/19] media: uvcvideo: Set error_idx during ctrl_commit errors

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 13/19] media: uvcvideo: Use control names from framework

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 12/19] media: uvcvideo: Increase the size of UVC_METADATA_BUF_SIZE

2021-03-19 Thread Ricardo Ribalda
: 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

[PATCH v8 07/19] media: uvcvideo: Return -EIO for control errors

2021-03-19 Thread Ricardo Ribalda
/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

[PATCH v8 03/19] media: uvcvideo: Do not check for V4L2_CTRL_WHICH_DEF_VAL

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 08/19] media: uvcvideo: refactor __uvc_ctrl_add_mapping

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 09/19] media: uvcvideo: Add support for V4L2_CTRL_TYPE_CTRL_CLASS

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 10/19] media: uvcvideo: Use dev->name for querycap()

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 05/19] media: uvcvideo: Remove s_ctrl and g_ctrl

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 06/19] media: uvcvideo: Set capability in s_param

2021-03-19 Thread Ricardo Ribalda
Pinchart 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/dr

[PATCH v8 04/19] media: v4l2-ioctl: S_CTRL output the right value

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 01/19] media: v4l2-ioctl: Fix check_ext_ctrls

2021-03-19 Thread Ricardo Ribalda
sta...@vger.kernel.org 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 deletio

[PATCH v8 02/19] media: pvrusb2: Do not check for V4L2_CTRL_WHICH_DEF_VAL

2021-03-19 Thread Ricardo Ribalda
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

[PATCH v8 00/19] uvcvideo: Fix v4l2-compliance errors

2021-03-19 Thread Ricardo Ribalda
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

Re: [PATCHv2 3/3] media: uvcvideo: add UVC 1.5 ROI control

2021-03-19 Thread Ricardo Ribalda
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 verify that &

Re: [PATCH v7 15/17] media: uvcvideo: Refactor __uvc_ctrl_commit

2021-03-19 Thread Ricardo Ribalda Delgado
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

Re: [PATCH v4 6/6] media: uvcvideo: Use dma_alloc_noncontiguous API

2021-03-19 Thread Ricardo Ribalda
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->

Re: [PATCH v4 6/6] media: uvcvideo: Use dma_alloc_noncontiguous API

2021-03-19 Thread Ricardo Ribalda
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_

Re: [PATCH v7 13/17] media: uvcvideo: Return -EACCES to inactive controls

2021-03-19 Thread Ricardo Ribalda
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

Re: [PATCHv2 3/3] media: uvcvideo: add UVC 1.5 ROI control

2021-03-18 Thread Ricardo Ribalda
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? > >

Re: [PATCHv2 3/3] media: uvcvideo: add UVC 1.5 ROI control

2021-03-18 Thread Ricardo Ribalda
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/uapi/v4l/vid

[PATCH v7 13/17] media: uvcvideo: Return -EACCES to inactive controls

2021-03-18 Thread Ricardo Ribalda
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

[PATCH v7 17/17] uvc: use vb2 ioctl and fop helpers

2021-03-18 Thread 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 handl

[PATCH v7 16/17] media: uvcvideo: Set error_idx during ctrl_commit errors

2021-03-18 Thread Ricardo Ribalda
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

[PATCH v7 14/17] media: docs: Document the behaviour of uvcdriver

2021-03-18 Thread Ricardo Ribalda
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

  1   2   3   4   5   6   7   8   9   10   >