Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2922003rdh; Mon, 27 Nov 2023 02:17:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGL8rpB2ijzI1ORvQH0ByUmUgTACyKHjF6ahEc9xwKIquZK7PmHpOVj1t7fGyiITs6Oy6nE X-Received: by 2002:a17:902:7409:b0:1cf:a2e7:f851 with SMTP id g9-20020a170902740900b001cfa2e7f851mr9960592pll.32.1701080227168; Mon, 27 Nov 2023 02:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701080227; cv=none; d=google.com; s=arc-20160816; b=S4/4rzAVuVkguKEJmnypazdlKsxDpKo2de7n+iP/EMRL2lqTpm8QermHVwuKVzFIaR qCqwQc5xa71a7BQEWnk3Ax5/6m5YGMlbFemaxYAMBU3d8JmhfxQmji63+mTg/l3vsJqX YI4D7T+XAxLzk47z3c22bJA2Akn10ytNQjE3vpDTm1/4sbJp1Qd/mqmFoSrJuovtrS8e ECvByIAOs5uX2lMbbtBCiGDpoLoidB2gC2hwwWNbk5yZuRtJx0XKcniXiWywjlw+G+zs fOAoWfJYFRQZWa+2D40STNobmibhV+xD56Nw5wEDnlI+2bYyQ/Y2kM33kHuhNdR9OtsG Svwg== 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; bh=qAir5prZx3OOSgd/1VWpkEMlcW2TQn01jYi33MJK7ew=; fh=4YOkgeY3KRf6T7ZtLnNZgE8CKERen/fmEgSpOmT/Qes=; b=btuxwvSTZU2LYapgz9BW94C3Gx01qm6Bz6F4jSumTnopEOTMufVEEyszoabTpAiPbo Zf5Ly6Ndv0g8IUDKJg5arI/LRaDJ4NmSTqj5UpzRofxeuGRJpx+MSlLftmJuFidu7Fp2 vEM3VNpH/26A13fd3rG5dslI0DJ6UELO3vgNwvgImZf+M2jLveFzOegxsJ7QtjzjTBPU FZV0XNvETszemZsN9PEO1hlYKUlPRqBwMW5LT5nrU03HfnJlO0+RgGnFceC9rP86CBGX aSm44DrSESZtOBYE2Jaz6ikdAkS/fv+N3yys7HdOKKci1jr9z1DlXXUKzjjkrDUYdsLi Vivw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x20-20020a170902ea9400b001cc45fcb81fsi3383847plb.334.2023.11.27.02.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:17:07 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0E9D18078602; Mon, 27 Nov 2023 02:17:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232859AbjK0KQr (ORCPT + 99 others); Mon, 27 Nov 2023 05:16:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232738AbjK0KQq (ORCPT ); Mon, 27 Nov 2023 05:16:46 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2668C0; Mon, 27 Nov 2023 02:16:52 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DD4422F4; Mon, 27 Nov 2023 02:17:39 -0800 (PST) Received: from [10.57.4.90] (unknown [10.57.4.90]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B068D3F73F; Mon, 27 Nov 2023 02:16:50 -0800 (PST) Message-ID: <573ec775-c1f0-4a09-afe4-83793fb11f3c@arm.com> Date: Mon, 27 Nov 2023 10:17:51 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64: dts: rockchip: Add dynamic-power-coefficient to rk3399 GPU Content-Language: en-US To: Chen-Yu Tsai Cc: linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, conor+dt@kernel.org, daniel.lezcano@linaro.org References: <20231127081511.1911706-1-lukasz.luba@arm.com> From: Lukasz Luba In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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]); Mon, 27 Nov 2023 02:17:04 -0800 (PST) On 11/27/23 10:02, Chen-Yu Tsai wrote: > On Mon, Nov 27, 2023 at 4:14 PM Lukasz Luba wrote: >> >> Add dynamic-power-coefficient to the GPU node. That will create Energy >> Model for the GPU based on the coefficient and OPP table information. >> It will enable mechanism such as DTMP or IPA to work with the GPU DVFS. >> In similar way the Energy Model for CPUs in rk3399 is created, so both >> are aligned in power scale. The maximum power used from this coefficient >> is 1.5W at 600MHz. >> >> Signed-off-by: Lukasz Luba >> --- >> arch/arm64/boot/dts/rockchip/rk3399.dtsi | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi >> index 9da0b6d77c8d..87cfdf570b19 100644 >> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi >> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi >> @@ -2113,6 +2113,7 @@ gpu: gpu@ff9a0000 { >> interrupt-names = "job", "mmu", "gpu"; >> clocks = <&cru ACLK_GPU>; >> #cooling-cells = <2>; >> + dynamic-power-coefficient = <2640>; > > For reference, in the ChromeOS downstrean v5.10 kernel we have: > > gpu_power_model: power_model { > compatible = "arm,mali-simple-power-model"; > static-coefficient = <411522>; > dynamic-coefficient = <977>; > ts = <32000 4700 (-80) 2>; > thermal-zone = "gpu"; > }; > > This is for the Mali kbase. That's downstream driver for downstream IPA thermal governor, which is different. As you can see there, there is a split of the total power to 'static power' and 'dynamic power' and thus those 2 coefficients: 'static-coefficient' and 'dynamic-coefficient'. There is also polynomial for the exponential curve approximating temperature impact to the increasing leakage (static power). This is totally not upstream code and quite complex to derive thus fly upstream. Therefore, in upstream we have very simple power model right now, but it will be possible to update it at runtime when the leakage is increased. I hope the new v5 version that I'm going to send, will get into mainline soon [1]. Regards, Lukasz [1] https://lore.kernel.org/lkml/20230925081139.1305766-1-lukasz.luba@arm.com/