]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: mediatek: vcodec: Initialize decoder parameters after getting dec_capability
authorYunfei Dong <yunfei.dong@mediatek.com>
Sat, 18 Jun 2022 07:29:29 +0000 (08:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:40:53 +0000 (14:40 +0200)
[ Upstream commit faddaa735c208560a3f419038e8d154a01b584e3 ]

Need to get dec_capability from scp first, then initialize decoder
supported format and other parameters according to dec_capability value.

Fixes: fd00d90330d1 ("media: mtk-vcodec: vdec: move stateful ops into their own file")
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c

index c8ee5e2b4f6990d40dc7e07eccbf878aca1514cf..4bb8a275127198a3ee4389d617d42a98c00be738 100644 (file)
@@ -112,8 +112,6 @@ void mtk_vcodec_dec_set_default_params(struct mtk_vcodec_ctx *ctx)
 {
        struct mtk_q_data *q_data;
 
-       ctx->dev->vdec_pdata->init_vdec_params(ctx);
-
        ctx->m2m_ctx->q_lock = &ctx->dev->dev_mutex;
        ctx->fh.m2m_ctx = ctx->m2m_ctx;
        ctx->fh.ctrl_handler = &ctx->ctrl_hdl;
index fe7b2f1739b15c6ac235577a189811aa2182495a..bd1ee9901da0bd20488b0265ce157a4edaddefb1 100644 (file)
@@ -211,6 +211,8 @@ static int fops_vcodec_open(struct file *file)
 
                dev->dec_capability =
                        mtk_vcodec_fw_get_vdec_capa(dev->fw_handler);
+               ctx->dev->vdec_pdata->init_vdec_params(ctx);
+
                mtk_v4l2_debug(0, "decoder capability %x", dev->dec_capability);
        }