[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220627112402.2332046-5-wenst@chromium.org>
Date: Mon, 27 Jun 2022 19:24:02 +0800
From: Chen-Yu Tsai <wenst@...omium.org>
To: Tiffany Lin <tiffany.lin@...iatek.com>,
Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil-cisco@...all.nl>
Cc: Nicolas Dufresne <nicolas.dufresne@...labora.com>,
Chen-Yu Tsai <wenst@...omium.org>, linux-media@...r.kernel.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
Nicolas Dufresne <nicolas@...fresne.ca>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Yunfei Dong <yunfei.dong@...iatek.com>
Subject: [PATCH 4/4] media: mediatek: vcodec: dec: Set maximum resolution when S_FMT on output only
Only the coded format impacts whether 4K resolution is supported: the
decoder does not support 4K for VP8, but does for other formats.
Update the maximum resolution in S_FMT only when called for the output
format. Otherwise we could set output format for VP8, then set capture
format, and then the resolution limit becomes inconsistent.
Fixes: b018be06f3c7 ("media: mediatek: vcodec: Read max resolution from dec_capability")
Signed-off-by: Chen-Yu Tsai <wenst@...omium.org>
---
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
index ea951cb3b927..995c61d6a40e 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
@@ -521,7 +521,8 @@ static int vidioc_vdec_s_fmt(struct file *file, void *priv,
if (fmt == NULL)
return -EINVAL;
- if (!(ctx->dev->dec_capability & VCODEC_CAPABILITY_4K_DISABLED) &&
+ if (V4L2_TYPE_IS_OUTPUT(f->type) &&
+ !(ctx->dev->dec_capability & VCODEC_CAPABILITY_4K_DISABLED) &&
fmt->fourcc != V4L2_PIX_FMT_VP8_FRAME) {
mtk_v4l2_debug(3, "4K is enabled");
ctx->max_width = VCODEC_DEC_4K_CODED_WIDTH;
--
2.37.0.rc0.161.g10f37bed90-goog
Powered by blists - more mailing lists