Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Chen-Yu Tsai <wenst@chromium.org>
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
Subject: Re: [PATCH] arm64: dts: rockchip: Add dynamic-power-coefficient to rk3399 GPU
Date: Mon, 27 Nov 2023 10:17:51 +0000	[thread overview]
Message-ID: <573ec775-c1f0-4a09-afe4-83793fb11f3c@arm.com> (raw)
In-Reply-To: <CAGXv+5EgDk2B_FYo9hNiLVogq+mww1j140W4hsDhywExzgpf2g@mail.gmail.com>



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/

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2023-11-27 10:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27  8:15 [PATCH] arm64: dts: rockchip: Add dynamic-power-coefficient to rk3399 GPU Lukasz Luba
2023-11-27  9:42 ` Heiko Stübner
2023-11-27 10:00   ` Lukasz Luba
2023-11-27 10:02 ` Chen-Yu Tsai
2023-11-27 10:17   ` Lukasz Luba [this message]
2023-12-07 11:07 ` Lukasz Luba
2023-12-07 20:30 ` Heiko Stuebner
2023-12-08  7:58   ` Lukasz Luba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573ec775-c1f0-4a09-afe4-83793fb11f3c@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox