Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3860653iog; Tue, 21 Jun 2022 07:24:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s4NYI4TjwFDA12FMPEcKFgIdSaRM1U1cjA0UTOgBbLlASIfeyQe7ZMZMX6vRzJWte1Ekio X-Received: by 2002:a17:906:6483:b0:712:1bfe:eda2 with SMTP id e3-20020a170906648300b007121bfeeda2mr25441048ejm.306.1655821469301; Tue, 21 Jun 2022 07:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655821469; cv=none; d=google.com; s=arc-20160816; b=zeq1ObHJCi32tISy+CiRyDiQtU+z4qWZkZviJ8faOGHhqi8RB0R2MbySqxtNv70Of+ sv/XgyJNiH/cLfQljk+qf0jujMDSUzbOMwOd2MtVznsP/oEYvoji2LWlhmE4UJBMq7Jq EWF+urUIzY2GyAeRq1KbBbU9mQgsj9aB64v77wrbDd/IMcJYBTlphpDc/B/SJm/i+eFf 0FAJznEGCRPsPHennS2c8lvBmTdK5I3o90vOyqpFcxJcvk5NNlToRC8zFyg0IEgkKikj IaYC1LXFeDsp1U3T9uwQ9cXFaKqHMadwSE0tunCoCWw6DRevmc4pO2o/4AwtRlZv4Axl lUJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=UOS/5sDSVRe9xVqmGwkJ+5vo/Q8jcVNLwgNXYg2yOQs=; b=lmtTpIvglNWddO07nFdwct7kLiJ5s7C8BK0cAfTmAHrSGKAWwI/g9OAV2GQm3lOR9H LA71mzFMksBil/Sh5ORPL2vdiibJgyUIxx9h4ohvPfrniltNkHrcWr6aumLqN5nuxqSh jXZASrHJaZHtBS9EcZwv37vAXmP9G4ehoZ00eyCO/WlNf6cf++Fja04HymZUo7jtza0i nhFcHEvQDYe4/QR6/ggCZ7EBjMdn+nJ/C5gM8mpFnlxSW2M4bp8nXSidB2vaKTFI5+lf YLfBixdU+Uf1ZgFudGykaGuEK5F3idfUz2PdaG9pLHiFEVSDGz+8su8q1odd7WHMvMqr ghfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b="emm3jY9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a05640225c200b00434fff6fe37si17322676edb.227.2022.06.21.07.24.03; Tue, 21 Jun 2022 07:24:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b="emm3jY9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351329AbiFUOUh (ORCPT + 99 others); Tue, 21 Jun 2022 10:20:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351268AbiFUOUd (ORCPT ); Tue, 21 Jun 2022 10:20:33 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 526E422529 for ; Tue, 21 Jun 2022 07:20:32 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id q4so8449307qvq.8 for ; Tue, 21 Jun 2022 07:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-transfer-encoding:user-agent:mime-version; bh=UOS/5sDSVRe9xVqmGwkJ+5vo/Q8jcVNLwgNXYg2yOQs=; b=emm3jY9/JB9YVRuSwlSR8EcjujcyeZKFNlGFlog4esm4Si4/kvzFI1gJg63VkiPZhB j1MD+u4stqQGd14DMP+5dGamJdmbnT8IRhcJlTCGmLO4gEe4gE75g1qpPvYU4xE0DjLK X9o58/A+0Okx+crl4PLFuhdJWbAoMYgot+WskVbop1eKghHgpf60Ivw0AytMdCkJuzu+ Z7ygkU1RWLYv/BsTwh/Hbex0EJNa0nBsSvQXwEWbMPCjea7gy3fLmHChFTvdaQJSIWKT cG9xaN+pvF3AH3SdCd2MEjhqwzb8q0MQGx+4aZ+zT+fnkZXfOSqfBqtCr7P6DBBdaFRT 6jyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=UOS/5sDSVRe9xVqmGwkJ+5vo/Q8jcVNLwgNXYg2yOQs=; b=cDJie3x5yeuPayeY5bEGyHHiFdY/u40/F13kwcFf6zMaf2JNMiyusZKQQfr0DgWHS/ /1cYYLTBpn2bznF8Clb/eYlhE59DrdTWQuuk6uecZCMfb1Cv+fld4uYrdXn/OGcmjn8+ rOm80L3DGbHLmQCEwisydlPV805SQ5KCsnm3R7TnmSoLz0iHYSP7SUw9rM1nsGCdMvSD /U1945vscxmNIyyR24N0nD15d/IKOXvHsN1K9+nkFyPyjR2331nh4zyRfDwCPWppoRlr LRC5b9aLZtsI11ZAcOhwVUDAEsGI/2Ip+2n6/vFBRgqTx8P9m8yyIS2eohfZcJfmA4TY T3lg== X-Gm-Message-State: AJIora9amN1C/A155IGGvKR72UVfjPehK9WCAygIITu4yVoRavDjsWAS ZJRQh6CbxyEtc8ZWElDEl/Ciow== X-Received: by 2002:ad4:5c8d:0:b0:470:4649:e3c9 with SMTP id o13-20020ad45c8d000000b004704649e3c9mr6914682qvh.43.1655821230749; Tue, 21 Jun 2022 07:20:30 -0700 (PDT) Received: from nicolas-tpx395.localdomain (192-222-136-102.qc.cable.ebox.net. [192.222.136.102]) by smtp.gmail.com with ESMTPSA id d84-20020a376857000000b006a77e6df09asm13286497qkc.24.2022.06.21.07.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jun 2022 07:20:30 -0700 (PDT) Message-ID: <320bf3dd2bef0afec794d610b446d0085dcfe362.camel@ndufresne.ca> Subject: Re: [PATCH] media: mediatek: vcodec: Initialize decoder parameters after getting dec_capability From: Nicolas Dufresne To: Yunfei Dong , Chen-Yu Tsai , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa Cc: George Sun , Xiaoyong Lu , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , dri-devel , Irui Wang , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com Date: Tue, 21 Jun 2022 10:20:28 -0400 In-Reply-To: <20220618072929.28783-1-yunfei.dong@mediatek.com> References: <20220618072929.28783-1-yunfei.dong@mediatek.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yunfei, Le samedi 18 juin 2022 =C3=A0 15:29 +0800, Yunfei Dong a =C3=A9crit=C2=A0: > Need to get dec_capability from scp first, then initialize decoder > supported format and other parameters according to dec_capability value. Perhaps something to improve in the future. On top of describing the fix, i= t could be useful to describe what issues is being fixed, and which platform = will benefit. >=20 > Signed-off-by: Yunfei Dong To add to this, this looks like a bug fix, can you relate it to an original commit and add a Fixes: tag here ? regards, Nicolas > --- > drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 2 -- > drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 2 ++ > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/dr= ivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c > index 1465ddff1c6b..41589470da32 100644 > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c > @@ -112,8 +112,6 @@ void mtk_vcodec_dec_set_default_params(struct mtk_vco= dec_ctx *ctx) > { > struct mtk_q_data *q_data; > =20 > - ctx->dev->vdec_pdata->init_vdec_params(ctx); > - > ctx->m2m_ctx->q_lock =3D &ctx->dev->dev_mutex; > ctx->fh.m2m_ctx =3D ctx->m2m_ctx; > ctx->fh.ctrl_handler =3D &ctx->ctrl_hdl; > diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c = b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c > index 4103d7c1b638..99d7b15f2b9d 100644 > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c > @@ -208,6 +208,8 @@ static int fops_vcodec_open(struct file *file) > =20 > dev->dec_capability =3D > 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); > } > =20