*/
void kbase_pm_release_l2_caches(struct kbase_device *kbdev);
+/** Queue mali_dvfs_work which performs GPU voltage/frequency scaling in mali_dvfs_event_proc
+ *
+ * @param kbdev The kbase device structure for the device (must be a valid pointer)
+ *
+ * @return MALI_TRUE on success (currently no error handling present)
+ */
+int kbase_platform_dvfs_event(struct kbase_device *kbdev);
+
+/** Get the GPU utilisation. Used to determine if the frequency/voltage needs to be scaled.
+ *
+ * @param kbdev The kbase device structure for the device (must be a valid pointer)
+ *
+ * @return The current GPU utilisation
+ */
+int kbase_pm_get_dvfs_utilisation(struct kbase_device *kbdev);
+
#endif /* _KBASE_PM_H_ */
OSK_ASSERT(data != NULL);
kbdev = (kbase_device*)data;
- action = kbase_pm_get_dvfs_action(kbdev);
-
- switch(action) {
- case KBASE_PM_DVFS_NOP:
- break;
- case KBASE_PM_DVFS_CLOCK_UP:
- /* Do whatever is required to increase the clock frequency */
- break;
- case KBASE_PM_DVFS_CLOCK_DOWN:
- /* Do whatever is required to decrease the clock frequency */
- break;
- }
+ kbase_platform_dvfs_event(kbdev);
osk_spinlock_irq_lock(&kbdev->pm.metrics.lock);
if (kbdev->pm.metrics.timer_active)
#ifdef CONFIG_T6XX_DVFS
int kbase_platform_dvfs_init(kbase_device *kbdev);
void kbase_platform_dvfs_term(void);
-int kbase_platform_dvfs_event(kbase_device *kbdev, u32 utilisation);
int kbase_platform_dvfs_get_control_status(void);
-int kbase_pm_get_dvfs_utilisation(kbase_device *kbdev);
#ifdef CONFIG_T6XX_DVFS_FREQ_LOCK
static int mali_get_dvfs_upper_locked_freq(void);
static int mali_get_dvfs_under_locked_freq(void);
static DECLARE_WORK(mali_dvfs_work, mali_dvfs_event_proc);
-int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation)
+int kbase_platform_dvfs_event(struct kbase_device *kbdev)
{
+#ifdef CONFIG_T6XX_DVFS
+ int utilisation = kbase_pm_get_dvfs_utilisation(kbdev);
+
trace_mali_dvfs_event(utilisation);
osk_spinlock_lock(&mali_dvfs_spinlock);
/*add error handle here*/
return MALI_TRUE;
+#else
+ return MALI_FALSE;
+#endif
}
int kbase_platform_dvfs_get_control_status(void)
* instead of:
* action = kbase_pm_get_dvfs_action(kbdev);
* use this:
- * kbase_platform_dvfs_event(kbdev, kbase_pm_get_dvfs_utilisation(kbdev));
+ * kbase_platform_dvfs_event(kbdev);
*/
#ifdef CONFIG_T6XX_DVFS