]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: mtk-vcodec: vdec: clamp OUTPUT resolution to hardware limits
authorAlexandre Courbot <acourbot@chromium.org>
Fri, 6 Aug 2021 04:15:19 +0000 (06:15 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 12 Aug 2021 13:43:48 +0000 (15:43 +0200)
commitdfeef202b699f3e2a8ff4d0c0a05bbb6a203a470
treed5a971108de4866822870d864e7283259b0cea10
parent5aff12f3a9ef4126ed8e7fca7d9d38f85edc0637
media: mtk-vcodec: vdec: clamp OUTPUT resolution to hardware limits

Calling S_FMT or TRY_FMT on the OUTPUT queue should adjust the
resolution to the limits supported by the hardware. Until now this was
only done on the CAPTURE queue, which could make clients believe that
unsupported resolutions can be used when they set the coded size on the
OUTPUT queue.

In the case of the stateless decoder, the problem was even bigger since
subsequently calling G_FMT on the CAPTURE queue would result in the
unclamped resolution being returned, further inducing the client into
error.

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c