* [PATCH] media: ti: j721e-csi2rx: Allow passing cache hints from user-space
@ 2025-03-12 11:21 Devarsh Thakkar
2025-03-13 7:17 ` Jai Luthra
2025-06-25 21:00 ` Sakari Ailus
0 siblings, 2 replies; 3+ messages in thread
From: Devarsh Thakkar @ 2025-03-12 11:21 UTC (permalink / raw)
To: jai.luthra, mchehab, linux-media, linux-kernel
Cc: s-jain1, r-donadkar, devarsht, vigneshr, praneeth, tomi.valkeinen,
y-abhilashchandra
User-space can provide cache hints to enable software managed cache
operations or skip certain cache operations using memory flags
and buffer flags. This is useful for SoCs such as AM62px
which do not support hardware cache coherency.
This is tested on AM62px with yavta capture by passing
V4L2_MEMORY_FLAG_NON_COHERENT while using VIDIOC_REQBUFS
and V4L2_BUF_FLAG_NO_CACHE_CLEAN while using VIDIOC_QBUF
and ~5x reduction in memcpy time is seen for
copying captured frame to DDR as shared here [1].
[1]:
Link: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1452545/am62p-the-ads6311-radar-camera-has-lost-frame-capture/5580472#5580472
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
---
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
index 6412a00be8ea..284d33b2a0ec 100644
--- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
+++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
@@ -895,6 +895,7 @@ static int ti_csi2rx_init_vb2q(struct ti_csi2rx_dev *csi)
q->dev = dmaengine_get_dma_device(csi->dma.chan);
q->lock = &csi->mutex;
q->min_queued_buffers = 1;
+ q->allow_cache_hints = 1;
ret = vb2_queue_init(q);
if (ret)
--
2.39.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] media: ti: j721e-csi2rx: Allow passing cache hints from user-space
2025-03-12 11:21 [PATCH] media: ti: j721e-csi2rx: Allow passing cache hints from user-space Devarsh Thakkar
@ 2025-03-13 7:17 ` Jai Luthra
2025-06-25 21:00 ` Sakari Ailus
1 sibling, 0 replies; 3+ messages in thread
From: Jai Luthra @ 2025-03-13 7:17 UTC (permalink / raw)
To: Devarsh Thakkar
Cc: mchehab, linux-media, linux-kernel, s-jain1, r-donadkar, vigneshr,
praneeth, tomi.valkeinen, y-abhilashchandra
[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]
Hi Devarsh,
Thanks for the patch.
On Wed, Mar 12, 2025 at 04:51:40PM +0530, Devarsh Thakkar wrote:
> User-space can provide cache hints to enable software managed cache
> operations or skip certain cache operations using memory flags and buffer
> flags. This is useful for SoCs such as AM62px which do not support hardware
> cache coherency.
>
> This is tested on AM62px with yavta capture by passing
> V4L2_MEMORY_FLAG_NON_COHERENT while using VIDIOC_REQBUFS and
> V4L2_BUF_FLAG_NO_CACHE_CLEAN while using VIDIOC_QBUF and ~5x reduction in
> memcpy time is seen for copying captured frame to DDR as shared here [1].
>
> [1]:
> Link: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1452545/am62p-the-ads6311-radar-camera-has-lost-frame-capture/5580472#5580472
nit: might be cleaner to drop the "[1]" reference as a single Link tag is
pretty unambiguous.
But in any case,
Acked-by: Jai Luthra <jai.luthra@linux.dev>
> Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
> ---
> drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> index 6412a00be8ea..284d33b2a0ec 100644
> --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> @@ -895,6 +895,7 @@ static int ti_csi2rx_init_vb2q(struct ti_csi2rx_dev *csi)
> q->dev = dmaengine_get_dma_device(csi->dma.chan);
> q->lock = &csi->mutex;
> q->min_queued_buffers = 1;
> + q->allow_cache_hints = 1;
>
> ret = vb2_queue_init(q);
> if (ret)
> --
> 2.39.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: ti: j721e-csi2rx: Allow passing cache hints from user-space
2025-03-12 11:21 [PATCH] media: ti: j721e-csi2rx: Allow passing cache hints from user-space Devarsh Thakkar
2025-03-13 7:17 ` Jai Luthra
@ 2025-06-25 21:00 ` Sakari Ailus
1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2025-06-25 21:00 UTC (permalink / raw)
To: Devarsh Thakkar
Cc: jai.luthra, mchehab, linux-media, linux-kernel, s-jain1,
r-donadkar, vigneshr, praneeth, tomi.valkeinen, y-abhilashchandra
Hi Devarsh,
Thanks for the patch.
On Wed, Mar 12, 2025 at 04:51:40PM +0530, Devarsh Thakkar wrote:
> User-space can provide cache hints to enable software managed cache
> operations or skip certain cache operations using memory flags
> and buffer flags. This is useful for SoCs such as AM62px
> which do not support hardware cache coherency.
>
> This is tested on AM62px with yavta capture by passing
> V4L2_MEMORY_FLAG_NON_COHERENT while using VIDIOC_REQBUFS
> and V4L2_BUF_FLAG_NO_CACHE_CLEAN while using VIDIOC_QBUF
> and ~5x reduction in memcpy time is seen for
> copying captured frame to DDR as shared here [1].
The lines may be up to 75 characters long here. Most editors can handle the
wrapping for you, I've rewrapped the text in this case and edited it a
little, as Jai suggested.
>
> [1]:
> Link: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1452545/am62p-the-ads6311-radar-camera-has-lost-frame-capture/5580472#5580472
> Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
> ---
> drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> index 6412a00be8ea..284d33b2a0ec 100644
> --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> @@ -895,6 +895,7 @@ static int ti_csi2rx_init_vb2q(struct ti_csi2rx_dev *csi)
> q->dev = dmaengine_get_dma_device(csi->dma.chan);
> q->lock = &csi->mutex;
> q->min_queued_buffers = 1;
> + q->allow_cache_hints = 1;
>
> ret = vb2_queue_init(q);
> if (ret)
--
Regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-25 21:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12 11:21 [PATCH] media: ti: j721e-csi2rx: Allow passing cache hints from user-space Devarsh Thakkar
2025-03-13 7:17 ` Jai Luthra
2025-06-25 21:00 ` Sakari Ailus
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.