media: venus: vdec: return parsed crop information from stream
authorAlexandre Courbot <acourbot@chromium.org>
Wed, 21 Oct 2020 00:09:43 +0000 (02:09 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Nov 2020 18:08:23 +0000 (19:08 +0100)
commitde04408fd12d5d3b9fb3724034666a84cccbf190
tree5aaec6a28d36ffaa6b4ac0cd12c0e87b42beaf12
parent4568ea3fa95d33cc10e8938949ae9a875046e553
media: venus: vdec: return parsed crop information from stream

Per the stateful codec specification, VIDIOC_G_SELECTION with a target
of V4L2_SEL_TGT_COMPOSE is supposed to return the crop area of capture
buffers containing the decoded frame. Until now the driver did not get
that information from the firmware and just returned the dimensions of
CAPTURE buffers.

The firmware unfortunately does not always provide the crop information
from the stream ; also make sure to detect when that happens and
fallback to providing the coded size in these cases.

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/qcom/venus/core.h
drivers/media/platform/qcom/venus/vdec.c