Skip to content

Commit 155668e

Browse files
committed
drm/msm/adreno: Use quirk to identify cached-coherent support
It is better to explicitly list it. With the move to opaque chip-id's for future devices, we should avoid trying to infer things like generation from the numerical value. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/549765/
1 parent 459f9e2 commit 155668e

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ static const struct adreno_info gpulist[] = {
256256
},
257257
.gmem = SZ_512K,
258258
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
259+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT,
259260
.init = a6xx_gpu_init,
260261
}, {
261262
.rev = ADRENO_REV(6, 1, 9, ANY_ID),
@@ -266,6 +267,7 @@ static const struct adreno_info gpulist[] = {
266267
},
267268
.gmem = SZ_512K,
268269
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
270+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT,
269271
.init = a6xx_gpu_init,
270272
.zapfw = "a615_zap.mdt",
271273
.hwcg = a615_hwcg,
@@ -278,6 +280,7 @@ static const struct adreno_info gpulist[] = {
278280
},
279281
.gmem = SZ_1M,
280282
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
283+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT,
281284
.init = a6xx_gpu_init,
282285
.zapfw = "a630_zap.mdt",
283286
.hwcg = a630_hwcg,
@@ -290,6 +293,7 @@ static const struct adreno_info gpulist[] = {
290293
},
291294
.gmem = SZ_1M,
292295
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
296+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT,
293297
.init = a6xx_gpu_init,
294298
.zapfw = "a640_zap.mdt",
295299
.hwcg = a640_hwcg,
@@ -302,7 +306,8 @@ static const struct adreno_info gpulist[] = {
302306
},
303307
.gmem = SZ_1M + SZ_128K,
304308
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
305-
.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
309+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
310+
ADRENO_QUIRK_HAS_HW_APRIV,
306311
.init = a6xx_gpu_init,
307312
.zapfw = "a650_zap.mdt",
308313
.hwcg = a650_hwcg,
@@ -316,7 +321,8 @@ static const struct adreno_info gpulist[] = {
316321
},
317322
.gmem = SZ_1M + SZ_512K,
318323
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
319-
.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
324+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
325+
ADRENO_QUIRK_HAS_HW_APRIV,
320326
.init = a6xx_gpu_init,
321327
.zapfw = "a660_zap.mdt",
322328
.hwcg = a660_hwcg,
@@ -329,7 +335,8 @@ static const struct adreno_info gpulist[] = {
329335
},
330336
.gmem = SZ_512K,
331337
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
332-
.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
338+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
339+
ADRENO_QUIRK_HAS_HW_APRIV,
333340
.init = a6xx_gpu_init,
334341
.hwcg = a660_hwcg,
335342
.address_space_size = SZ_16G,
@@ -342,6 +349,7 @@ static const struct adreno_info gpulist[] = {
342349
},
343350
.gmem = SZ_2M,
344351
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
352+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT,
345353
.init = a6xx_gpu_init,
346354
.zapfw = "a640_zap.mdt",
347355
.hwcg = a640_hwcg,
@@ -353,7 +361,8 @@ static const struct adreno_info gpulist[] = {
353361
},
354362
.gmem = SZ_4M,
355363
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
356-
.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
364+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
365+
ADRENO_QUIRK_HAS_HW_APRIV,
357366
.init = a6xx_gpu_init,
358367
.zapfw = "a690_zap.mdt",
359368
.hwcg = a690_hwcg,
@@ -565,9 +574,9 @@ static int adreno_bind(struct device *dev, struct device *master, void *data)
565574
if (ret)
566575
return ret;
567576

568-
if (config.rev.core >= 6)
569-
if (!adreno_has_gmu_wrapper(to_adreno_gpu(gpu)))
570-
priv->has_cached_coherent = true;
577+
priv->has_cached_coherent =
578+
!!(info->quirks & ADRENO_QUIRK_HAS_CACHED_COHERENT) &&
579+
!adreno_has_gmu_wrapper(to_adreno_gpu(gpu));
571580

572581
return 0;
573582
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ enum {
3333
#define ADRENO_QUIRK_FAULT_DETECT_MASK BIT(1)
3434
#define ADRENO_QUIRK_LMLOADKILL_DISABLE BIT(2)
3535
#define ADRENO_QUIRK_HAS_HW_APRIV BIT(3)
36+
#define ADRENO_QUIRK_HAS_CACHED_COHERENT BIT(4)
3637

3738
struct adreno_rev {
3839
uint8_t core;

0 commit comments

Comments
 (0)