Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	linux-arm-msm@vger.kernel.org, Rob Clark <robdclark@chromium.org>,
	freedreno@lists.freedesktop.org
Subject: Re: [Freedreno] [PATCH 07/12] drm/msm/adreno: Move speedbin mapping to device table
Date: Mon, 10 Jul 2023 23:54:02 +0300	[thread overview]
Message-ID: <d3f5cf11-e481-2c50-b712-f8832265e897@linaro.org> (raw)
In-Reply-To: <CAF6AEGv2K9Ar8=96H2_=BJc=hqFNnh2M5fvbG5p5gjoAEfR=-A@mail.gmail.com>

On 10/07/2023 22:56, Rob Clark wrote:
> On Thu, Jul 6, 2023 at 7:54 PM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
>>
>> On 07/07/2023 00:10, Rob Clark wrote:
>>> From: Rob Clark <robdclark@chromium.org>
>>>
>>> This simplifies the code.
>>>
>>> Signed-off-by: Rob Clark <robdclark@chromium.org>
>>> ---
>>>    drivers/gpu/drm/msm/adreno/a6xx_gpu.c      | 171 ++-------------------
>>>    drivers/gpu/drm/msm/adreno/adreno_device.c |  51 ++++++
>>>    drivers/gpu/drm/msm/adreno/adreno_gpu.h    |  25 +++
>>>    3 files changed, 92 insertions(+), 155 deletions(-)
>>
>>
>> Interesting hack, I'd say.
>>
>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>
>> Minor nit below.
>>
>>>
>>
>>> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
>>> index d5335b99c64c..994ac26ce731 100644
>>> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
>>> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
>>> @@ -72,8 +72,33 @@ struct adreno_info {
>>>        u32 inactive_period;
>>>        const struct adreno_reglist *hwcg;
>>>        u64 address_space_size;
>>> +     /**
>>> +      * @speedbins: Optional table of fuse to speedbin mappings
>>> +      *
>>> +      * Consists of pairs of fuse, index mappings, terminated with
>>> +      * UINT_MAX sentinal.
>>> +      */
>>> +     uint32_t *speedbins;
>>
>> Would it be better to explicitly list this as pairs of uint32_t? And
>> then use braces in ADRENO_SPEEDBIN initialisation.
> 
> It would mean the sentinel would take 8 bytes instead of 4.. maybe
> that is over-thinking it, but it was the reason I just stuck with a
> flat table

Guessed so. But we are wasting so much memory already... I think that 
the paired structure would better reflect the data - it's not a flat 
list, but a list of nvmem <-> speedbin pairs.

> 
> BR,
> -R
> 
>>>    };
>>>
>>> +/*
>>> + * Helper to build a speedbin table, ie. the table:
>>> + *      fuse | speedbin
>>> + *      -----+---------
>>> + *        0  |   0
>>> + *       169 |   1
>>> + *       174 |   2
>>> + *
>>> + * would be declared as:
>>> + *
>>> + *     .speedbins = ADRENO_SPEEDBINS(
>>> + *                      0,   0,
>>> + *                      169, 1,
>>> + *                      174, 2
>>> + *                  ),
>>> + */
>>> +#define ADRENO_SPEEDBINS(tbl...) (uint32_t[]) { tbl, UINT_MAX }
>>> +
>>>    const struct adreno_info *adreno_info(struct adreno_rev rev);
>>>
>>>    struct adreno_gpu {
>>
>> --
>> With best wishes
>> Dmitry
>>

-- 
With best wishes
Dmitry


  reply	other threads:[~2023-07-10 20:54 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 21:10 [PATCH 00/12] drm/msm/adreno: Move away from legacy revision matching Rob Clark
2023-07-06 21:10 ` [PATCH 01/12] drm/msm/adreno: Remove GPU name Rob Clark
2023-07-06 23:21   ` Konrad Dybcio
2023-07-07  0:04   ` [Freedreno] " Dmitry Baryshkov
2023-07-06 21:10 ` [PATCH 02/12] drm/msm/adreno: Remove redundant gmem size param Rob Clark
2023-07-06 23:22   ` Konrad Dybcio
2023-07-13 19:46     ` Akhil P Oommen
2023-07-07  2:23   ` [Freedreno] " Dmitry Baryshkov
2023-07-06 21:10 ` [PATCH 03/12] drm/msm/adreno: Remove redundant revn param Rob Clark
2023-07-06 23:26   ` Konrad Dybcio
2023-07-07  2:24   ` [Freedreno] " Dmitry Baryshkov
2023-07-06 21:10 ` [PATCH 04/12] drm/msm/adreno: Use quirk identify hw_apriv Rob Clark
2023-07-06 23:27   ` Konrad Dybcio
2023-07-07  2:25   ` [Freedreno] " Dmitry Baryshkov
2023-07-06 21:10 ` [PATCH 05/12] drm/msm/adreno: Use quirk to identify cached-coherent support Rob Clark
2023-07-06 23:29   ` Konrad Dybcio
2023-07-07  2:29   ` [Freedreno] " Dmitry Baryshkov
2023-07-07 15:53     ` Rob Clark
2023-07-13 20:05   ` Akhil P Oommen
2023-07-13 22:25     ` Rob Clark
2023-07-17 22:00       ` Akhil P Oommen
2023-07-06 21:10 ` [PATCH 06/12] drm/msm/adreno: Allow SoC specific gpu device table entries Rob Clark
2023-07-07  0:40   ` Konrad Dybcio
2023-07-13 22:15     ` [Freedreno] " Akhil P Oommen
2023-07-07  2:34   ` Dmitry Baryshkov
2023-07-13 20:26     ` Akhil P Oommen
2023-07-26 18:28       ` Rob Clark
2023-07-26 20:00         ` Dmitry Baryshkov
2023-07-26 20:11           ` Rob Clark
2023-07-26 21:43             ` Dmitry Baryshkov
2023-07-26 22:03               ` Rob Clark
2023-07-26 22:33                 ` Dmitry Baryshkov
2023-07-26 22:53                   ` Rob Clark
2023-07-27  7:51                     ` Konrad Dybcio
2023-07-27 14:52                       ` Rob Clark
2023-07-27 21:13                   ` Rob Clark
2023-07-27 22:02                     ` Dmitry Baryshkov
2023-07-28 14:43                       ` Rob Clark
2023-07-28 14:51                         ` Dmitry Baryshkov
2023-07-06 21:10 ` [PATCH 07/12] drm/msm/adreno: Move speedbin mapping to device table Rob Clark
2023-07-07  2:54   ` [Freedreno] " Dmitry Baryshkov
2023-07-10 19:56     ` Rob Clark
2023-07-10 20:54       ` Dmitry Baryshkov [this message]
2023-07-06 21:10 ` [PATCH 08/12] drm/msm/adreno: Bring the a630 family together Rob Clark
2023-07-06 23:32   ` Konrad Dybcio
2023-07-06 21:10 ` [PATCH 09/12] drm/msm/adreno: Add adreno family Rob Clark
2023-07-06 23:35   ` Konrad Dybcio
2023-07-07  3:16     ` Dmitry Baryshkov
2023-07-07 23:52       ` Rob Clark
2023-07-07 23:54         ` Dmitry Baryshkov
2023-07-07  2:49   ` [Freedreno] " Dmitry Baryshkov
2023-07-06 21:10 ` [PATCH 10/12] drm/msm/adreno: Add helper for formating chip-id Rob Clark
2023-07-06 23:36   ` Konrad Dybcio
2023-07-10 20:21     ` Rob Clark
2023-07-07  2:50   ` [Freedreno] " Dmitry Baryshkov
2023-07-06 21:10 ` [PATCH 11/12] dt-bindings: drm/msm/gpu: Extend bindings for chip-id Rob Clark
2023-07-07  7:26   ` Krzysztof Kozlowski
2023-07-07 13:09     ` Rob Clark
2023-07-06 21:10 ` [PATCH 12/12] drm/msm/adreno: Switch to chip-id for identifying GPU Rob Clark
2023-07-07  0:25   ` Konrad Dybcio
2023-07-07 16:08     ` Rob Clark
2023-07-15 13:38       ` Konrad Dybcio
2023-07-15 14:12         ` Rob Clark
2023-07-26 21:45         ` Rob Clark
2023-07-07  3:45   ` [Freedreno] " Dmitry Baryshkov
2023-07-13 21:39     ` Akhil P Oommen
2023-07-13 22:06       ` Rob Clark
2023-07-13 22:53         ` Dmitry Baryshkov
2023-07-17 22:09         ` Akhil P Oommen
2023-07-26 21:37     ` Rob Clark
2023-07-26 21:38       ` Dmitry Baryshkov
2023-07-26 21:44         ` Rob Clark
2023-07-26 21:45           ` 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=d3f5cf11-e481-2c50-b712-f8832265e897@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@chromium.org \
    --cc=robdclark@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