[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 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 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

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 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-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] 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

Re: add a new dma_alloc_noncontiguous API v2

2021-02-11 Thread Ricardo Ribalda
him? Thanks On Tue, Feb 9, 2021 at 6:02 PM Christoph Hellwig wrote: > > On Tue, Feb 09, 2021 at 03:46:13PM +0100, Ricardo Ribalda wrote: > > Hi Christoph > > > > I have tested it in both arm and x86, since there are not significant > > changes with the previous vers

Re: add a new dma_alloc_noncontiguous API v2

2021-02-11 Thread Ricardo Ribalda
HI Christoph On Thu, Feb 11, 2021 at 2:06 PM Christoph Hellwig wrote: > > On Thu, Feb 11, 2021 at 10:08:18AM +0100, Ricardo Ribalda wrote: > > Hi Christoph > > > > What are your merge plans for the uvc change? > > http://git.infradead.org/us

Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-28 Thread Ricardo Ribalda
On Thu, Jan 28, 2021 at 4:03 PM Christoph Hellwig wrote: > > From: Ricardo Ribalda > > On architectures where the is no coherent caching such as ARM use the > dma_alloc_noncontiguos API and handle manually the cache flushing using > dma_sync_sgtable(). > > With th

Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-28 Thread Ricardo Ribalda
idate_kernel_vmap_range calls for > VIVT architectures. We only read from the device to the cpu. Then can we run only invalidate_kernel_vmap_range() ? something like ? else { dma_sync_sgtable_for_cpu(dma_dev, uvc_urb->sgt, DMA_FROM_DEVICE); invalidate_kernel_vmap_range(uvc_urb->buffer, uvc_urb->stream->urb_size ); } Thanks! -- Ricardo Ribalda

