Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3729685rwe; Mon, 17 Apr 2023 02:39:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZmmxJUdxjQengVfLPIIcjMiQcnR7Xu8McdJtUaaTZ2BAeaUpOLdvR8hdFPMJnJt/X7hzRZ X-Received: by 2002:a05:6a00:14cc:b0:63b:6933:a30d with SMTP id w12-20020a056a0014cc00b0063b6933a30dmr14685486pfu.25.1681724366773; Mon, 17 Apr 2023 02:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681724366; cv=none; d=google.com; s=arc-20160816; b=sZxKn9uy8g/zqeDROolpI2mBLqqyJu2dd2PiAt2zWMeWx8XRZiuRt3ohvxVYqw3wQz 7lr+XUSBLtVIbdfE8ReDpz789x9WjXw4VWQ3ESXlUv5hFR4QCKg8MhYGA/d6BvZfxE1E f14Wubvuhp+ClEu/v7YGKFueAG5QCrbQyXmSd4eRbXPP9YQPO0ZBCWQb6BzgqCGqAI+g PVT9H5dKE0JNU+ktpKsrF9GF3grttbY+3NALF0K25ld4AKBm6kmG8aW/fvPUgU+WZVVd XC4Mvaga2G0D+VtzybiUM2z6/F3oEbGwO8x6bUjHG3QNDD2SMatReuuGEn8XdXb+vyDH A8Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3d3ifGtWAm1seKmtTc8VKrnsqJUi9hIvXWARZZ37dzY=; b=Lro4eOYvKqkwf6Jcz1YWpiaxAtvNMjAXpyhscfAMDwEJrf1who2WOaEGi7vtorDBzk yK1tts/i3UW5UMJP6wG5HNlDtBHNmjCcDMq1l3V0RXwxBxwUUGnBdQzwM1CIeHgRHmn9 /JsWyrzuV27xcQuilWpi+JhDCB6gkMXwCMgpFsFEUjtdnJgd5lGlFOjnXnvY0dq7aOa8 NaPyRlVbl24bQHbR/cHrTaIoUpq1H1pXGP8r/PozjsHlBaxI2s2XqPV1nnjbfale4W57 aWAUAHk/ZyNORlu5uLn3yGljxDiaSpAMZhkCWuP8F8EixD0kFTKiRZTecBERHwc0keis +SSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=HVjqv50r; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h21-20020aa796d5000000b0063d2eae52cdsi190785pfq.224.2023.04.17.02.39.15; Mon, 17 Apr 2023 02:39:26 -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=@collabora.com header.s=mail header.b=HVjqv50r; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbjDQJgf (ORCPT + 99 others); Mon, 17 Apr 2023 05:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbjDQJgQ (ORCPT ); Mon, 17 Apr 2023 05:36:16 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30B21526D; Mon, 17 Apr 2023 02:35:39 -0700 (PDT) Received: from [IPV6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2] (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id B68B16603050; Mon, 17 Apr 2023 10:35:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681724137; bh=QbaAg8NSbQhZf+R83qw59tCN5hywaWcaUrmWKWZXTyU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HVjqv50rUaQjAKGVeiL4GIggSCWrywwXkSBKv4hPhGrFXDt+vIPS+IfPfzAVz9naa DNGl31fkP2Pu0NAaB9QS6GV9HxZfbvhsWrEzVD24UVeWUvcmg1LQejIhWi4+kzJ4Rb 6IDUpwIEvmbsr0t5A+gwU5LMNhG3xX0+LYumN/7wcg9zGCPdwY2ShdlTq0yo0cShMU 9aMeRmhaUy7zEazoIuicOn1T+pQUbrML12lyttXfyRzoDPSB7REkmVqdhjKGtGyXvd BXg3Pk75kpM6PPGu/Ec+I4kTMmHTt/m2UzNXAqUCFP1R1/uPvuIjkIVc8+qqbPZuAN 44K0Jvb5n0MLA== Message-ID: Date: Mon, 17 Apr 2023 11:35:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH 5/6] media: mediatek: vcodec: move core context from device to each instance Content-Language: en-US To: Yunfei Dong , Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , Benjamin Gaignard , =?UTF-8?Q?N=c3=adcolas_F_=2e_R_=2e_A_=2e_Prado?= Cc: Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , 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 References: <20230417054816.17097-1-yunfei.dong@mediatek.com> <20230417054816.17097-6-yunfei.dong@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230417054816.17097-6-yunfei.dong@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 Il 17/04/23 07:48, Yunfei Dong ha scritto: > There are so many lat buffer in core context list, some instances > maybe be scheduled for a very long time. Moving the core context to > each instance, it only be used to control lat buffer of each instance. > And the core work queue of each instance is scheduled by system. > > Fixes: 2cfca6c1bf80 ("media: mediatek: vcodec: move lat_buf to the top of core list") > Signed-off-by: Yunfei Dong > --- > .../mediatek/vcodec/mtk_vcodec_dec_drv.c | 1 - > .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 2 - > .../vcodec/vdec/vdec_h264_req_multi_if.c | 4 +- > .../vcodec/vdec/vdec_vp9_req_lat_if.c | 2 +- > .../platform/mediatek/vcodec/vdec_msg_queue.c | 53 +++++++------------ > .../platform/mediatek/vcodec/vdec_msg_queue.h | 6 ++- > 6 files changed, 25 insertions(+), 43 deletions(-) > ..snip.. > diff --git a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h b/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h > index a80b9853cec9..ae37d020a1bd 100644 > --- a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h > +++ b/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h > @@ -83,10 +83,11 @@ struct vdec_lat_buf { > * @wdma_wptr_addr: ube write point > * @core_work: core hardware work > * @lat_ctx: used to store lat buffer list > - * @ctx: point to mtk_vcodec_ctx > + * @core_ctx: used to store core buffer list > * > * @lat_list_cnt: used to record each instance lat list count > * @core_list_cnt: used to record each instance core list count > + * @flush_done: core flush done status > * @empty_lat_buf: the last lat buf used to flush decode > * @core_dec_done: core work queue decode done event > * @status: current context decode status for core hardware > @@ -100,10 +101,11 @@ struct vdec_msg_queue { > > struct work_struct core_work; > struct vdec_msg_queue_ctx lat_ctx; > - struct mtk_vcodec_ctx *ctx; > + struct vdec_msg_queue_ctx core_ctx; > > atomic_t lat_list_cnt; > atomic_t core_list_cnt; > + bool flush_done; flush_done is used in patch [6/6]: this does not belong to this patch, please move the addition of this member in the same patch where you use it. Regards, Angelo