From: Robin Murphy <robin.murphy@arm.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: robh@kernel.org, tomeu.vizoso@collabora.com, airlied@linux.ie,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
steven.price@arm.com, linux-rockchip@lists.infradead.org,
wens@csie.org, yuq825@gmail.com, daniel@ffwll.ch,
linux-amlogic@lists.infradead.org,
alyssa.rosenzweig@collabora.com
Subject: Re: [RFC v2 1/1] drm/lima: Add optional devfreq support
Date: Mon, 30 Dec 2019 00:47:00 +0000 [thread overview]
Message-ID: <fe45f4f8-8c67-ded2-90bf-8d5fd6874876@arm.com> (raw)
In-Reply-To: <CAFBinCDs3a8TJcQKgHUkDvssMR6Y2Kys38p50P0q=2KOiDTNHg@mail.gmail.com>
On 2019-12-29 11:19 pm, Martin Blumenstingl wrote:
> Hi Robin,
>
> On Sun, Dec 29, 2019 at 11:58 PM Robin Murphy <robin.murphy@arm.com> wrote:
>>
>> Hi Martin,
>>
>> On 2019-12-27 5:37 pm, Martin Blumenstingl wrote:
>>> Most platforms with a Mali-400 or Mali-450 GPU also have support for
>>> changing the GPU clock frequency. Add devfreq support so the GPU clock
>>> rate is updated based on the actual GPU usage when the
>>> "operating-points-v2" property is present in the board.dts.
>>>
>>> The actual devfreq code is taken from panfrost_devfreq.c and modified so
>>> it matches what the lima hardware needs:
>>> - a call to dev_pm_opp_set_clkname() during initialization because there
>>> are two clocks on Mali-4x0 IPs. "core" is the one that actually clocks
>>> the GPU so we need to control it using devfreq.
>>> - locking when reading or writing the devfreq statistics because (unlike
>>> than panfrost) we have multiple PP and GP IRQs which may finish jobs
>>> concurrently.
>>
>> I gave this a quick try on my RK3328, and the clock scaling indeed kicks
>> in nicely on the glmark2 scenes that struggle, however something appears
>> to be missing in terms of regulator association, as the appropriate OPP
>> voltages aren't reflected in the GPU supply (fortunately the initial
>> voltage seems close enough to that of the highest OPP not to cause major
>> problems, on my box at least). With panfrost on RK3399 I do see the
>> supply voltage scaling accordingly, but I don't know my way around
>> devfreq well enough to know what matters in the difference :/
> first of all: thank you for trying this out! :-)
>
> does your kernel include commit 221bc77914cbcc ("drm/panfrost: Use
> generic code for devfreq") for your panfrost test?
> if I understand the devfreq API correct then I suspect with that
> commit panfrost also won't change the voltage anymore.
Oh, you're quite right - I was already considering that change as
ancient history, but indeed it's only in 5.5-rc, while that board is
still on 5.4.y release kernels. No wonder I couldn't make sense of how
the (current) code could possibly be working :)
I'll try the latest -rc kernel tomorrow to confirm (now that PCIe is
hopefully fixed), but I'm already fairly confident you've called it
correctly.
Cheers,
Robin.
> this is probably due to a missing call to dev_pm_opp_set_regulators()
> which is supposed to attach the regulator to the devfreq instance.
> I didn't notice this yet because on Amlogic SoCs the voltage is the
> same for all OPPs.
>
> I'll debug this in the next days and send an updated patch (and drop
> the RFC prefix if there are no more comments).
>
>
> Regards
> Martin
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2019-12-30 0:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-27 17:37 [RFC v2 0/1] drm: lima: devfreq and cooling device support Martin Blumenstingl
2019-12-27 17:37 ` [RFC v2 1/1] drm/lima: Add optional devfreq support Martin Blumenstingl
2019-12-29 22:58 ` Robin Murphy
2019-12-29 23:19 ` Martin Blumenstingl
2019-12-30 0:47 ` Robin Murphy [this message]
2019-12-31 14:17 ` Martin Blumenstingl
2019-12-31 16:39 ` Robin Murphy
2019-12-31 16:47 ` Martin Blumenstingl
2020-01-01 12:55 ` Robin Murphy
2020-01-02 21:56 ` Martin Blumenstingl
2019-12-31 2:54 ` Qiang Yu
2019-12-31 14:19 ` Martin Blumenstingl
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=fe45f4f8-8c67-ded2-90bf-8d5fd6874876@arm.com \
--to=robin.murphy@arm.com \
--cc=airlied@linux.ie \
--cc=alyssa.rosenzweig@collabora.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=robh@kernel.org \
--cc=steven.price@arm.com \
--cc=tomeu.vizoso@collabora.com \
--cc=wens@csie.org \
--cc=yuq825@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).