diff options
author | Ezequiel Garcia <ezequiel@collabora.com> | 2019-06-19 01:12:37 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-06-24 20:59:30 +0200 |
commit | fd5b4046c7bb3073a2aa03d994cdb698586c5588 (patch) | |
tree | 4db1e01b3293d2b3b87fd1ffbeef4e1aae3dabcf /drivers | |
parent | media: pci: cx88: Change the type of 'missed' to u64 (diff) | |
download | linux-fd5b4046c7bb3073a2aa03d994cdb698586c5588.tar.xz linux-fd5b4046c7bb3073a2aa03d994cdb698586c5588.zip |
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: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/hantro/hantro_drv.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c index 1d3af881d088..c3665f0e87a2 100644 --- a/drivers/staging/media/hantro/hantro_drv.c +++ b/drivers/staging/media/hantro/hantro_drv.c @@ -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) { + struct vb2_buffer *buf; int index; index = vb2_find_timestamp(q, ts, 0); - if (index >= 0) - return vb2_dma_contig_plane_dma_addr(q->bufs[index], 0); - return 0; + if (index < 0) + return 0; + buf = vb2_get_buffer(q, index); + return vb2_dma_contig_plane_dma_addr(buf, 0); } static int |