linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: starfive: camss: Use common dma-contig dma addr helper
@ 2025-08-01  8:21 Paul Kocialkowski
  2025-08-05  0:45 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Kocialkowski @ 2025-08-01  8:21 UTC (permalink / raw)
  To: linux-media, linux-staging, linux-kernel
  Cc: Jack Zhu, Changhuang Liang, Mauro Carvalho Chehab, Hans Verkuil,
	Laurent Pinchart, Paul Kocialkowski

The vb2_plane_cookie helpers is not meant to be used directly by
drivers using the generic dma-contig allocator.

Use the common helper to retrieve the plane dma address instead.

Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
---
 drivers/staging/media/starfive/camss/stf-video.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/media/starfive/camss/stf-video.c b/drivers/staging/media/starfive/camss/stf-video.c
index a0420eb6a0aa..b0b9b70b9641 100644
--- a/drivers/staging/media/starfive/camss/stf-video.c
+++ b/drivers/staging/media/starfive/camss/stf-video.c
@@ -167,10 +167,8 @@ static int video_buf_init(struct vb2_buffer *vb)
 	struct stfcamss_video *video = vb2_get_drv_priv(vb->vb2_queue);
 	struct stfcamss_buffer *buffer = to_stfcamss_buffer(vbuf);
 	const struct v4l2_pix_format *fmt = &video->active_fmt.fmt.pix;
-	dma_addr_t *paddr;
 
-	paddr = vb2_plane_cookie(vb, 0);
-	buffer->addr[0] = *paddr;
+	buffer->addr[0] = vb2_dma_contig_plane_dma_addr(vb, 0);
 
 	if (fmt->pixelformat == V4L2_PIX_FMT_NV12)
 		buffer->addr[1] =
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: starfive: camss: Use common dma-contig dma addr helper
  2025-08-01  8:21 [PATCH] media: starfive: camss: Use common dma-contig dma addr helper Paul Kocialkowski
@ 2025-08-05  0:45 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2025-08-05  0:45 UTC (permalink / raw)
  To: Paul Kocialkowski
  Cc: linux-media, linux-staging, linux-kernel, Jack Zhu,
	Changhuang Liang, Mauro Carvalho Chehab, Hans Verkuil

Hi Paul,

Thank you for the patch.

On Fri, Aug 01, 2025 at 10:21:49AM +0200, Paul Kocialkowski wrote:
> The vb2_plane_cookie helpers is not meant to be used directly by
> drivers using the generic dma-contig allocator.
> 
> Use the common helper to retrieve the plane dma address instead.
> 
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> ---
>  drivers/staging/media/starfive/camss/stf-video.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/starfive/camss/stf-video.c b/drivers/staging/media/starfive/camss/stf-video.c
> index a0420eb6a0aa..b0b9b70b9641 100644
> --- a/drivers/staging/media/starfive/camss/stf-video.c
> +++ b/drivers/staging/media/starfive/camss/stf-video.c
> @@ -167,10 +167,8 @@ static int video_buf_init(struct vb2_buffer *vb)
>  	struct stfcamss_video *video = vb2_get_drv_priv(vb->vb2_queue);
>  	struct stfcamss_buffer *buffer = to_stfcamss_buffer(vbuf);
>  	const struct v4l2_pix_format *fmt = &video->active_fmt.fmt.pix;
> -	dma_addr_t *paddr;
>  
> -	paddr = vb2_plane_cookie(vb, 0);
> -	buffer->addr[0] = *paddr;
> +	buffer->addr[0] = vb2_dma_contig_plane_dma_addr(vb, 0);

That looks good,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

However, I think the driver should be dropped from the kernel. It has
been merged in staging because it wasn't complete, and startfive made it
clear they don't plan to work on it anymore.

Would you like to submit a patch to drop the driver instead ?

>  
>  	if (fmt->pixelformat == V4L2_PIX_FMT_NV12)
>  		buffer->addr[1] =

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-05  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01  8:21 [PATCH] media: starfive: camss: Use common dma-contig dma addr helper Paul Kocialkowski
2025-08-05  0:45 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).