From: Akhil P Oommen <quic_akhilpo@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
Konrad Dybcio <konradybcio@kernel.org>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Marijn Suijten <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Bjorn Andersson <andersson@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 4/7] drm/msm: adreno: find bandwidth index of OPP and set it along freq index
Date: Sun, 1 Dec 2024 03:32:54 +0530 [thread overview]
Message-ID: <08f1c928-aed5-4012-9281-89ee27170c90@quicinc.com> (raw)
In-Reply-To: <e3bb3f66-9cad-40a4-ab55-f1d5a8e34d4d@oss.qualcomm.com>
On 11/29/2024 9:03 PM, Konrad Dybcio wrote:
> On 28.11.2024 11:25 AM, Neil Armstrong wrote:
>> The Adreno GPU Management Unit (GMU) can also scale the DDR Bandwidth
>> along the Frequency and Power Domain level, until now we left the OPP
>> core scale the OPP bandwidth via the interconnect path.
>>
>> In order to enable bandwidth voting via the GPU Management
>> Unit (GMU), when an opp is set by devfreq we also look for
>> the corresponding bandwidth index in the previously generated
>> bw_table and pass this value along the frequency index to the GMU.
>>
>> The AB pre-calculated vote is appended to the bandwidth index
>> to inform the GMU firmware the quantity of bandwidth we need.
>>
>> Since we now vote for all resources via the GMU, setting the OPP
>> is no more needed, so we can completely skip calling
>> dev_pm_opp_set_opp() in this situation.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>> drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 23 +++++++++++++++++++++--
>> drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 2 +-
>> drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 6 +++---
>> 3 files changed, 25 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>> index ee2010a01186721dd377f1655fcf05ddaff77131..c09442ecc861c4e56c81e7e775b9e57baf7d2e51 100644
>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>> @@ -110,9 +110,11 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp,
>> bool suspended)
>> {
>> struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
>> + const struct a6xx_info *info = adreno_gpu->info->a6xx;
>> struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
>> struct a6xx_gmu *gmu = &a6xx_gpu->gmu;
>> u32 perf_index;
>> + u32 bw_index = 0;
>> unsigned long gpu_freq;
>> int ret = 0;
>>
>> @@ -125,6 +127,21 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp,
>> if (gpu_freq == gmu->gpu_freqs[perf_index])
>> break;
>>
>> + /* If enabled, find the corresponding DDR bandwidth index */
>> + if (info->bcms && gmu->nr_gpu_bws > 1) {
>> + unsigned int bw = dev_pm_opp_get_bw(opp, true, 0);
>> +
>> + for (bw_index = 0; bw_index < gmu->nr_gpu_bws - 1; bw_index++) {
>> + if (bw == gmu->gpu_bw_table[bw_index])
>> + break;
>> + }
>> +
>> + if (bw_index) {
>> + bw_index |= AB_VOTE(gmu->gpu_ab_votes[bw_index]);
>> + bw_index |= AB_VOTE_ENABLE;
>> + }
>> + }
>
> If we couple frequency levels with bw levels (i.e. duplicate the highest
> bandwidth a couple times), we can drop all this search logic..
Will that alter hfi table? I prefer to avoid altering GMU data. We
should not make any assumption on how fw would use the data. And we
don't want to hit any surprises on power management related things.
Lets use the GMU interfaces exactly how it is used in downstream. No
assumptions and improvisation please!
-Akhil
>
>> +
>> gmu->current_perf_index = perf_index;
>> gmu->freq = gmu->gpu_freqs[perf_index];
>>
>> @@ -140,8 +157,10 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp,
>> return;
>>
>> if (!gmu->legacy) {
>> - a6xx_hfi_set_freq(gmu, perf_index);
>> - dev_pm_opp_set_opp(&gpu->pdev->dev, opp);
>> + a6xx_hfi_set_freq(gmu, perf_index, bw_index);
>> + /* With Bandwidth voting, we now vote for all resources, so skip OPP set */
>> + if (!bw_index)
>> + dev_pm_opp_set_opp(&gpu->pdev->dev, opp);
>
> ..and then it would come down to..
>
> if (!info->bcms)
>
> Konrad
next prev parent reply other threads:[~2024-11-30 22:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-28 10:25 [PATCH v3 0/7] drm/msm: adreno: add support for DDR bandwidth scaling via GMU Neil Armstrong
2024-11-28 10:25 ` [PATCH v3 1/7] drm/msm: adreno: add defines for gpu & gmu frequency table sizes Neil Armstrong
2024-11-28 13:24 ` Dmitry Baryshkov
2024-11-30 20:39 ` Akhil P Oommen
2024-11-28 10:25 ` [PATCH v3 2/7] drm/msm: adreno: add plumbing to generate bandwidth vote table for GMU Neil Armstrong
2024-11-29 15:21 ` Konrad Dybcio
2024-12-02 8:41 ` Neil Armstrong
2024-11-30 21:49 ` Akhil P Oommen
2024-12-02 8:46 ` Neil Armstrong
2024-12-04 15:35 ` Neil Armstrong
2024-12-04 19:15 ` Akhil P Oommen
2024-12-04 18:43 ` Akhil P Oommen
2024-11-28 10:25 ` [PATCH v3 3/7] drm/msm: adreno: dynamically generate GMU bw table Neil Armstrong
2024-11-29 16:56 ` Konrad Dybcio
2024-11-28 10:25 ` [PATCH v3 4/7] drm/msm: adreno: find bandwidth index of OPP and set it along freq index Neil Armstrong
2024-11-29 15:33 ` Konrad Dybcio
2024-11-30 22:02 ` Akhil P Oommen [this message]
2024-11-28 10:25 ` [PATCH v3 5/7] drm/msm: adreno: enable GMU bandwidth for A740 and A750 Neil Armstrong
2024-11-28 13:30 ` Dmitry Baryshkov
2024-11-29 15:25 ` Konrad Dybcio
2024-12-02 8:47 ` Neil Armstrong
2024-11-28 10:25 ` [PATCH v3 6/7] arm64: qcom: dts: sm8550: add interconnect and opp-peak-kBps for GPU Neil Armstrong
2024-11-28 13:26 ` Dmitry Baryshkov
2024-11-28 14:16 ` Neil Armstrong
2024-11-28 10:25 ` [PATCH v3 7/7] arm64: qcom: dts: sm8650: " Neil Armstrong
2024-11-28 13:26 ` Dmitry Baryshkov
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=08f1c928-aed5-4012-9281-89ee27170c90@quicinc.com \
--to=quic_akhilpo@quicinc.com \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=robh@kernel.org \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
/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
all inboxes | Powered by JetHome®