]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/msm/a8xx: Update GPU name with slice_mask
authorRob Clark <robin.clark@oss.qualcomm.com>
Mon, 16 Mar 2026 18:34:34 +0000 (11:34 -0700)
committerRob Clark <robin.clark@oss.qualcomm.com>
Tue, 31 Mar 2026 20:47:27 +0000 (13:47 -0700)
Once we've updated the chip_id after reading the slice_mask, also update
the GPU name so it matches.

Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/712225/
Message-ID: <20260316183436.671482-3-robin.clark@oss.qualcomm.com>

drivers/gpu/drm/msm/adreno/a8xx_gpu.c

index b1887e0cf6983e1e142be5e78bd234dd23f570f3..dd5e068687060ec6f0f793663283826be29bcd8c 100644 (file)
@@ -87,6 +87,7 @@ void a8xx_gpu_get_slice_info(struct msm_gpu *gpu)
        struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
        struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
        const struct a6xx_info *info = adreno_gpu->info->a6xx;
+       struct device *dev = &gpu->pdev->dev;
        u32 slice_mask;
 
        if (adreno_gpu->info->family < ADRENO_8XX_GEN1)
@@ -110,6 +111,15 @@ void a8xx_gpu_get_slice_info(struct msm_gpu *gpu)
 
        /* Chip ID depends on the number of slices available. So update it */
        adreno_gpu->chip_id |= FIELD_PREP(GENMASK(7, 4), hweight32(slice_mask));
+
+       /* Update the gpu-name to reflect the slice config: */
+       const char *name = devm_kasprintf(dev, GFP_KERNEL,
+                       "%"ADRENO_CHIPID_FMT,
+                       ADRENO_CHIPID_ARGS(adreno_gpu->chip_id));
+       if (name) {
+               devm_kfree(dev, adreno_gpu->base.name);
+               adreno_gpu->base.name = name;
+       }
 }
 
 static u32 a8xx_get_first_slice(struct a6xx_gpu *a6xx_gpu)