lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d70cf11a-1a23-e240-3565-9966a6f4bfaa@quicinc.com>
Date:   Thu, 24 Feb 2022 01:38:33 +0530
From:   Akhil P Oommen <quic_akhilpo@...cinc.com>
To:     Rob Clark <robdclark@...il.com>
CC:     freedreno <freedreno@...ts.freedesktop.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        "OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Abhinav Kumar <quic_abhinavk@...cinc.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Christian König <christian.koenig@....com>,
        Daniel Vetter <daniel@...ll.ch>,
        David Airlie <airlied@...ux.ie>,
        Jonathan Marek <jonathan@...ek.ca>,
        Jordan Crouse <jordan@...micpenguin.net>,
        Sean Paul <sean@...rly.run>,
        Stephen Boyd <swboyd@...omium.org>,
        Vladimir Lypak <vladimir.lypak@...il.com>,
        Yangtao Li <tiny.windzz@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] drm/msm/adreno: Generate name from chipid for 7c3

On 2/23/2022 6:28 AM, Rob Clark wrote:
> On Mon, Feb 21, 2022 at 6:41 AM Akhil P Oommen <quic_akhilpo@...cinc.com> wrote:
>> Use a gpu name which is sprintf'ed from the chipid for 7c3 gpu instead of
>> hardcoding one. This helps to avoid code churn in case of a gpu rename.
>>
>> Signed-off-by: Akhil P Oommen <quic_akhilpo@...cinc.com>
>> ---
>>
>>   drivers/gpu/drm/msm/adreno/adreno_device.c |  1 -
>>   drivers/gpu/drm/msm/adreno/adreno_gpu.c    | 14 ++++++++++++--
>>   2 files changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
>> index fb26193..89cfd84 100644
>> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
>> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
>> @@ -318,7 +318,6 @@ static const struct adreno_info gpulist[] = {
>>                  .hwcg = a660_hwcg,
>>          }, {
>>                  .rev = ADRENO_REV(6, 3, 5, ANY_ID),
>> -               .name = "Adreno 7c Gen 3",
>>                  .fw = {
>>                          [ADRENO_FW_SQE] = "a660_sqe.fw",
>>                          [ADRENO_FW_GMU] = "a660_gmu.bin",
>> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> index f33cfa4..158bbf7 100644
>> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> @@ -929,12 +929,22 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>>          struct adreno_platform_config *config = dev->platform_data;
>>          struct msm_gpu_config adreno_gpu_config  = { 0 };
>>          struct msm_gpu *gpu = &adreno_gpu->base;
>> +       struct adreno_rev *rev = &config->rev;
>> +       const char *gpu_name;
>> +       static char name[8];
> I think 8 is not always enough.. but maybe just use devm_kasprintf()
> to keep it simpler?
>
> BR,
> -R
Sounds good. Will update this patch.

-Akhil.
>>          adreno_gpu->funcs = funcs;
>>          adreno_gpu->info = adreno_info(config->rev);
>>          adreno_gpu->gmem = adreno_gpu->info->gmem;
>>          adreno_gpu->revn = adreno_gpu->info->revn;
>> -       adreno_gpu->rev = config->rev;
>> +       adreno_gpu->rev = *rev;
>> +
>> +       gpu_name = adreno_gpu->info->name;
>> +       if (!gpu_name) {
>> +               sprintf(name, "%d.%d.%d.%d", rev->core, rev->major, rev->minor,
>> +                               rev->patchid);
>> +               gpu_name = name;
>> +       }
>>
>>          adreno_gpu_config.ioname = "kgsl_3d0_reg_memory";
>>
>> @@ -948,7 +958,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>>          pm_runtime_enable(dev);
>>
>>          return msm_gpu_init(drm, pdev, &adreno_gpu->base, &funcs->base,
>> -                       adreno_gpu->info->name, &adreno_gpu_config);
>> +                       gpu_name, &adreno_gpu_config);
>>   }
>>
>>   void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu)
>> --
>> 2.7.4
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