Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3124685rwb; Mon, 15 Aug 2022 18:44:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR4FC3NwaGOIAVS+9E36C0SoAiEotqwuGS+3HRcctoeW3WAl3b+PHW92Pj3vjNGrjhr6tmuq X-Received: by 2002:a17:907:2816:b0:733:c08:fe6c with SMTP id eb22-20020a170907281600b007330c08fe6cmr11872552ejc.325.1660614275884; Mon, 15 Aug 2022 18:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660614275; cv=none; d=google.com; s=arc-20160816; b=rb/XEiOS4VmpY5oiLiHLUusLVmBTkVm5JKa8DuaxPgVVU74GnCeqmOGJCKNvOBC2M3 jyKAJjedEzeC3p2oiBds5n7yDtO+TrDbc+XMKw5HAmep2Yc5HCmpEUHQMU/wFD/UxGiJ AZrX6R+W6stsu7IFguh6bQvmjRYrzGMuaFoIFNa+bWl/nfuDAYnyZlkaOU8UsLZNALjF I0ZlJotehXb2XR4XzZRDFUzub+ZEzZEVs0a9Fe7gk/WdNDNlzRrQJcP1X1nuFRy6yGPG +BIT6H8rH1o6gXCk6RHNODcRcNs4oJ1ilGjfsMNc15vgpABgCgaiTaKunp/F0QQBRjye EnZQ== 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=SJ2SNoFoOmmFwDPi8VHTDnfvHvOH8BtjgpOeOHbLP3k=; b=WIbZhDRM4AWhG2UxHoAsE5Zl2aP2nrPIDSRPu7fhCWiC6E9sxw3akqOvpyjDC9nxfe H1qXl3xZL94frFT46CZ3WdUgK2Tu+gebDBydPGGVePmhiBa9NlXPKRDMcuALHkaeqz9+ MkB52pSCQejS0RNseDq3Frl6pGG6csZyL2GrwY9LBY3oMLKPqZjyAbPckW6EYpcTIt7b ZQkDyGuwsTve9v2uTBbuHDWOzGEgLTFQPFv4/k6y14oclEI9+7YRSScFZqFfBkMSkef4 nFmUbLHlGi2PqZzZgZtFrARoA+lLGtaVjq616zSh9ha0ehFSETssG7NitaAtVg/dZuse eNRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EoaRk3Oc; 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 x7-20020a05640226c700b0043be2131ffdsi10665377edd.46.2022.08.15.18.44.10; Mon, 15 Aug 2022 18:44:35 -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=EoaRk3Oc; 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 S1354854AbiHOXu5 (ORCPT + 99 others); Mon, 15 Aug 2022 19:50:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354798AbiHOXq0 (ORCPT ); Mon, 15 Aug 2022 19:46:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E133C0B62; Mon, 15 Aug 2022 13:14:48 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6FB98B80EAD; Mon, 15 Aug 2022 20:14:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1BEFC433D6; Mon, 15 Aug 2022 20:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594485; bh=sYRBNcx3JEX19z5haS8TFFrgOPcKTVSzhQglR1OoOgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EoaRk3OcHoGloEZnD2zfI7a4VWMxrQDQ+KA+ZeMul80OQuavw3G6k7HlPQc+cNoDw KnbqZJ59N3CotoNmyFPgl4jvEGR+gK9/2br5pFllrQLeslRUKMg/E6WOGwoMDFHvXa DCR32ud6Z6yi2MyS0JmPhBo2Yagcr5r4wVFsRADE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , Yunfei Dong , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.19 0462/1157] media: mediatek: vcodec: Initialize decoder parameters for each instance Date: Mon, 15 Aug 2022 19:56:58 +0200 Message-Id: <20220815180458.088580623@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: Chen-Yu Tsai [ Upstream commit fe3d651627d61210c6905339e5281d3b9db75033 ] The decoder parameters are stored in each instance's context data. This needs to be initialized per-instance, but a previous fix incorrectly changed it to only be initialized for the first opened instance. This resulted in subsequent instances not correctly signaling the requirement for the Requests API. Fix this by calling the initializing function outside of the v4l2_fh_is_singular() conditional block. Fixes: faddaa735c20 ("media: mediatek: vcodec: Initialize decoder parameters after getting dec_capability") Signed-off-by: Chen-Yu Tsai Reviewed-by: Yunfei Dong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 99d7b15f2b9d..eed11a62febf 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -208,11 +208,12 @@ 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); } + ctx->dev->vdec_pdata->init_vdec_params(ctx); + list_add(&ctx->list, &dev->ctx_list); mutex_unlock(&dev->dev_mutex); -- 2.35.1