Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp518755rwb; Wed, 7 Dec 2022 01:20:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Afo08ju0Wla4v9owJXNoZfZja6+LYn07nGGFOj7AvoQdLLBZ+bmGC6WjnwHLSvOrmDgw6 X-Received: by 2002:a05:6a00:1d22:b0:577:16ac:8447 with SMTP id a34-20020a056a001d2200b0057716ac8447mr10773791pfx.56.1670404850400; Wed, 07 Dec 2022 01:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670404850; cv=none; d=google.com; s=arc-20160816; b=rpBELmbLBkICjCG3O/qC7BnBGXeHZ132GKm4Mw7x5Gx10NxN6OpkTPNVhR1Ag+dXjK Eq+/0M1jWQC5KA9kiHZrDJASNsVdsD3mXyA5g8NjJfqWEIMc20/Ra745KZyUNwEuOEWL 6e4UKIGIyIM1YMTbh8e1izqtG+97dYcj7gwW6K0FerlFq2y0ZNot/zJDMiOViTxtJjQk bpFR80MHO53Lqa1Y3jtzFiBj23SiGPv5p9TWMmA2VsHSCSiDiedljIgtbFZLNa53fWVd NZWgk9HYQbk6RF3HJ5wSWY/XPTwoC8wloIev+y0VW+8iQ0w+216/7t1+xD4IjCMUb4zj 4KrA== 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=r5fpN6BM+80cuO4SBMj+tDlR264tCf/urh197XSkJjXcv17/xHBZYtDyrX9lft5HOZ o8rCCBytGzFX8QB6RvsxHeioSRajHnaGeAwVw7h+gJM5o4dImTU/IFiHsfl9WEf8yQsZ DLMo3/oSOTA7e42y+xW80cAdzCvj78T4TnoKcutPgQiYvc5aPQObpmeGKYOFCBqskOjG M/lppb6rZN0qFfzZ4yFkXin6Ruer7U9p7p1g2OFF8GpqucfXBmu3cQ5+x9K4UOMtfQh/ THNqg+W93qJDV4GGyn6fJjIBBakMidqs6jus9TPKUC7HkBrllRJ7A6dFRNGKFygghs+E Ko9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Fz+4n7ci; 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 a2-20020a1709027d8200b00188d23093e8si18379651plm.319.2022.12.07.01.20.40; Wed, 07 Dec 2022 01:20:50 -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=Fz+4n7ci; 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 S230058AbiLGIp6 (ORCPT + 76 others); Wed, 7 Dec 2022 03:45:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiLGIot (ORCPT ); Wed, 7 Dec 2022 03:44:49 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B220932047; Wed, 7 Dec 2022 00:44:24 -0800 (PST) X-UUID: b8c06fe1d8304a41a9fa7d144c33538b-20221207 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=Fz+4n7cihYepPhIjYjf5J6DtwthHozDenqAgGU+3ftybIQIdJDWH0FhwkRK/OpG48QTJz4liAiixOEMzEvn72LL6GCOTSxxVtlXllt/EbkxjRIw07WLp60ZQUiAQzWse2qXTG6boZwPWyiYnJawXz7icOgF//sP+zFoWHDf6l88=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:12753e8d-d885-4ac3-a52d-5c04fe149a36,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:12753e8d-d885-4ac3-a52d-5c04fe149a36,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:16f79024-4387-4253-a41d-4f6f2296b154,B ulkID:2212071644177EZ45RI0,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: b8c06fe1d8304a41a9fa7d144c33538b-20221207 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 635495241; Wed, 07 Dec 2022 16:44:15 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 7 Dec 2022 16:44:14 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 7 Dec 2022 16:44:14 +0800 From: Moudy Ho To: Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Chun-Kuang Hu CC: , , , , , Moudy Ho Subject: [PATCH v2 09/12] media: platform: mtk-mdp3: extend GCE event waiting in RDMA and WROT Date: Wed, 7 Dec 2022 16:44:09 +0800 Message-ID: <20221207084412.14075-10-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221207084412.14075-1-moudy.ho@mediatek.com> References: <20221207084412.14075-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