.progress = a8xx_progress,
.sysprof_setup = a6xx_gmu_sysprof_setup,
.perfcntr_configure = a6xx_perfcntr_configure,
+ .perfcntr_flush = a8xx_perfcntr_flush,
},
.init = a6xx_gpu_init,
.get_timestamp = a8xx_gmu_get_timestamp,
void a8xx_preempt_trigger(struct msm_gpu *gpu);
void a8xx_preempt_irq(struct msm_gpu *gpu);
bool a8xx_progress(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
+void a8xx_perfcntr_flush(struct msm_gpu *gpu);
void a8xx_recover(struct msm_gpu *gpu);
#endif /* __A6XX_GPU_H__ */
{
return true;
}
+
+void a8xx_perfcntr_flush(struct msm_gpu *gpu)
+{
+ u32 val;
+
+ /*
+ * Flush delta counters (both perf counters and pipe stats) present in
+ * RBBM_S and RBBM_US to perf RAM logic to get the latest data.
+ */
+ gpu_write(gpu, REG_A8XX_RBBM_PERFCTR_FLUSH_HOST_CMD, BIT(0));
+ gpu_write(gpu, REG_A8XX_RBBM_SLICE_PERFCTR_FLUSH_HOST_CMD, BIT(0));
+
+ /* Ensure all writes are posted before polling status register */
+ wmb();
+
+ if (gpu_poll_timeout(gpu, REG_A8XX_RBBM_PERFCTR_FLUSH_HOST_STATUS, val,
+ val & BIT(0), 100, 100 * 1000)) {
+ dev_err(&gpu->pdev->dev, "Perfcounter flush timed out: status=0x%08x\n", val);
+ }
+}