Commit ce32c0a5 authored by Vikash Garodia's avatar Vikash Garodia Committed by Mauro Carvalho Chehab
Browse files

media: venus: vdec: fix decoded data size



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: default avatarVikash Garodia <vgarodia@codeaurora.org>
Acked-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 32ae5920
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);

		vb = &vbuf->vb2_buf;
		vb->planes[0].bytesused =
			max_t(unsigned int, opb_sz, bytesused);
		vb2_set_plane_payload(vb, 0, bytesused ? : opb_sz);
		vb->planes[0].data_offset = data_offset;
		vb->timestamp = timestamp_us * NSEC_PER_USEC;
		vbuf->sequence = inst->sequence_cap++;