Skip to content

Commit f30a648

Browse files
committed
drm/msm/adreno: Allow SoC specific gpu device table entries
There are cases where there are differences due to SoC integration. Such as cache-coherency support, and (in the next patch) e-fuse to speedbin mappings. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/549767/
1 parent 155668e commit f30a648

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

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

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,32 @@ static const struct adreno_info gpulist[] = {
258258
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
259259
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT,
260260
.init = a6xx_gpu_init,
261+
}, {
262+
.machine = "qcom,sm4350",
263+
.rev = ADRENO_REV(6, 1, 9, ANY_ID),
264+
.revn = 619,
265+
.fw = {
266+
[ADRENO_FW_SQE] = "a630_sqe.fw",
267+
[ADRENO_FW_GMU] = "a619_gmu.bin",
268+
},
269+
.gmem = SZ_512K,
270+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
271+
.init = a6xx_gpu_init,
272+
.zapfw = "a615_zap.mdt",
273+
.hwcg = a615_hwcg,
274+
}, {
275+
.machine = "qcom,sm6375",
276+
.rev = ADRENO_REV(6, 1, 9, ANY_ID),
277+
.revn = 619,
278+
.fw = {
279+
[ADRENO_FW_SQE] = "a630_sqe.fw",
280+
[ADRENO_FW_GMU] = "a619_gmu.bin",
281+
},
282+
.gmem = SZ_512K,
283+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
284+
.init = a6xx_gpu_init,
285+
.zapfw = "a615_zap.mdt",
286+
.hwcg = a615_hwcg,
261287
}, {
262288
.rev = ADRENO_REV(6, 1, 9, ANY_ID),
263289
.revn = 619,
@@ -409,6 +435,8 @@ const struct adreno_info *adreno_info(struct adreno_rev rev)
409435
/* identify gpu: */
410436
for (i = 0; i < ARRAY_SIZE(gpulist); i++) {
411437
const struct adreno_info *info = &gpulist[i];
438+
if (info->machine && !of_machine_is_compatible(info->machine))
439+
continue;
412440
if (adreno_cmp_rev(info->rev, rev))
413441
return info;
414442
}
@@ -563,6 +591,8 @@ static int adreno_bind(struct device *dev, struct device *master, void *data)
563591
config.rev.minor, config.rev.patchid);
564592

565593
priv->is_a2xx = config.rev.core == 2;
594+
priv->has_cached_coherent =
595+
!!(info->quirks & ADRENO_QUIRK_HAS_CACHED_COHERENT);
566596

567597
gpu = info->init(drm);
568598
if (IS_ERR(gpu)) {
@@ -574,10 +604,6 @@ static int adreno_bind(struct device *dev, struct device *master, void *data)
574604
if (ret)
575605
return ret;
576606

577-
priv->has_cached_coherent =
578-
!!(info->quirks & ADRENO_QUIRK_HAS_CACHED_COHERENT) &&
579-
!adreno_has_gmu_wrapper(to_adreno_gpu(gpu));
580-
581607
return 0;
582608
}
583609

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ extern const struct adreno_reglist a612_hwcg[], a615_hwcg[], a630_hwcg[], a640_h
6161
extern const struct adreno_reglist a660_hwcg[], a690_hwcg[];
6262

6363
struct adreno_info {
64+
const char *machine;
6465
struct adreno_rev rev;
6566
uint32_t revn;
6667
const char *fw[ADRENO_FW_MAX];

0 commit comments

Comments
 (0)