Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3091737rwb; Mon, 15 Aug 2022 17:55:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR5bqrY8SebNeA3oNqdQxlc+V94iwqqLXO65le853+pJ/sGSIHmVGbOZgBKDetKOG0zQHOzB X-Received: by 2002:a17:907:7631:b0:730:9524:a2d6 with SMTP id jy17-20020a170907763100b007309524a2d6mr3351201ejc.59.1660611340576; Mon, 15 Aug 2022 17:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611340; cv=none; d=google.com; s=arc-20160816; b=IKUZMoGKM7YzUarbip/sP0wmQaV8C4qTTUg9cZ+b9npVNCuKAkmHGLNVf6+3bncPu9 wvZG7uzJLw5o1PE9ZwmN4u7O7mp8QeypXZT+axCzPJvSzL1GYA4x7N+ePUatlbhjZmRk m7pcn7YERrL+s2dfCJmyUwoQWiFPy60c5c87ES1bblsqyEsNCyNnoTw+7kyEoprpxP5q aoNmaViPhF1yqLlQrQNxQD14OOGn6VE3Cu8RYDt3yMOYpzbvDbvP31sk9I7VVetIB0gD MigDBWW8EpcVEcJOimUyjQFFhoAQQpjjtIIwKSOd1Oi2gKCvoDRVNjUWsYKUxsTR+5Xo 44sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6bTJzRXW7jNXBKT5skgKVMXSZC2iIt/8C7gCgpPsPvU=; b=DjW1w37L0MrNy6fppIHxI30RiQCgn83kFdX3p/RHyIHxXdmopIzF1xjmJHKpAGaJQf QkU8LGPxoYDwXTeeCrwVU5TK1G4wfI0lkBe8tSmL02c+PQkXfvO4T1jQDD4FZNDXOOYe DKdRyt1SBLBQdq9WuwFVtbCV09qG84VW/VG8vJAMtSeE1sR3YbsYe53yHvVtR2dBYxgq CAN8czmhg7oO+5tZ77YkBTCzTqwgMLOuEXG73RlZzq0eKOG4pIs2bqdhMB4hV6EmmHOp Wx4j655O8wv1eLODiijG94DqIxIDa9/jZi/dXZaoJtjwfbJLwHX8tgM1M39iGcEyFvO7 l8JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FGpYRNK3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa42-20020a17090786aa00b00734be0ce0e5si9275744ejc.311.2022.08.15.17.55.15; Mon, 15 Aug 2022 17:55:40 -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=@linuxfoundation.org header.s=korg header.b=FGpYRNK3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354266AbiHOXoI (ORCPT + 99 others); Mon, 15 Aug 2022 19:44:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354163AbiHOXla (ORCPT ); Mon, 15 Aug 2022 19:41:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB41155C80; Mon, 15 Aug 2022 13:10:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E4CC660B6E; Mon, 15 Aug 2022 20:10:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3478C433D6; Mon, 15 Aug 2022 20:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594250; bh=STOvAYvZ+Oqot9J6Qhrc19Z573drTRyhxfneGIMJ2JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGpYRNK3lSZXdtOIn5gsetCX5iQINI0LcdKAIlk/eUk8//ysEaeylwCRK8mTD8Luf BGnIyluJFKS6BiYPRnq+51yzAb0R27orwPowoVZU8WrIg7Zuss3n5J8I2lKGN8Ic60 /Md3ej0PFBc7mkgojpBMwYip+vgmqjDCfQD56qOQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunfei Dong , Chen-Yu Tsai , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.19 0401/1157] media: mediatek: vcodec: Initialize decoder parameters after getting dec_capability Date: Mon, 15 Aug 2022 19:55:57 +0200 Message-Id: <20220815180455.719155016@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Yunfei Dong [ 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 Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index 52e5d36aa912..50cfb18f85ae 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_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; 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 995e6e2fb1ab..95a53385a61c 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) 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); } -- 2.35.1