Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp142921rdb; Wed, 18 Oct 2023 22:57:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEG1N5ZtRi7V0TXNIt9gNWK1BqeDI6/EptmgwE+YCKDzxf3vHimF4W70Yl+PlXaooF5xeUm X-Received: by 2002:a05:6808:1b0f:b0:3b2:f576:3f97 with SMTP id bx15-20020a0568081b0f00b003b2f5763f97mr1649324oib.12.1697695046844; Wed, 18 Oct 2023 22:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697695046; cv=none; d=google.com; s=arc-20160816; b=sOmAqo0NOYVGEvZ6roc4AOD4nAiorvcs8LeqnGtHlFAtEP8fQuXIh07SXM26Ikx62l /ENYDGkEYr6mu60pXNuujzTiBADleZTCSkZ17H9kwqdIS4DFbH1mHlR5C7TK/HGXXBt3 HUYg69yFIko2dAaRDzHAvnbp3/oqND1xyBWmqEdUO3Rt1Zo3z7zadKOOWN6gYkogvUH+ b3NqavjZIpFbXIcLzwWK89gQtv/rD54xCPsgEHSmlWsjaNXosCKuiuhOWrU7tKp7gGTX 5N+DMxjT8F3+/xrWcIS0urYqYfOBEb+QOaOuEK0ZkJQex64aKL9Z3WfralMeFtQuTyn0 kL2g== 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=hCddrdlDqKBenFHKsmGj9TdLiwG7aCIS6uamT9ldeW0=; fh=fv4tbCKTXdNtjEvV4h1+g1nnsRjdLHbhnCNyWnoFRfI=; b=bPZvoq062ItD4h5VOWs63zf9OIw8HwENBNpk1+BwSjuDvOkADc/lIHBLT9VdF2EHsH PYfZ6xz5UEpAzmhnO22/YndXBBDtZrWfGvyx94z60PrpvAbj6Cl7mLO+kbRTCWpkEDD+ x914g5swuYULOLa2sfNfoXiRgJ7kW8YC5tRNkCq9BsH9yKPi/C1Pee1X18XJYt9TktAG mQqWW4zy4i7I3tIetEpKT3sNG2YmAs5cjXretH0y182U8QNLtLk2lfV5UKmAB2srhfQ8 PF/7NaR3MjLj2r/uDWD+QNetd38mfzT4KaEJiwBjNS1RS6j1FsbnP9ZrZVlk5JUYbiCC HRjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=dBY78zsj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id s85-20020a632c58000000b005b22561c968si3873739pgs.499.2023.10.18.22.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 22:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=dBY78zsj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 067028276C35; Wed, 18 Oct 2023 22:57:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232815AbjJSF4n (ORCPT + 99 others); Thu, 19 Oct 2023 01:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231705AbjJSF4e (ORCPT ); Thu, 19 Oct 2023 01:56:34 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5FC4112; Wed, 18 Oct 2023 22:56:28 -0700 (PDT) X-UUID: 3c3a52266e4411eea33bb35ae8d461a2-20231019 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=hCddrdlDqKBenFHKsmGj9TdLiwG7aCIS6uamT9ldeW0=; b=dBY78zsjgnqvcVrisbsOmlD4Ll5niGxTj5Twt6E/dI/V+goRii5xV0wm2+ozGG+DVuSuRiwolpVxzOXQt20Hoaj0Ayrnh/1sQ+R4eHljba4TWt2ymZ01u7ZaV8NiE7+NSCqzLypDqHGJfm30LKMuA9RJnExW0+CBhQkHbJ4gEP4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:14511d16-4d23-4285-a55d-b704ebda40c0,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:5f78ec9,CLOUDID:d9671cc0-14cc-44ca-b657-2d2783296e72,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 3c3a52266e4411eea33bb35ae8d461a2-20231019 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1650186100; Thu, 19 Oct 2023 13:56:24 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 19 Oct 2023 13:56:23 +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.1118.26 via Frontend Transport; Thu, 19 Oct 2023 13:56:22 +0800 From: Hsiao Chien Sung To: AngeloGioacchino Del Regno , CK Hu , Krzysztof Kozlowski , Matthias Brugger , Rob Herring CC: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Fei Shao , Sean Paul , Johnson Wang , "Nancy . Lin" , Moudy Ho , Hsiao Chien Sung , "Jason-JH . Lin" , Nathan Lu , , , , , Subject: [PATCH v10 15/24] drm/mediatek: Remove ineffectual power management codes Date: Thu, 19 Oct 2023 13:56:10 +0800 Message-ID: <20231019055619.19358-16-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231019055619.19358-1-shawn.sung@mediatek.com> References: <20231019055619.19358-1-shawn.sung@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=1.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,TVD_SUBJ_WIPE_DEBT,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 22:57:17 -0700 (PDT) X-Spam-Level: * Display modules will be powered on when .atomic_enable(), there is no need to do it again in mtk_crtc_ddp_hw_init(). Besides, the DRM devices are created manually when mtk-mmsys is probed and there is no power domain linked to it. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsiao Chien Sung --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index bc4cc75cca18..c7edd80be428 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -362,22 +361,16 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc, struct drm_atomic drm_connector_list_iter_end(&conn_iter); } - ret = pm_runtime_resume_and_get(crtc->dev->dev); - if (ret < 0) { - DRM_ERROR("Failed to enable power domain: %d\n", ret); - return ret; - } - ret = mtk_mutex_prepare(mtk_crtc->mutex); if (ret < 0) { DRM_ERROR("Failed to enable mutex clock: %d\n", ret); - goto err_pm_runtime_put; + goto error; } ret = mtk_crtc_ddp_clk_enable(mtk_crtc); if (ret < 0) { DRM_ERROR("Failed to enable component clocks: %d\n", ret); - goto err_mutex_unprepare; + goto error; } for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) { @@ -426,16 +419,13 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc, struct drm_atomic return 0; -err_mutex_unprepare: +error: mtk_mutex_unprepare(mtk_crtc->mutex); -err_pm_runtime_put: - pm_runtime_put(crtc->dev->dev); return ret; } static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc) { - struct drm_device *drm = mtk_crtc->base.dev; struct drm_crtc *crtc = &mtk_crtc->base; int i; @@ -465,8 +455,6 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc) mtk_crtc_ddp_clk_disable(mtk_crtc); mtk_mutex_unprepare(mtk_crtc->mutex); - pm_runtime_put(drm->dev); - if (crtc->state->event && !crtc->state->active) { spin_lock_irq(&crtc->dev->event_lock); drm_crtc_send_vblank_event(crtc, crtc->state->event); -- 2.18.0