Commit fd5b4046 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: hantro: Use vb2_get_buffer

Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 782dc2d5
...@@ -45,12 +45,14 @@ void *hantro_get_ctrl(struct hantro_ctx *ctx, u32 id) ...@@ -45,12 +45,14 @@ void *hantro_get_ctrl(struct hantro_ctx *ctx, u32 id)
dma_addr_t hantro_get_ref(struct vb2_queue *q, u64 ts) dma_addr_t hantro_get_ref(struct vb2_queue *q, u64 ts)
{ {
struct vb2_buffer *buf;
int index; int index;
index = vb2_find_timestamp(q, ts, 0); index = vb2_find_timestamp(q, ts, 0);
if (index >= 0) if (index < 0)
return vb2_dma_contig_plane_dma_addr(q->bufs[index], 0); return 0;
return 0; buf = vb2_get_buffer(q, index);
return vb2_dma_contig_plane_dma_addr(buf, 0);
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment