#include <linux/delay.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/driver.h>
+#include <linux/rk_fb.h>
+
#include <platform/rk/mali_kbase_platform.h>
#include <platform/rk/mali_kbase_dvfs.h>
#include <mali_kbase_gator.h>
#endif
/*dvfs status*/
static mali_dvfs_status mali_dvfs_status_current;
-extern int rk_get_real_fps(void);
-#define limit_fps 60
+
+#define LIMIT_FPS 60
+
static void mali_dvfs_event_proc(struct work_struct *w)
{
unsigned long flags;
fps = rk_get_real_fps();
spin_lock_irqsave(&mali_dvfs_spinlock, flags);
- if ((dvfs_status->utilisation > mali_dvfs_infotbl[dvfs_status->step].max_threshold) && (dvfs_status->step < MALI_DVFS_STEP-1) && (fps < limit_fps))
+ if ((dvfs_status->utilisation > mali_dvfs_infotbl[dvfs_status->step].max_threshold) && (dvfs_status->step < MALI_DVFS_STEP-1) && (fps < LIMIT_FPS))
{
level_up_time++;
if(level_up_time == MALI_DVFS_TIME_INTERVAL)
}
static int cfgdone_last_time_ms = 0;
static int cfgdone_interval_ms = 0;
-int rk_get_real_fps()
+int rk_get_real_fps(void)
{
struct timespec now;
int interval_ms = 0;
getnstimeofday(&now);
interval_ms = (now.tv_sec *1000 + now.tv_nsec/1000000) - cfgdone_last_time_ms;
interval_ms = (interval_ms > cfgdone_interval_ms) ? interval_ms : cfgdone_interval_ms;
- return 1000 / interval_ms;
+ if(!interval_ms)
+ return 60;/*keep cpu clock*/
+ else
+ return 1000 / interval_ms;
}
EXPORT_SYMBOL(rk_get_real_fps);
extern char *get_format_string(enum data_format, char *fmt);
extern int support_uboot_display(void);
extern int rk_fb_calc_fps(struct rk_screen * screen, u32 pixclock);
+extern int rk_get_real_fps(void);
#endif