Message ID | 20231127081511.1911706-1-lukasz.luba@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2929585vqx; Mon, 27 Nov 2023 00:14:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiTDbCP8h0RHrYOxa1Y4Q36kJOv35ck46uR19EorGIZJt1zrqTph1QraPAx4cxKkRSs24t X-Received: by 2002:a05:6830:157:b0:6d7:f367:518f with SMTP id j23-20020a056830015700b006d7f367518fmr13524042otp.16.1701072886501; Mon, 27 Nov 2023 00:14:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701072886; cv=none; d=google.com; s=arc-20160816; b=y3G13TqLXP4ZX/h6x9wFqOA0tIAbZpiXwUipNsBtPNhrwXkKqDgE/9dQ77/7mPUPpO R79UPqNmlPhu6NaCTqfiD9ciL1Gl4u0mPePeRkxNEEZ4cQR1T4nB7kdZpgAzwgEJaY1l QVzNesdV4XjZvPqdBlUlKLuQ5Y5yjjrHTpfN0IKWTbhnvxTbnDn3G3zcuOSj0WT8o2fc 3pT3aMzNHHOXd/Wui9WZXDnD1R2EJeAUUs4BrwRzmSCuohV9TdQoCr9dlA0wUolSPd7J nO5N1q1oEFZzqhf04U2HRF7u8OkaOplhRuMQPCOCXFxEOLg+swJGqUZSr2V6Yv1VuriI mNKw== 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 :message-id:date:subject:cc:to:from; bh=SGsNqcjEdJh+cvKaZES3Q345DXEHM+JzyfvKl+vYofU=; fh=MeMlounT9XvHJSrtlnxzI+o6jiNKR1L/5AYYsz682bw=; b=o4WxWZlJ6wtOJ0nEuq2dkzyuSxkGGqVe0SQfOJsBl3ttIFjAD1/gYGN0SLVctnIUw/ 14T7bfFFuxIzL9FlNMD6yFI9mny3j7DGIeqbW9mwxZht0OiJXOU4CFm/cgoZFnzl/qGV iXafaWiL17jsETkcx5kXxdWmA9C/X6tpIh4hIN8Sbc3HpctPeDWMIWvFA6PR18GIrfqD B3v4VjpIvX9FFF+xg7iuVa4B95aJ9hYZkqQqxZr0BtJmGpGACg1tOVuwWJX/Cy8glVtz 3TZ+N6xv1SZ2ya4a1yyEtU49ZP02c26kLpeWgRTQd6Ap+DcuYF29TTZ7dapQcdqxYNNK sPAQ== 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:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e30-20020a630f1e000000b00589878c0a5bsi8901065pgl.71.2023.11.27.00.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 00:14:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id ED7238046C8D; Mon, 27 Nov 2023 00:14:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232482AbjK0IOR (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Mon, 27 Nov 2023 03:14:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbjK0IOO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Nov 2023 03:14:14 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 043FA184; Mon, 27 Nov 2023 00:14:21 -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 43C592F4; Mon, 27 Nov 2023 00:15:08 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.4.90]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E7FBF3F6C4; Mon, 27 Nov 2023 00:14:18 -0800 (PST) From: Lukasz Luba <lukasz.luba@arm.com> To: linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: lukasz.luba@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, conor+dt@kernel.org, daniel.lezcano@linaro.org Subject: [PATCH] arm64: dts: rockchip: Add dynamic-power-coefficient to rk3399 GPU Date: Mon, 27 Nov 2023 08:15:11 +0000 Message-Id: <20231127081511.1911706-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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 pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 27 Nov 2023 00:14:44 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783704202969502206 X-GMAIL-MSGID: 1783704202969502206 |
Series |
arm64: dts: rockchip: Add dynamic-power-coefficient to rk3399 GPU
|
|
Commit Message
Lukasz Luba
Nov. 27, 2023, 8:15 a.m. UTC
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 <lukasz.luba@arm.com>
---
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 1 +
1 file changed, 1 insertion(+)
Comments
Hi Lukasz, Am Montag, 27. November 2023, 09:15:11 CET schrieb Lukasz Luba: > 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. 2640 is a pretty arbitary value, so it would be really helpful to describe in the commit message, how you arrived with that specific value. Thanks Heiko > Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> > --- > 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>; > power-domains = <&power RK3399_PD_GPU>; > status = "disabled"; > }; >
Hi Heiko, On 11/27/23 09:42, Heiko Stübner wrote: > Hi Lukasz, > > Am Montag, 27. November 2023, 09:15:11 CET schrieb Lukasz Luba: >> 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. > > 2640 is a pretty arbitary value, so it would be really helpful to describe > in the commit message, how you arrived with that specific value. It's in the above patch header. The power at 600MHz is ~1.5Watts, so for max freq and max voltage you get the coefficient. The DT schema describes quite well how the coefficient is calculated. IMO, there is no need to duplicate that description here [1]. Have you checked that documentation? Is there still anything unclear? I might elaborate a bit more why it's important for GPU to take the top OPP for considerations (due to thermal operating mostly on top-half OPPs, but the curve is a bit constraining). Unfortunately, this simple model doesn't allow to reflect the leakage impact over time. It doesn't also address the chip binning lottery. Although, it will be possible in near future to address those [2]. Regards, Lukasz [1] https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/gpu/arm,mali-midgard.yaml#L94 [2] https://lore.kernel.org/lkml/20230925081139.1305766-1-lukasz.luba@arm.com/
On Mon, Nov 27, 2023 at 4:14 PM Lukasz Luba <lukasz.luba@arm.com> 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 <lukasz.luba@arm.com> > --- > 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. ChenYu > power-domains = <&power RK3399_PD_GPU>; > status = "disabled"; > }; > -- > 2.25.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On 11/27/23 10:02, Chen-Yu Tsai wrote: > On Mon, Nov 27, 2023 at 4:14 PM Lukasz Luba <lukasz.luba@arm.com> 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 <lukasz.luba@arm.com> >> --- >> 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/
On 11/27/23 08:15, 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 <lukasz.luba@arm.com> > --- > arch/arm64/boot/dts/rockchip/rk3399.dtsi | 1 + > 1 file changed, 1 insertion(+) > Gentle ping. What's the status of this?
On Mon, 27 Nov 2023 08:15:11 +0000, 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. > > [...] Applied, thanks! [1/1] arm64: dts: rockchip: Add dynamic-power-coefficient to rk3399 GPU commit: 381d48fbada9b5b39f5a811bb8fe76365d6bdd5c Best regards,
On 12/7/23 20:30, Heiko Stuebner wrote: > On Mon, 27 Nov 2023 08:15:11 +0000, 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. >> >> [...] > > Applied, thanks! Thank you Heiko! > > [1/1] arm64: dts: rockchip: Add dynamic-power-coefficient to rk3399 GPU > commit: 381d48fbada9b5b39f5a811bb8fe76365d6bdd5c > > Best regards,
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>; power-domains = <&power RK3399_PD_GPU>; status = "disabled"; };