[PATCH v2 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-28 Thread Ricardo Ribalda
td 1.615 min 2806.667 max (uS) raw decode speed: 365.470 Mbits/s raw URB handling speed: 295.986 Mbits/s throughput: 13.136 Mbits/s URB decode CPU usage 3.594500 % Signed-off-by: Ricardo Ribalda Signed-off-by: Christoph Hellwig --- v2: - Replace DMA_BIDIRECTIONAL with DMA_FROM_

Re: add a new dma_alloc_noncontiguous API v2

2021-02-09 Thread Ricardo Ribalda
gt; Ricardo, do the uvcvideo changes look good to you? I'd like to queue > the series up for this merge window. Let me test them in real hardware today. Thanks! -- Ricardo Ribalda

Re: add a new dma_alloc_noncontiguous API v2

2021-02-09 Thread Ricardo Ribalda
Hi Christoph I have tested it in both arm and x86, since there are not significant changes with the previous version I did not do a performance test. Thanks! On Tue, Feb 9, 2021 at 9:29 AM Ricardo Ribalda wrote: > > Hi Christoph > > On Tue, Feb 9, 2021 at 9:22 AM Christoph He

[PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ricardo Ribalda
Clear the reserved fields. Fixes: fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed test VIDIOC_TRY_FMT: FAIL fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed test VIDIOC_S_FMT: FAIL Signed-off-by: Ricardo Ribalda --- drivers/staging/media

Re: [PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ricardo Ribalda
Hi Ezequiel On Mon, Jan 11, 2021 at 12:48 PM Ezequiel Garcia wrote: > > Hi Ricardo, > > On Mon, 2021-01-11 at 12:35 +0100, Ricardo Ribalda wrote: > > Clear the reserved fields. > > > > Fixes: > > fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserve

Re: [PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ricardo Ribalda
Hi Ezequiel On Mon, Jan 11, 2021 at 12:55 PM Ricardo Ribalda wrote: > > Hi Ezequiel > > On Mon, Jan 11, 2021 at 12:48 PM Ezequiel Garcia > wrote: > > > > Hi Ricardo, > > > > On Mon, 2021-01-11 at 12:35 +0100, Ricardo Ribalda wrote: > > &

[PATCH] media: staging/intel-ipu3 : Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Sakari Ailus Signed-off-by: Ricardo Ribalda --- drivers/staging/media/ipu3/ipu3-v4l2.c | 3 --- 1 file changed, 3

[PATCH 2/9] media: mtk-mdp: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Matthias Brugger Signed-off-by: Ricardo Ribalda --- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 3 --- 1 file

[PATCH 1/9] media: ipu3-cio2: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Sakari Ailus Signed-off-by: Ricardo Ribalda --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 3 --- 1 file changed, 3

[PATCH 3/9] media: mtk-vcodec: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Matthias Brugger Signed-off-by: Ricardo Ribalda --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 5 - dri

[PATCH 6/9] media: sum4i-csi: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Maxime Ripard Cc: Chen-Yu Tsai Signed-off-by: Ricardo Ribalda --- drivers/media/platform/sunxi/sun4i-csi/sun4i_

[PATCH 5/9] media: jpu: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Mikhail Ulyanov Signed-off-by: Ricardo Ribalda --- drivers/media/platform/rcar_jpu.c | 5 - 1 file changed, 5

[PATCH 7/9] media: ti-vpe: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Benoit Parrot Signed-off-by: Ricardo Ribalda --- drivers/media/platform/ti-vpe/vpe.c | 2 -- 1 file changed, 2

[PATCH 8/9] media: vicodec: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Hans Verkuil Signed-off-by: Ricardo Ribalda --- drivers/media/test-drivers/vicodec/vicodec-core.c | 5 - 1 file

[PATCH 4/9] media: fdp1: Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: linux-renesas-...@vger.kernel.org Signed-off-by: Ricardo Ribalda --- drivers/media/platform/rcar_fdp1.c | 4 1 fi

[PATCH 9/9] media: staging/intel-ipu3 : Do not zero reserved fields

2021-01-11 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Sakari Ailus Signed-off-by: Ricardo Ribalda --- drivers/staging/media/ipu3/ipu3-v4l2.c | 3 --- 1 file changed, 3

Re: [PATCH] media: staging/intel-ipu3 : Do not zero reserved fields

2021-01-12 Thread Ricardo Ribalda
Hi Kieran On Tue, Jan 12, 2021 at 12:59 PM Kieran Bingham wrote: > > Hi Ricardo, > > On 11/01/2021 14:54, Ricardo Ribalda wrote: > > Core code already clears reserved fields of struct > > v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero >

[PATCH v2 3/9] media: mtk-vcodec: Do not zero reserved fields

2021-01-12 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Matthias Brugger Reviewed-by: Kieran Bingham Signed-off-by: Ricardo Ribalda --- drivers/media/platform/

[PATCH v2 6/9] media: sun4i-csi: Do not zero reserved fields

2021-01-12 Thread Ricardo Ribalda
Core code already clears reserved fields of struct v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields"). Cc: Maxime Ripard Cc: Chen-Yu Tsai Reviewed-by: Kieran Bingham Signed-off-by: Ricardo Ribalda --- drivers/media/plat

[PATCH] ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete

2020-12-11 Thread Ricardo Ribalda
xes: 2d744ecf2b98 ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHL") Signed-off-by: Ricardo Ribalda --- sound/soc/intel/skylake/skl-topology.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sound/soc/inte

[PATCH v5 04/12] media: uvcvideo: Allow extra entities

2020-12-21 Thread Ricardo Ribalda
Signed-off-by: Ricardo Ribalda --- Sorry for a duplicated patch, the previous one the spacing was wrong :( drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/media/usb/uvc/uvcvideo.h | 7 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b

[PATCH v5 04/12] media: uvcvideo: Allow extra entities

2020-12-21 Thread Ricardo Ribalda
Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/media/usb/uvc/uvcvideo.h | 7 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index bfbc5a4d4ca6..82cdd1bb28dc

[PATCH v5 00/12]Show privacy_gpio as a v4l2_ctrl

2020-12-21 Thread Ricardo Ribalda
ll the comments from Laurent! - move guid to unit - support entities with no pads - CodeStyle - Irq handling - pr_cont - new ids Ricardo Ribalda (12): media: uvcvideo: Fix race condition handling events media: uvcvideo: Allow more that one asyc_ctrl media: uvcvideo: Move gu

[PATCH v5 06/12] media: uvcvideo: Allow entity-defined get_info and get_cur

2020-12-21 Thread Ricardo Ribalda
Allows controls to get their properties and current value from an entity-defined function instead of via a query to the USB device. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 22 ++ drivers/media/usb/uvc/uvcvideo.h

[PATCH v5 12/12] media: uvcvideo: use dev_dbg() for uvc_trace()

2020-12-21 Thread Ricardo Ribalda
Instead of calling prink() inside uvc_trace, use dev_dbg(), which add context to the output. Now that we are at it, regroup the strings so the messages can be easily "grepable". Suggested-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl

[PATCH v5 02/12] media: uvcvideo: Allow more that one asyc_ctrl

2020-12-21 Thread Ricardo Ribalda
The current implementation allocates memory for only one async_control. If we get a second event before we have processed the previous one, the old one gets lost. Introduce a dynamic memory allocation and a list to handle the async_controls. Signed-off-by: Ricardo Ribalda --- drivers/media/usb

[PATCH v5 07/12] media: uvcvideo: Implement UVC_EXT_GPIO_UNIT

2020-12-21 Thread Ricardo Ribalda
RHUB.HS07, Zero, Zero, One } } } }) } Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 7 ++ drivers/media/usb/uvc/uvc_driver.c | 156 + drivers/media/usb/uvc/uvc_enti

