From: Chen-Yu Tsai <wenst@chromium.org>
To: Tiffany Lin <tiffany.lin@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Chen-Yu Tsai <wenst@chromium.org>,
linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-kernel@vger.kernel.org,
Nicolas Dufresne <nicolas@ndufresne.ca>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Yunfei Dong <yunfei.dong@mediatek.com>
Subject: [PATCH 4/4] media: mediatek: vcodec: dec: Set maximum resolution when S_FMT on output only
Date: Mon, 27 Jun 2022 19:24:02 +0800 [thread overview]
Message-ID: <20220627112402.2332046-5-wenst@chromium.org> (raw)
In-Reply-To: <20220627112402.2332046-1-wenst@chromium.org>
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@chromium.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
prev parent reply other threads:[~2022-06-27 11:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 11:23 [PATCH 0/4] media: mediatek: vcodec: Fix 4K decoding support Chen-Yu Tsai
2022-06-27 11:23 ` [PATCH 1/4] media: mediatek: vcodec: dec: Fix 4K frame size enumeration Chen-Yu Tsai
2022-06-27 15:32 ` Nicolas Dufresne
2022-06-27 16:08 ` Chen-Yu Tsai
2022-06-27 19:28 ` Nicolas Dufresne
2022-06-28 7:04 ` Chen-Yu Tsai
2022-06-27 15:33 ` Nicolas Dufresne
2022-06-27 16:13 ` Chen-Yu Tsai
2022-06-27 11:24 ` [PATCH 2/4] media: mediatek: vcodec: dec: Set default max resolution based on format Chen-Yu Tsai
2022-06-27 11:24 ` [PATCH 3/4] media: mediatek: vcodec: dec: Fix resolution clamping in TRY_FMT Chen-Yu Tsai
2022-06-27 11:24 ` Chen-Yu Tsai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220627112402.2332046-5-wenst@chromium.org \
--to=wenst@chromium.org \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=nicolas@ndufresne.ca \
--cc=tiffany.lin@mediatek.com \
--cc=yunfei.dong@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®