drm/msm/adreno: Update GPU name format
Subsystems (4)
Rob Clark
maintainercover drm/msm/adreno: Update GPU name format
The "ipv4 style" of formatting the chip_id is less useful after a740 with the new chip_id format. Rather than doing dec->hex conversion in my head, just switch to using %08x, which is still easy enough to read for the old scheme.
Also, for a8xx update the name after patching in the slice-count.
This series only changes things for kernel dmesg.
Rob Clark (2):
drm/msm/adreno: Change chip_id format
drm/msm/a8xx: Update GPU name with slice_mask
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 10 ++++++++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 8 ++------ 2 files changed, 12 insertions(+), 6 deletions(-)
Signature · 1 line
2.53.0
Rob Clark
maintainerPATCH 1/2 drm/msm/adreno: Change chip_id format
The "ipv4-style" %u.%u.%u.%u used to make sense when the chip_id was simply encoding gen.major.minor.patch. But this hasn't been true for at least a couple years.
Switch to %08x, which is still easy enough to read for older devices, and much easier to read with the new scheme.
--- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/adreno/adreno_gpu.h +2 -6
@@ -67,12 +67,8 @@ enum adreno_family {/* Helper for formating the chip_id in the way that userspace tools like * crashdec expect. */ -#define ADRENO_CHIPID_FMT "u.%u.%u.%u" -#define ADRENO_CHIPID_ARGS (_c) \ - (((_c) >> 24) & 0xff), \ - (((_c) >> 16) & 0xff), \ - (((_c) >> 8) & 0xff), \ - ((_c) & 0xff) +#define ADRENO_CHIPID_FMT "08x" +#define ADRENO_CHIPID_ARGS (_c) (_c)struct adreno_gpu ;
Signature · 1 line
2.53.0
Re: [PATCH 1/2] drm/msm/adreno: Change chip_id format
Quoted 4 lines · Rob Clark
The "ipv4-style" %u.%u.%u.%u used to make sense when the
chip_idwas simply encoding gen.major.minor.patch. But this hasn't been true for at least a couple years.
Quoted 8 lines
Switch to %08x, which is still easy enough to read for older devices, and much easier to read with the new scheme.
Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Rob Clark
maintainerPATCH 2/2 drm/msm/a8xx: Update GPU name with slice_mask
In reply to Rob ClarkOnce we've updated the chip_id after reading the slice_mask, also update the GPU name so it matches.
--- drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/msm/adreno/a8xx_gpu.c +10 -0
@@ -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)
Signature · 1 line
2.53.0
Re: [PATCH 2/2] drm/msm/a8xx: Update GPU name with slice_mask
Quoted 8 lines · Rob Clark
Once we've updated the
chip_idafter reading theslice_mask, also update the GPU name so it matches.Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
Quoted 1 line
Signature · 2 lines
With best wishes Dmitry
Quoted 9 lines · Rob Clark
The "ipv4 style" of formatting the
chip_idis less useful after a740 with the newchip_idformat. Rather than doingdec->hexconversion in my head, just switch to using %08x, which is still easy enough to read for the old scheme.Also, for a8xx update the name after patching in the slice-count.
This series only changes things for kernel dmesg.
Quoted 8 lines
Rob Clark (2):
drm/msm/adreno: Changechip_idformat
drm/msm/a8xx: Update GPU name withslice_maskdrivers/gpu/drm/msm/adreno/a8xx_gpu.c | 10 ++++++++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 8 ++------ 2 files changed, 12 insertions(+), 6 deletions(-)
-Akhil.