[PATCH v5 05/12] media: uvcvideo: Allow entities with no pads

2020-12-21 Thread Ricardo Ribalda
Avoid an underflow while calculating the number of inputs for entities with zero pads. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc

[PATCH v5 03/12] media: uvcvideo: Move guid to entity

2020-12-21 Thread Ricardo Ribalda
Instead of having multiple copies of the entity guid on the code, move it to the entity structure. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 30 -- drivers/media/usb/uvc/uvc_driver.c | 25

[PATCH v5 11/12] media: uvcvideo: New macro uvc_trace_cont

2020-12-21 Thread Ricardo Ribalda
Remove all the duplicated code around printk(KERN_CONT, with a new macro. Reviewed-by: Laurent Pinchart Suggested-by: Joe Perches Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 57 +++--- drivers/media/usb/uvc/uvcvideo.h | 6 2 files

[PATCH v5 01/12] media: uvcvideo: Fix race condition handling events

2020-12-21 Thread Ricardo Ribalda
The control and its data needs to be copied to the workqueue at the same time to avoid half-updates of the events. This is, events reported to userspace were the control id does not match its value. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 2 +- drivers/media/usb

[PATCH v5 09/12] media: uvcvideo: Implement UVC_QUIRK_PRIVACY_DURING_STREAM

2020-12-21 Thread Ricardo Ribalda
Some devices, can only read the privacy_pin if the device is streaming. This patch implement a quirk for such devices, in order to avoid invalid reads and/or spurious events. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 57 -- drivers

[PATCH v5 10/12] media: uvcvideo: Use dev_ printk aliases

2020-12-21 Thread Ricardo Ribalda
Perches Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 12 +++ drivers/media/usb/uvc/uvc_driver.c | 50 -- drivers/media/usb/uvc/uvc_entity.c | 10 +++--- drivers/media/usb/uvc/uvc_status.c | 13 drivers/media/usb/uvc/uvc_video.c | 48

[PATCH v5 08/12] media: uvcvideo: Add Privacy control based on EXT_GPIO

2020-12-21 Thread Ricardo Ribalda
Add a new control and mapping for Privacy controls connected to UVC_GUID_EXT_GPIO_CONTROLLERs. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/usb/uvc

Re: [PATCH v5 07/12] media: uvcvideo: Implement UVC_EXT_GPIO_UNIT

2020-12-22 Thread Ricardo Ribalda
Hi Laurent Thanks for your review! On Tue, Dec 22, 2020 at 9:34 AM Laurent Pinchart wrote: > > Hi Ricardo, > > Thank you for the patch. > > On Mon, Dec 21, 2020 at 05:48:14PM +0100, Ricardo Ribalda wrote: > > Some devices can implement a physical switch to disable the in

Re: [PATCH v5 09/12] media: uvcvideo: Implement UVC_QUIRK_PRIVACY_DURING_STREAM

2020-12-22 Thread Ricardo Ribalda
HI Laurent Thanks for your review! On Tue, Dec 22, 2020 at 11:30 AM Laurent Pinchart wrote: > > Hi Ricardo, > > Thank you for the patch. > > On Mon, Dec 21, 2020 at 05:48:16PM +0100, Ricardo Ribalda wrote: > > Some devices, can only read the privacy_pin if the device i

[PATCH v6 01/11] media: uvcvideo: Move guid to entity

2020-12-22 Thread Ricardo Ribalda
Instead of having multiple copies of the entity guid on the code, move it to the entity structure. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 30 -- drivers/media/usb/uvc/uvc_driver.c | 25

[PATCH v6 02/11] media: uvcvideo: Allow extra entities

2020-12-22 Thread Ricardo Ribalda
Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/media/usb/uvc/uvcvideo.h | 7 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index bfbc5a4d4ca6..82cdd1bb28dc

[PATCH v6 00/11] Show privacy_gpio as a v4l2_ctrl

2020-12-22 Thread Ricardo Ribalda
2: Thanks to all the comments from Laurent! - move guid to unit - support entities with no pads - CodeStyle - Irq handling - pr_cont - new ids Ricardo Ribalda (11): media: uvcvideo: Move guid to entity media: uvcvideo: Allow extra entities media: uvcvideo: Allow entities with no pa

[PATCH v6 03/11] media: uvcvideo: Allow entities with no pads

2020-12-22 Thread Ricardo Ribalda
Avoid an underflow while calculating the number of inputs for entities with zero pads. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc

[PATCH v6 07/11] media: uvcvideo: Add Privacy control based on EXT_GPIO

2020-12-22 Thread Ricardo Ribalda
Add a new control and mapping for Privacy controls connected to UVC_GUID_EXT_GPIO_CONTROLLERs. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/usb/uvc

[PATCH v6 08/11] media: uvcvideo: Implement UVC_QUIRK_PRIVACY_DURING_STREAM

2020-12-22 Thread Ricardo Ribalda
Some devices can only read the privacy_pin if the device is streaming. This patch implement a quirk for such devices, in order to avoid invalid reads and/or spurious events. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 37 -- drivers/media

[PATCH v6 11/11] media: uvcvideo: use dev_printk() for uvc_trace()

2020-12-22 Thread Ricardo Ribalda
Instead of calling prink() inside uvc_trace, use dev_printk(), which adds context to the output. Now that we are at it, regroup the strings so the messages can be easily "grepable". Reviewed-by: Laurent Pinchart Suggested-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- dri

[PATCH v6 10/11] media: uvcvideo: New macro uvc_trace_cont

2020-12-22 Thread Ricardo Ribalda
Remove all the duplicated code around printk(KERN_CONT, with a new macro. Reviewed-by: Laurent Pinchart Suggested-by: Joe Perches Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 57 +++--- drivers/media/usb/uvc/uvcvideo.h | 6 2 files

[PATCH v6 09/11] media: uvcvideo: Use dev_ printk aliases

2020-12-22 Thread Ricardo Ribalda
Perches Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 12 +++ drivers/media/usb/uvc/uvc_driver.c | 50 -- drivers/media/usb/uvc/uvc_entity.c | 10 +++--- drivers/media/usb/uvc/uvc_status.c | 13 drivers/media/usb/uvc/uvc_video.c | 48

[PATCH v6 06/11] media: uvcvideo: Implement UVC_EXT_GPIO_UNIT

2020-12-22 Thread Ricardo Ribalda
RHUB.HS07, Zero, Zero, One } } } }) } Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 3 + drivers/media/usb/uvc/uvc_driver.c | 133 + drivers/media/usb/uvc/uvc_enti

