OSDN Git Service

drm/msm/adreno: a5xx: Explicitly program the CP0 performance counter
authorJordan Crouse <jcrouse@codeaurora.org>
Tue, 21 Nov 2017 19:40:57 +0000 (12:40 -0700)
committerRob Clark <robdclark@gmail.com>
Wed, 10 Jan 2018 13:58:42 +0000 (08:58 -0500)
Even though the default countable for CP0 is CP_ALWAYS_COUNT (0),
program the selector during HW initialization in an effort to be
up front about which counters are programmed and why.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/a5xx_gpu.c

index fdbe9e9..56c2c44 100644 (file)
@@ -597,6 +597,9 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
        /* Turn on performance counters */
        gpu_write(gpu, REG_A5XX_RBBM_PERFCTR_CNTL, 0x01);
 
+       /* Select CP0 to always count cycles */
+       gpu_write(gpu, REG_A5XX_CP_PERFCTR_CP_SEL_0, PERF_CP_ALWAYS_COUNT);
+
        /* Increase VFD cache access so LRZ and other data gets evicted less */
        gpu_write(gpu, REG_A5XX_UCHE_CACHE_WAYS, 0x02);