Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3023108rwb; Mon, 15 Aug 2022 16:20:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR4bBLjZx4ASXytvuIXNZbSbfOtHLyPgI4oJBIwhrp9BvkRoBUNGcmn+OCVLRUCec4SHi5U6 X-Received: by 2002:a17:907:97cb:b0:731:6d1:13fa with SMTP id js11-20020a17090797cb00b0073106d113famr11539582ejc.375.1660605637371; Mon, 15 Aug 2022 16:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605637; cv=none; d=google.com; s=arc-20160816; b=vFiOqFMt9RjX+NG+ABLdw3AJKImZBLm1FwD2G4l+/lkRSasGFuAJYS7gMGRVbJkxL/ zDOyM7a4yL4OKNro4SZkoikHl0BT1ugmGW8vsxw8fpzuO2XEfX7TVKYjGRXgUkKg16d2 lYJmVuULv+uEeHLTf+PdKfkmjx559lF2T7khKNLHUsuka0IsAcYnYo4ZD4EH4Z0pRfxD 0mUvlea1FLFrsItiuGAk7oOjG8lneBMdj7aVNVoO+TuE4N8SOKzP/VG8RdkIQlZDttOi oCFJrrQcPF24eqiMNAGbiPbfXmr8uiIvcwd9WDvX2rVAXv3xEgIKBG/yOyH58soFpJ+3 khLg== 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=TPbReBeeLIbSdfQdySN+zSoFabET3fOtpTgDDbPYrVE=; b=YGkcn3/uh9rySKSsbYurPhECMMZsFrEDIQ9javvEUhsvBD9B7SfNf4ekhVaAfcVu47 7uuKUcu26TnjNa20gJmgvgF67Ak4xt8RWhYAjt9XOzhp84tAuDo2XDPaWXfEq/fO827q ST4SXAoqgFaiUfoOSR4S4RsURfng1RYhcCjxqF0xDt+qrLrNmluGJXYbS52I8C0c4DXu Ow1FrvhCEozWhqvfzU4+fEc3UQKNvcqqM1TR8GCY/ZTnRE1PqE6hWh7+23iiRKTXme62 JuYF5O5mnvRB4ZNty/izOEfccVcS2L2HpNQbfuz3P1orffEisd4RVk1G4buFZ2zC/ElY Qviw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eqmNSOG1; 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 sa15-20020a1709076d0f00b00730551afa8esi9736397ejc.885.2022.08.15.16.20.12; Mon, 15 Aug 2022 16:20:37 -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=eqmNSOG1; 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 S233272AbiHOVMr (ORCPT + 99 others); Mon, 15 Aug 2022 17:12:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347913AbiHOVHp (ORCPT ); Mon, 15 Aug 2022 17:07:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E8683C8CB; Mon, 15 Aug 2022 12:16:35 -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 2CC36B8107A; Mon, 15 Aug 2022 19:16:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ADA2C433D6; Mon, 15 Aug 2022 19:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590992; bh=G6869hI4IspcflH37LO4N3qRMAFa9aQF+7X6uqFqdmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eqmNSOG1IDQsuq8VErMfKgPK7VT/p+GZGJ1R3tzbTcePqc3AkHA8mvH70I7+lWu1m Yx9pE1DolyQG5o6mrfTITaKQKhD9Lx83ovH/3zG7C5z+DIC7HV2FVfJKxGe6R+DPII p0KNBwfBQdfm0IC6okXhxK9R4Oy0E1OnOa5yiOiM= 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.18 0430/1095] media: mediatek: vcodec: Initialize decoder parameters for each instance Date: Mon, 15 Aug 2022 19:57:09 +0200 Message-Id: <20220815180447.494572285@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 d5c94845ea42..ff8f2a4829a3 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -211,11 +211,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