From patchwork Sat Dec 10 07:32:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WXVuZmVpIERvbmcgKOiRo+S6kemjnik=?= X-Patchwork-Id: 31978 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1184458wrr; Fri, 9 Dec 2022 23:34:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6dycRT2hGyfdm4lL2sxSthbgtbIz6H1Xb2ZJcU3TWg4+yUtH4zKx/sjaLvLcIeI2sFSKGP X-Received: by 2002:a05:6402:1f8e:b0:45c:835c:eab6 with SMTP id c14-20020a0564021f8e00b0045c835ceab6mr8377715edc.36.1670657683550; Fri, 09 Dec 2022 23:34:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670657683; cv=none; d=google.com; s=arc-20160816; b=hBLxP/mCLAR6nq9SRucbP0AVoh/+Z9yBuoO2MMxSoU6rPn8fMEirti+dKfaMjUC6aj 1axWZgTY+MqMMIPi80nkufflE4pNq0/kixv3Oj+0MeLniUHqQLwvpIUM8+TY957N4kam yD2yeYy2smUeUVZ02ICXMsR60T0bqhr0lJcKB8R3ro1h0wRAphTtNW2XpwBCbQWRUXPI Zl1nyDX/d+OfTYqax4yIS9Ds0HP8tooIWe/WsQf9OLtjfA8b0AIvJeUI+ICaS5nyaESR eW/OljypLFhhshpJZX1xxObIp3M9PGnhbWKZVYsj2bP1t2QLlFKavrI10AUjMgVFlS60 0jmQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sAiL5PkBTmgJc7hwfS7p7RsdgPoufa31hrlJwDk2pyc=; b=uwwot/ZQTgcHpTjYqzg+lyZuOFbqK6KX2Ky6lfXXcSKh53iHGdljT53Rin4TuXfUVo RCJocLBDyIjzSjYvKBn83lWElhKUyoNN2INnvnwhuNjsPzEkJpof+0vRB445Z7r6jcBB griRriy1Ggxjf+PaaKyuPfvUdwdLzHYq7koGRuJzyrjNB86ZovaALgL6VIsBIg/uEIb3 wo+94Wo8/Brd3fRFM0Z/n9EGO/WsJrWdvxsuYQauCpmaqqJtQRuNU4vcwbXiUIiTh8QU iup4kDE1t909QT8z5NP1pvw/AAdD9116w3E6XexjCXlo2R9r1yFxa9tz2QhsOBSvgo93 nCtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=solOnwkw; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a50e601000000b004677d91cdeasi2969046edm.244.2022.12.09.23.34.20; Fri, 09 Dec 2022 23:34:43 -0800 (PST) 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=@mediatek.com header.s=dk header.b=solOnwkw; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229734AbiLJHch (ORCPT + 99 others); Sat, 10 Dec 2022 02:32:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbiLJHcf (ORCPT ); Sat, 10 Dec 2022 02:32:35 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0599925E87; Fri, 9 Dec 2022 23:32:29 -0800 (PST) X-UUID: 87ab1a13f3444c90a7284eeea5fb23ef-20221210 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=sAiL5PkBTmgJc7hwfS7p7RsdgPoufa31hrlJwDk2pyc=; b=solOnwkwjOuKOGh0w3+B7MaXJccBeV4p1C1Q88TCZAoA5f6ztVFIXBy4WPzzyK+KzryARfeKICB8s5pCTrOiJcws5KeDSyTLiJEZSE79kzRlL7GW9UothvE/0pOIfuzElIHRjgjU/WNsdRwTh+tAHWkvjbiJTNU+pcA3XVSW4oA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:721d517f-bf02-474c-851e-e11a6bdfc3aa,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:dcaaed0,CLOUDID:cee4dc24-4387-4253-a41d-4f6f2296b154,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 87ab1a13f3444c90a7284eeea5fb23ef-20221210 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2081499845; Sat, 10 Dec 2022 15:32:24 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Sat, 10 Dec 2022 15:32:22 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 10 Dec 2022 15:32:21 +0800 From: Yunfei Dong To: Yunfei Dong , Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Tiffany Lin CC: Mauro Carvalho Chehab , Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH 2/5] media: mediatek: vcodec: using each instance lat_buf count replace core ready list Date: Sat, 10 Dec 2022 15:32:15 +0800 Message-ID: <20221210073218.17350-3-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221210073218.17350-1-yunfei.dong@mediatek.com> References: <20221210073218.17350-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751811551551161470?= X-GMAIL-MSGID: =?utf-8?q?1751811551551161470?= Core Hardware decoder depends on each instance lat_buf count, calling queue_work decode again when the lat_buf count of each instance isn't zero. Fixes: 365e4ba01df4 ("media: mtk-vcodec: Add work queue for core hardware decode") Signed-off-by: Yunfei Dong --- drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c b/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c index af7ddba1923a..2b88065d4d2a 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +++ b/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c @@ -247,7 +247,7 @@ static void vdec_msg_queue_core_work(struct work_struct *work) mtk_vcodec_dec_disable_hardware(ctx, MTK_VDEC_CORE); vdec_msg_queue_qbuf(&ctx->msg_queue.lat_ctx, lat_buf); - if (!list_empty(&dev->msg_queue_core_ctx.ready_queue)) { + if (atomic_read(&lat_buf->ctx->msg_queue.core_list_cnt)) { mtk_v4l2_debug(3, "re-schedule to decode for core: %d", dev->msg_queue_core_ctx.ready_num); queue_work(dev->core_workqueue, &msg_queue->core_work);