[PATCH v6 04/11] media: uvcvideo: Add uvc_ctrl_status_event_direct

2020-12-22 Thread Ricardo Ribalda
Provide a code path for events that can be sent without a work-queue, this is, that do not belong to an URB and are not handled in the top half on an irq-handled. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 35 +++- drivers/media/usb/uvc

[PATCH v6 05/11] media: uvcvideo: Allow entity-defined get_info and get_cur

2020-12-22 Thread Ricardo Ribalda
Allows controls to get their properties and current value from an entity-defined function instead of via a query to the USB device. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 22 ++ drivers/media/usb/uvc/uvcvideo.h

Re: [PATCH v5 09/12] media: uvcvideo: Implement UVC_QUIRK_PRIVACY_DURING_STREAM

2020-12-23 Thread Ricardo Ribalda
Hi Laurent On Wed, Dec 23, 2020 at 9:05 AM Laurent Pinchart wrote: > > Hi Ricardo, > > On Tue, Dec 22, 2020 at 09:04:19PM +0100, Ricardo Ribalda wrote: > > On Tue, Dec 22, 2020 at 11:30 AM Laurent Pinchart wrote: > > > On Mon, Dec 21, 2020 at 05:48:16PM +0100, Ricardo

Re: [PATCH v5 09/12] media: uvcvideo: Implement UVC_QUIRK_PRIVACY_DURING_STREAM

