Skip to content

Commit e2f7619

Browse files
Akhil P Oommenrobclark
authored andcommitted
drm/msm/adreno: Generate name from chipid for 7c3
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@quicinc.com> Link: https://lore.kernel.org/r/20220226005021.v2.2.I9436e0e300f76b2e6c34136a0b902e8cfd73e0d6@changeid Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 0737ab9 commit e2f7619

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ static const struct adreno_info gpulist[] = {
318318
.hwcg = a660_hwcg,
319319
}, {
320320
.rev = ADRENO_REV(6, 3, 5, ANY_ID),
321-
.name = "Adreno 7c Gen 3",
322321
.fw = {
323322
[ADRENO_FW_SQE] = "a660_sqe.fw",
324323
[ADRENO_FW_GMU] = "a660_gmu.bin",

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,12 +930,23 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
930930
struct adreno_platform_config *config = dev->platform_data;
931931
struct msm_gpu_config adreno_gpu_config = { 0 };
932932
struct msm_gpu *gpu = &adreno_gpu->base;
933+
struct adreno_rev *rev = &config->rev;
934+
const char *gpu_name;
933935

934936
adreno_gpu->funcs = funcs;
935937
adreno_gpu->info = adreno_info(config->rev);
936938
adreno_gpu->gmem = adreno_gpu->info->gmem;
937939
adreno_gpu->revn = adreno_gpu->info->revn;
938-
adreno_gpu->rev = config->rev;
940+
adreno_gpu->rev = *rev;
941+
942+
gpu_name = adreno_gpu->info->name;
943+
if (!gpu_name) {
944+
gpu_name = devm_kasprintf(dev, GFP_KERNEL, "%d.%d.%d.%d",
945+
rev->core, rev->major, rev->minor,
946+
rev->patchid);
947+
if (!gpu_name)
948+
return -ENOMEM;
949+
}
939950

940951
adreno_gpu_config.ioname = "kgsl_3d0_reg_memory";
941952

@@ -949,7 +960,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
949960
pm_runtime_enable(dev);
950961

951962
return msm_gpu_init(drm, pdev, &adreno_gpu->base, &funcs->base,
952-
adreno_gpu->info->name, &adreno_gpu_config);
963+
gpu_name, &adreno_gpu_config);
953964
}
954965

955966
void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu)

0 commit comments

Comments
 (0)