mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-23 16:49:42 +07:00
media: hantro: Use v4l2_m2m_buf_done_and_job_finish
Let the core sort out the nuances of returning buffers to userspace, by using the v4l2_m2m_buf_done_and_job_finish helper. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
6837e43e9c
commit
28a202c559
@ -101,8 +101,8 @@ static void hantro_job_finish(struct hantro_dev *vpu,
|
||||
pm_runtime_put_autosuspend(vpu->dev);
|
||||
clk_bulk_disable(vpu->variant->num_clocks, vpu->clocks);
|
||||
|
||||
src = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
|
||||
dst = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
|
||||
src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
|
||||
dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
|
||||
|
||||
if (WARN_ON(!src))
|
||||
return;
|
||||
@ -112,14 +112,14 @@ static void hantro_job_finish(struct hantro_dev *vpu,
|
||||
src->sequence = ctx->sequence_out++;
|
||||
dst->sequence = ctx->sequence_cap++;
|
||||
|
||||
ret = ctx->buf_finish(ctx, &dst->vb2_buf, bytesused);
|
||||
if (ret)
|
||||
result = VB2_BUF_STATE_ERROR;
|
||||
if (ctx->buf_finish) {
|
||||
ret = ctx->buf_finish(ctx, &dst->vb2_buf, bytesused);
|
||||
if (ret)
|
||||
result = VB2_BUF_STATE_ERROR;
|
||||
}
|
||||
|
||||
v4l2_m2m_buf_done(src, result);
|
||||
v4l2_m2m_buf_done(dst, result);
|
||||
|
||||
v4l2_m2m_job_finish(vpu->m2m_dev, ctx->fh.m2m_ctx);
|
||||
v4l2_m2m_buf_done_and_job_finish(ctx->dev->m2m_dev, ctx->fh.m2m_ctx,
|
||||
result);
|
||||
}
|
||||
|
||||
void hantro_irq_done(struct hantro_dev *vpu, unsigned int bytesused,
|
||||
|
Loading…
Reference in New Issue
Block a user