Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c91d852 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

drm/msm: Add timestamp counter



In the confusion of adding the perfcounter API the timestamp query
was broken. Convert the query over to the perfcounter API to avoid
confusion.

Change-Id: Ic0dedbad590489a643e8aa6d678bf19f732c06dd
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 84200abc
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -774,6 +774,9 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
	gpu_write(gpu, REG_A5XX_TPL1_ADDR_MODE_CNTL, 0x1);
	gpu_write(gpu, REG_A5XX_RBBM_SECVID_TSB_ADDR_MODE_CNTL, 0x1);

	a5xx_gpu->timestamp_counter = adreno_get_counter(gpu,
		MSM_COUNTER_GROUP_CP, 0, NULL, NULL);

	/* Load the GPMU firmware before starting the HW init */
	a5xx_gpmu_ucode_init(gpu);

@@ -1218,8 +1221,11 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)

static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value)
{
	*value = gpu_read64(gpu, REG_A5XX_RBBM_PERFCTR_CP_0_LO,
		REG_A5XX_RBBM_PERFCTR_CP_0_HI);
	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
	struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);

	*value = adreno_read_counter(gpu, MSM_COUNTER_GROUP_CP,
		a5xx_gpu->timestamp_counter);

	return 0;
}
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ struct a5xx_gpu {
	struct a5xx_smmu_info *smmu_info;
	struct drm_gem_object *smmu_info_bo;
	uint64_t smmu_info_iova;

	int timestamp_counter;
};

#define to_a5xx_gpu(x) container_of(x, struct a5xx_gpu, base)