Skip to contentSkip to conversation

media: starfive: camss: Use common dma-contig dma addr helper

PATCH In review Paul Kocialkowski 2 participants 2 messages Aug 1, 2025 – Aug 5, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: starfive: camss: Use common dma-contig dma addr helper

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.

---
 drivers/staging/media/starfive/camss/stf-video.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/media/starfive/camss/stf-video.c +1 -3
index a0420eb6a0aa..b0b9b70b9641 100644
@@ -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] =
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Paul,

Thank you for the patch.

Quoted 15 lines · 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.

---
 drivers/staging/media/starfive/camss/stf-video.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/media/starfive/camss/stf-video.c +0 -0
index a0420eb6a0aa..b0b9b70b9641 100644

drivers/staging/media/starfive/camss/stf-video.c static int video_buf_init(struct vb2_buffer *vb) · line 171

Quoted 8 lines
drivers/staging/media/starfive/camss/stf-video.c +1 -3
@@ -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,

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 ?

Quoted 3 lines
drivers/staging/media/starfive/camss/stf-video.c +0 -0
 	if (fmt->pixelformat == V4L2_PIX_FMT_NV12)
 		buffer->addr[1] =
Signature · 3 lines
Regards,

Laurent Pinchart