2020-12-23 Thread Ricardo Ribalda
Hi again On Wed, Dec 23, 2020 at 9:31 AM Ricardo Ribalda wrote: > > Hi Laurent > > On Wed, Dec 23, 2020 at 9:05 AM Laurent Pinchart > wrote: > > > > Hi Ricardo, > > > > On Tue, Dec 22, 2020 at 09:04:19PM +0100, Ricardo Ribalda wrote: > > > On Tue,

[PATCH v7 03/12] media: uvcvideo: Allow entities with no pads

2020-12-23 Thread Ricardo Ribalda
Avoid an underflow while calculating the number of inputs for entities with zero pads. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc

[PATCH v7 00/12] Show privacy_gpio as a v4l2_ctrl

2020-12-23 Thread Ricardo Ribalda
nt! - move guid to unit - support entities with no pads - CodeStyle - Irq handling - pr_cont - new ids Joe Perches (1): media: uvcvideo: Rename debug functions Ricardo Ribalda (11): media: uvcvideo: Move guid to entity media: uvcvideo: Allow extra entities media: uvcvideo: Allow e

[PATCH v7 06/12] media: uvcvideo: Implement UVC_EXT_GPIO_UNIT

2020-12-23 Thread Ricardo Ribalda
RHUB.HS07, Zero, Zero, One } } } }) } Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 3 + drivers/media/usb/uvc/uvc_driver.c | 127 + drivers/media/usb/uvc/uvc_enti

[PATCH v7 09/12] media: uvcvideo: New macro uvc_trace_cont

2020-12-23 Thread Ricardo Ribalda
Remove all the duplicated code around printk(KERN_CONT, with a new macro. Reviewed-by: Laurent Pinchart Suggested-by: Joe Perches Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 57 +++--- drivers/media/usb/uvc/uvcvideo.h | 6 2 files

[PATCH v7 12/12] media: uvcvideo: Implement UVC_QUIRK_PRIVACY_DURING_STREAM

2020-12-23 Thread Ricardo Ribalda
Some devices can only read the privacy_pin if the device is streaming. This patch implement a quirk for such devices, in order to avoid invalid reads and/or spurious events. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 55 +++--- drivers/media

[PATCH v7 07/12] media: uvcvideo: Add Privacy control based on EXT_GPIO

2020-12-23 Thread Ricardo Ribalda
Add a new control and mapping for Privacy controls connected to UVC_GUID_EXT_GPIO_CONTROLLERs. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/usb/uvc

[PATCH v7 02/12] media: uvcvideo: Allow extra entities

2020-12-23 Thread Ricardo Ribalda
Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/media/usb/uvc/uvcvideo.h | 7 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index bfbc5a4d4ca6..82cdd1bb28dc

[PATCH v7 08/12] media: uvcvideo: Use dev_ printk aliases

2020-12-23 Thread Ricardo Ribalda
Perches Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 12 +++ drivers/media/usb/uvc/uvc_driver.c | 50 -- drivers/media/usb/uvc/uvc_entity.c | 10 +++--- drivers/media/usb/uvc/uvc_status.c | 13 drivers/media/usb/uvc/uvc_video.c | 48

[PATCH v7 11/12] media: uvcvideo: Rename debug functions

2020-12-23 Thread Ricardo Ribalda
From: Joe Perches trace isn't a good name as it's not a trace mechanism, it is a typical debug mechanism. Rename uvc_trace/uvc_trace_cont macros to uvc_dbg/uvc_dbg_cont. Rename uvc_trace_param to uvc_dbg_param Rename UVC_TRACE_ defines to UVC_DBG_ Use ## concatenation in uvc_dbg macros to avoid

[PATCH v7 01/12] media: uvcvideo: Move guid to entity

2020-12-23 Thread Ricardo Ribalda
Instead of having multiple copies of the entity guid on the code, move it to the entity structure. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 30 -- drivers/media/usb/uvc/uvc_driver.c | 25

[PATCH v7 05/12] media: uvcvideo: Allow entity-defined get_info and get_cur

2020-12-23 Thread Ricardo Ribalda
Allows controls to get their properties and current value from an entity-defined function instead of via a query to the USB device. Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 22 ++ drivers/media/usb/uvc/uvcvideo.h

[PATCH v7 10/12] media: uvcvideo: use dev_printk() for uvc_trace()

2020-12-23 Thread Ricardo Ribalda
Instead of calling prink() inside uvc_trace, use dev_printk(), which adds context to the output. Now that we are at it, regroup the strings so the messages can be easily "grepable". Reviewed-by: Laurent Pinchart Suggested-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- dri

[PATCH v7 04/12] media: uvcvideo: Provide sync and async uvc_ctrl_status_event

2020-12-23 Thread Ricardo Ribalda
Split the functionality of void uvc_ctrl_status_event_work in two, so it can be called by functions outside interrupt context and not part of an URB. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 25 +++-- drivers/media/usb/uvc/uvc_status.c | 3

Re: [PATCH v6 11/11] media: uvcvideo: use dev_printk() for uvc_trace()

2020-12-23 Thread Ricardo Ribalda
Hi Joe On Wed, Dec 23, 2020 at 12:30 PM Joe Perches wrote: > > Perhaps this on top. > > trace isn't a good name as it's not a trace mechanism, it is a > typical debug mechanism. > > Rename uvc_trace/uvc_trace_cont macros to uvc_dbg/uvc_dbg_cont. > Rename uvc_trace_param to uvc_dbg_param > Rename

Re: [PATCH] media: hantro: Fix reset_raw_fmt initialization

2021-01-19 Thread Ricardo Ribalda
Hi Gustavo On Mon, Jan 18, 2021 at 11:26 PM Gustavo A. R. Silva wrote: > > Hey Ricardo, > > On 1/14/21 07:03, Ricardo Ribalda wrote: > > raw_fmt->height in never initialized. But width in initialized twice. > > Nice catch! Thanks :) > > How did you find this

Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-07 Thread Ricardo Ribalda
t; I think between your comments and those from Ricardo I have a good idea > for a somewhat updated API. I'll try to post something in the next days. Did you have time to look into this? No hurry, I just want to make sure that I didn't miss anything ;) Best regards! -- Ricardo Ribalda

