Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8900486rwb; Thu, 24 Nov 2022 05:46:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EkxIgp5JpjDD+E04UJtHSAZ5Yik1WO4gET5Nwqf38g08vCNViBSgUB8bnUKiJ7Odwhmlr X-Received: by 2002:a05:6a00:2b4:b0:537:51d3:db1b with SMTP id q20-20020a056a0002b400b0053751d3db1bmr15792985pfs.42.1669297597173; Thu, 24 Nov 2022 05:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669297597; cv=none; d=google.com; s=arc-20160816; b=eCB1GXtc1HLOsKPZxhgOffczWmbv7zpa006bo1VWMpJ7nbWL9FuxCwSNqs8sKKllM6 zb+At1RgMGLz7Xe43iEdXn2hboEtlrX2gpbnIu7BhVaq02xTfOEXnxl56g2E7TjRh7vn FVte/wHpwuYGRQFM1ZFq3OnYobkxA8IC6FgUS/yYmbexZ8Rsc3GhjVVZnW56/4hDB4U4 NmsRU02FXVL6VNsvlXVrxKcCbGYJvBiYrFaDZE+wvWK0aSfgNHuFmaAOWDKSDFZPqsDi I3/Nd5c9qPlStajSeXoaUBn3nio+ZyfMO/TX9nIInMcxkS0ADY13sqkE15KsFy6Ep8HE yAgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rLCTK3+bAPoK3vfhKOjAEb17AvOeLaSrhuhfsvzJ0ew=; b=ZxYgZtJN2u5R+u8Re010pxkdiebECaN7TpcehjlZb8c/C0R4lWCvfUPwZj6VwtON/m SGQLxC9zJnFzetfEIVln2Q6O+Oe5r+Q4VsGcPfY7Esh3vKWCpeG/GAHXomySHP4OroXD nRnTC/tll8xETebp3yRqRVBWQaSTC7ireov0mICCDK2WIH6u1woT9bIoByf/vuCt/Pnl 5AUYO4/Y9uQ9g11x9GTT/PDwpSHEIOlnQ5PnqswqwQfxIKGJul9rx83zlkSqusZGjZbX bwN3TVwoLkexnRbdgHpbsh3jL+nSvLefcud3cPa5SWWqI+4D/AeH9AuWG36Y5p2YAD/0 9JJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UViwtaoM; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a170902b49400b00179f9521d08si1046163plr.149.2022.11.24.05.46.24; Thu, 24 Nov 2022 05:46:37 -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=UViwtaoM; 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 S229952AbiKXMxJ (ORCPT + 86 others); Thu, 24 Nov 2022 07:53:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbiKXMwk (ORCPT ); Thu, 24 Nov 2022 07:52:40 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F14C313DE1; Thu, 24 Nov 2022 04:52:36 -0800 (PST) X-UUID: 289773310c80450ba56b53094616c30b-20221124 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=rLCTK3+bAPoK3vfhKOjAEb17AvOeLaSrhuhfsvzJ0ew=; b=UViwtaoMU8EAyEIb75OiKzOfVQKd3Zwn5CNUHwwDX3tZWXfiN3b0NQ+yfDKBI4zfXA1IDuCCSPC80K3ZMs6WMpgYBdmOabEQrgTmOzR6iJvxCol03TliXubatC/7nsTMVeEpBqtsZXjD05LKFiMj+WU0gBhc2mbLzM1dqNCyB0Q=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:b889db77-8b70-44df-bee2-af412f5e8d40,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.14,REQID:b889db77-8b70-44df-bee2-af412f5e8d40,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:dcaaed0,CLOUDID:b6b625dc-6ad4-42ff-91f3-18e0272db660,B ulkID:2211242052328YZ5HX0X,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 289773310c80450ba56b53094616c30b-20221124 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 782764502; Thu, 24 Nov 2022 20:52:29 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 24 Nov 2022 20:52:27 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 24 Nov 2022 20:52:28 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v1 09/12] media: platform: mtk-mdp3: extend GCE event waiting in RDMA and WROT Date: Thu, 24 Nov 2022 20:52:22 +0800 Message-ID: <20221124125225.24538-10-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221124125225.24538-1-moudy.ho@mediatek.com> References: <20221124125225.24538-1-moudy.ho@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain 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, SPF_PASS,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 Support for multiple RDMA/WROT waits for GCE events. Signed-off-by: Moudy Ho --- .../mediatek/mdp3/mt8183/mdp3-plat-mt8183.h | 2 ++ .../platform/mediatek/mdp3/mtk-mdp3-comp.c | 17 +++++++++++------ .../platform/mediatek/mdp3/mtk-mdp3-core.h | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h index fb9b34fa901a..f6a8aad33521 100644 --- a/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h +++ b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h @@ -11,8 +11,10 @@ static const struct mdp_platform_config mt8183_plat_cfg = { .rdma_support_10bit = true, .rdma_rsz1_sram_sharing = true, .rdma_upsample_repeat_only = true, + .rdma_event_num = 1, .rsz_disable_dcm_small_sample = false, .wrot_filter_constraint = false, + .wrot_event_num = 1, }; static const struct of_device_id mt8183_mdp_probe_infra[MDP_INFRA_MAX] = { diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c index e6d2da173d6f..265b712d762f 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c @@ -280,14 +280,17 @@ static int config_rdma_subfrm(struct mdp_comp_ctx *ctx, static int wait_rdma_event(struct mdp_comp_ctx *ctx, struct mdp_cmdq_cmd *cmd) { + const struct mdp_platform_config *mdp_cfg = __get_plat_cfg(ctx); struct device *dev = &ctx->comp->mdp_dev->pdev->dev; phys_addr_t base = ctx->comp->reg_base; u8 subsys_id = ctx->comp->subsys_id; - if (ctx->comp->alias_id == 0) + if (ctx->comp->alias_id < mdp_cfg->rdma_event_num) { MM_REG_WAIT(cmd, ctx->comp->gce_event[MDP_GCE_EVENT_EOF]); - else - dev_err(dev, "Do not support RDMA1_DONE event\n"); + } else { + dev_err(dev, "Invalid RDMA event %d\n", ctx->comp->alias_id); + return -EINVAL; + } /* Disable RDMA */ MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_EN, 0x0, BIT(0)); @@ -582,10 +585,12 @@ static int wait_wrot_event(struct mdp_comp_ctx *ctx, struct mdp_cmdq_cmd *cmd) phys_addr_t base = ctx->comp->reg_base; u8 subsys_id = ctx->comp->subsys_id; - if (ctx->comp->alias_id == 0) + if (ctx->comp->alias_id < mdp_cfg->wrot_event_num) { MM_REG_WAIT(cmd, ctx->comp->gce_event[MDP_GCE_EVENT_EOF]); - else - dev_err(dev, "Do not support WROT1_DONE event\n"); + } else { + dev_err(dev, "Invalid WROT event %d!\n", ctx->comp->alias_id); + return -EINVAL; + } if (mdp_cfg && mdp_cfg->wrot_filter_constraint) MM_REG_WRITE(cmd, subsys_id, base, VIDO_MAIN_BUF_SIZE, 0x0, diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h index e5bd75ff90ee..d0a2ec11e67f 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h @@ -40,8 +40,10 @@ struct mdp_platform_config { bool rdma_support_10bit; bool rdma_rsz1_sram_sharing; bool rdma_upsample_repeat_only; + u32 rdma_event_num; bool rsz_disable_dcm_small_sample; bool wrot_filter_constraint; + u32 wrot_event_num; }; /* indicate which mutex is used by each pipepline */ -- 2.18.0