mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-02 08:32:55 +00:00
media: rockchip: rga: set dma mask to 32 bits
The RGA DMA descriptor list contains only 32-bit addresses. Set the dma_mask to only allocate memory that is addressable by the descriptors. This prevents errors when preparing vb2 buffers that were allocated by the RGA. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
25783e2a98
commit
ec9ef8dda2
@ -98,6 +98,7 @@ queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)
|
|||||||
src_vq->drv_priv = ctx;
|
src_vq->drv_priv = ctx;
|
||||||
src_vq->ops = &rga_qops;
|
src_vq->ops = &rga_qops;
|
||||||
src_vq->mem_ops = &vb2_dma_sg_memops;
|
src_vq->mem_ops = &vb2_dma_sg_memops;
|
||||||
|
dst_vq->gfp_flags = __GFP_DMA32;
|
||||||
src_vq->buf_struct_size = sizeof(struct rga_vb_buffer);
|
src_vq->buf_struct_size = sizeof(struct rga_vb_buffer);
|
||||||
src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
||||||
src_vq->lock = &ctx->rga->mutex;
|
src_vq->lock = &ctx->rga->mutex;
|
||||||
@ -112,6 +113,7 @@ queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)
|
|||||||
dst_vq->drv_priv = ctx;
|
dst_vq->drv_priv = ctx;
|
||||||
dst_vq->ops = &rga_qops;
|
dst_vq->ops = &rga_qops;
|
||||||
dst_vq->mem_ops = &vb2_dma_sg_memops;
|
dst_vq->mem_ops = &vb2_dma_sg_memops;
|
||||||
|
dst_vq->gfp_flags = __GFP_DMA32;
|
||||||
dst_vq->buf_struct_size = sizeof(struct rga_vb_buffer);
|
dst_vq->buf_struct_size = sizeof(struct rga_vb_buffer);
|
||||||
dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
||||||
dst_vq->lock = &ctx->rga->mutex;
|
dst_vq->lock = &ctx->rga->mutex;
|
||||||
@ -824,6 +826,12 @@ static int rga_probe(struct platform_device *pdev)
|
|||||||
goto err_put_clk;
|
goto err_put_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = dma_set_mask_and_coherent(rga->dev, DMA_BIT_MASK(32));
|
||||||
|
if (ret) {
|
||||||
|
dev_err(rga->dev, "32-bit DMA not supported");
|
||||||
|
goto err_put_clk;
|
||||||
|
}
|
||||||
|
|
||||||
ret = v4l2_device_register(&pdev->dev, &rga->v4l2_dev);
|
ret = v4l2_device_register(&pdev->dev, &rga->v4l2_dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_put_clk;
|
goto err_put_clk;
|
||||||
|
Loading…
Reference in New Issue
Block a user