Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: tegra-vde: Use vb2_find_buffer

Use the newly introduced vb2_find_buffer API to get a vb2_buffer
given a buffer timestamp.

Cc: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Ezequiel Garcia and committed by
Mauro Carvalho Chehab
6c6d3eae 25e3bc62

+4 -5
+4 -5
drivers/media/platform/nvidia/tegra-vde/h264.c
··· 659 659 { 660 660 const struct v4l2_h264_dpb_entry *dpb = ctx->h264.decode_params->dpb; 661 661 struct vb2_queue *cap_q = &ctx->fh.m2m_ctx->cap_q_ctx.q; 662 - int buf_idx = -1; 662 + struct vb2_buffer *vb = NULL; 663 663 664 664 if (dpb[dpb_idx].flags & V4L2_H264_DPB_ENTRY_FLAG_ACTIVE) 665 - buf_idx = vb2_find_timestamp(cap_q, 666 - dpb[dpb_idx].reference_ts, 0); 665 + vb = vb2_find_buffer(cap_q, dpb[dpb_idx].reference_ts); 667 666 668 667 /* 669 668 * If a DPB entry is unused or invalid, address of current destination 670 669 * buffer is returned. 671 670 */ 672 - if (buf_idx < 0) 671 + if (!vb) 673 672 return &dst->vb2_buf; 674 673 675 - return vb2_get_buffer(cap_q, buf_idx); 674 + return vb; 676 675 } 677 676 678 677 static int tegra_vde_validate_vb_size(struct tegra_ctx *ctx,