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

Commit eeec2726 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

drm/msm: Add save/restore functions for perfcounters



Add functions to save and restore the value of some of the
performance counters during a power cycle.

Change-Id: Ic0dedbad4037d6a2262792b752dc5d33a2d0eb36
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent a2d757fc
Loading
Loading
Loading
Loading
+271 −135

File changed.

Preview size limit exceeded, changes collapsed.

+7 −0
Original line number Diff line number Diff line
@@ -1174,6 +1174,10 @@ static int a5xx_pm_resume(struct msm_gpu *gpu)
	if (ret)
		return ret;


	/* Restore all the counters before turning on the GPMU */
	a5xx_counters_restore(gpu);

	/* Turn the RBCCU domain first to limit the chances of voltage droop */
	gpu_write(gpu, REG_A5XX_GPMU_RBCCU_POWER_CNTL, 0x778000);

@@ -1211,6 +1215,9 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)

	gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, 0);

	/* Save the counters before going down */
	a5xx_counters_save(gpu);

	/*
	 * Reset the VBIF before power collapse to avoid issue with FIFO
	 * entries
+2 −0
Original line number Diff line number Diff line
@@ -194,5 +194,7 @@ static inline bool a5xx_in_preempt(struct a5xx_gpu *a5xx_gpu)
}

int a5xx_counters_init(struct adreno_gpu *adreno_gpu);
void a5xx_counters_save(struct msm_gpu *gpu);
void a5xx_counters_restore(struct msm_gpu *gpu);

#endif /* __A5XX_GPU_H__ */
+7 −1
Original line number Diff line number Diff line
@@ -87,8 +87,10 @@ struct adreno_counter {
	u32 lo;
	u32 hi;
	u32 sel;
	int load_bit;
	u32 countable;
	u32 refcount;
	u64 value;
};

struct adreno_counter_group {
@@ -99,11 +101,15 @@ struct adreno_counter_group {
		int (*get)(struct msm_gpu *,
			struct adreno_counter_group *, u32, u32 *, u32 *);
		void (*enable)(struct msm_gpu *,
			struct adreno_counter_group *, int);
			struct adreno_counter_group *, int, bool);
		u64 (*read)(struct msm_gpu *,
			struct adreno_counter_group *, int);
		void (*put)(struct msm_gpu *,
			struct adreno_counter_group *, int);
		void (*save)(struct msm_gpu *,
			struct adreno_counter_group *);
		void (*restore)(struct msm_gpu *,
			struct adreno_counter_group *);
	} funcs;
};