提交 936319bf 编写于 作者: V Vikash Garodia 提交者: Xie XiuQi

media: venus: vdec: fix decoded data size

[ Upstream commit ce32c0a5 ]

Existing code returns the max of the decoded size and buffer size.
It turns out that buffer size is always greater due to hardware
alignment requirement. As a result, payload size given to client
is incorrect. This change ensures that the bytesused is assigned
to actual payload size, when available.
Signed-off-by: NVikash Garodia <vgarodia@codeaurora.org>
Acked-by: NStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ebb72284
...@@ -888,8 +888,7 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type, ...@@ -888,8 +888,7 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
unsigned int opb_sz = venus_helper_get_opb_size(inst); unsigned int opb_sz = venus_helper_get_opb_size(inst);
vb = &vbuf->vb2_buf; vb = &vbuf->vb2_buf;
vb->planes[0].bytesused = vb2_set_plane_payload(vb, 0, bytesused ? : opb_sz);
max_t(unsigned int, opb_sz, bytesused);
vb->planes[0].data_offset = data_offset; vb->planes[0].data_offset = data_offset;
vb->timestamp = timestamp_us * NSEC_PER_USEC; vb->timestamp = timestamp_us * NSEC_PER_USEC;
vbuf->sequence = inst->sequence_cap++; vbuf->sequence = inst->sequence_cap++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册