From: Markus Fritsche Subject: [PATCH RFC 3/3] media: rockchip-rga: attach dma_resv release fence at buf_queue Date: 2026-04-28 Opt the Rockchip RGA driver into the new vb2 release-fence helper. Same shape as the hantro patch: the existing buf_queue path enqueues the buffer in the driver's m2m queue via v4l2_m2m_buf_queue, and we additionally attach a release fence to each plane's dmabuf->resv via vb2_buffer_attach_release_fence(). vb2_buffer_done signals the fence when RGA completes the M2M operation. Userspace consumers of RGA-produced dmabufs (image-processing pipelines, screen-rotation servers, gstreamer flows) get spec-clean implicit-sync semantics, matching what hantro now does in the same patch series. Signed-off-by: Markus Fritsche --- drivers/media/platform/rockchip/rga/rga-buf.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/rockchip/rga/rga-buf.c b/drivers/media/platform/rockchip/rga/rga-buf.c --- a/drivers/media/platform/rockchip/rga/rga-buf.c +++ b/drivers/media/platform/rockchip/rga/rga-buf.c @@ -150,7 +150,18 @@ static void rga_buf_queue(struct vb2_buffer *vb) { struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct rga_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf); + + /* + * Opt in to vb2's dma_resv release-fence path so userspace + * consumers of RGA-produced dmabufs get a real producer fence + * to wait on instead of the dma_buf core's substitute stub + * fence. See the leading patch in this series for rationale + * and the helper definition. Best-effort: a fence-allocation + * failure means we lose implicit-sync precision but the m2m + * operation itself proceeds normally. + */ + (void)vb2_buffer_attach_release_fence(vb); } static void rga_buf_cleanup(struct vb2_buffer *vb) -- 2.44.0