[PATCH] media: hantro: Fix reset_raw_fmt initialization

2021-01-14 Thread Ricardo Ribalda
raw_fmt->height in never initialized. But width in initialized twice. Fixes: 88d06362d1d05 ("media: hantro: Refactor for V4L2 API spec compliancy") Signed-off-by: Ricardo Ribalda --- drivers/staging/media/hantro/hantro_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v7 00/17] uvcvideo: Fix v4l2-compliance errors

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

[PATCH v7 04/17] media: uvcvideo: Set capability in s_param

2021-03-18 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 47b0e3224205..397217171bbb 100644 --- a/dr

[PATCH v7 01/17] media: v4l2-ioctl: Fix check_ext_ctrls

2021-03-18 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 | 59 ++-- 1 file changed, 38 insertions(+), 21 deletio

[PATCH v7 02/17] media: pvrusb2: Do not check for V4L2_CTRL_WHICH_DEF_VAL

2021-03-18 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 v7 06/17] media: uvcvideo: refactor __uvc_ctrl_add_mapping

2021-03-18 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 v7 03/17] media: uvcvideo: Do not check for V4L2_CTRL_WHICH_DEF_VAL

2021-03-18 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 v7 05/17] media: uvcvideo: Return -EIO for control errors

2021-03-18 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 v7 07/17] media: uvcvideo: Add support for V4L2_CTRL_TYPE_CTRL_CLASS

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

[PATCH v7 12/17] media: uvcvideo: Check controls flags before accessing them

2021-03-18 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 v7 10/17] media: uvcvideo: Increase the size of UVC_METADATA_BUF_SIZE

2021-03-18 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 v7 09/17] media: uvcvideo: Set unique vdev name based in type

2021-03-18 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 v7 11/17] media: uvcvideo: Use control names from framework

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

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

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

[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 08/17] media: uvcvideo: Use dev->name for querycap()

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

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

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: [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: [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_

  1   2   3   4   5   6   7   8   9   10   >