media: venus: vdec: fix decoded data size
authorVikash Garodia <vgarodia@codeaurora.org>
Mon, 8 Oct 2018 11:09:04 +0000 (07:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:49 +0000 (08:20 +0100)
commit9c30ea2dda5dcd061bc1e8546ea64d50600db357
treea212b8841d4a92586bcfbd9d23528b016b57facd
parent5b388c45c3e57ff597d666ad3f84d848a18237f2
media: venus: vdec: fix decoded data size

[ Upstream commit ce32c0a530bd955206fe45c2eff77e581202d699 ]

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: Vikash Garodia <vgarodia@codeaurora.org>
Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/qcom/venus/vdec.c