Loading drivers/devfreq/governor_msm_adreno_tz.c +21 −1 Original line number Original line Diff line number Diff line Loading @@ -35,6 +35,13 @@ static DEFINE_SPINLOCK(tz_lock); * MIN_BUSY is 1 msec for the sample to be sent * MIN_BUSY is 1 msec for the sample to be sent */ */ #define MIN_BUSY 1000 #define MIN_BUSY 1000 /* * Use BUSY_BIN to check for fully busy rendering * intervals that may need early intervention when * seen with LONG_FRAME lengths */ #define BUSY_BIN 95 #define LONG_FRAME 25000 #define MAX_TZ_VERSION 0 #define MAX_TZ_VERSION 0 /* /* Loading Loading @@ -177,6 +184,7 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, struct devfreq_dev_status stats; struct devfreq_dev_status stats; int val, level = 0; int val, level = 0; unsigned int scm_data[3]; unsigned int scm_data[3]; static int busy_bin, frame_flag; /* keeps stats.private_data == NULL */ /* keeps stats.private_data == NULL */ result = devfreq->profile->get_dev_status(devfreq->dev.parent, &stats); result = devfreq->profile->get_dev_status(devfreq->dev.parent, &stats); Loading @@ -201,6 +209,15 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, return 0; return 0; } } if ((stats.busy_time * 100 / stats.total_time) > BUSY_BIN) { busy_bin += stats.busy_time; if (stats.total_time > LONG_FRAME) frame_flag = 1; } else { busy_bin = 0; frame_flag = 0; } level = devfreq_get_freq_level(devfreq, stats.current_frequency); level = devfreq_get_freq_level(devfreq, stats.current_frequency); if (level < 0) { if (level < 0) { pr_err(TAG "bad freq %ld\n", stats.current_frequency); pr_err(TAG "bad freq %ld\n", stats.current_frequency); Loading @@ -211,8 +228,11 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, * If there is an extended block of busy processing, * If there is an extended block of busy processing, * increase frequency. Otherwise run the normal algorithm. * increase frequency. Otherwise run the normal algorithm. */ */ if (priv->bin.busy_time > CEILING) { if (priv->bin.busy_time > CEILING || (busy_bin > CEILING && frame_flag)) { val = -1 * level; val = -1 * level; busy_bin = 0; frame_flag = 0; } else { } else { scm_data[0] = level; scm_data[0] = level; Loading Loading
drivers/devfreq/governor_msm_adreno_tz.c +21 −1 Original line number Original line Diff line number Diff line Loading @@ -35,6 +35,13 @@ static DEFINE_SPINLOCK(tz_lock); * MIN_BUSY is 1 msec for the sample to be sent * MIN_BUSY is 1 msec for the sample to be sent */ */ #define MIN_BUSY 1000 #define MIN_BUSY 1000 /* * Use BUSY_BIN to check for fully busy rendering * intervals that may need early intervention when * seen with LONG_FRAME lengths */ #define BUSY_BIN 95 #define LONG_FRAME 25000 #define MAX_TZ_VERSION 0 #define MAX_TZ_VERSION 0 /* /* Loading Loading @@ -177,6 +184,7 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, struct devfreq_dev_status stats; struct devfreq_dev_status stats; int val, level = 0; int val, level = 0; unsigned int scm_data[3]; unsigned int scm_data[3]; static int busy_bin, frame_flag; /* keeps stats.private_data == NULL */ /* keeps stats.private_data == NULL */ result = devfreq->profile->get_dev_status(devfreq->dev.parent, &stats); result = devfreq->profile->get_dev_status(devfreq->dev.parent, &stats); Loading @@ -201,6 +209,15 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, return 0; return 0; } } if ((stats.busy_time * 100 / stats.total_time) > BUSY_BIN) { busy_bin += stats.busy_time; if (stats.total_time > LONG_FRAME) frame_flag = 1; } else { busy_bin = 0; frame_flag = 0; } level = devfreq_get_freq_level(devfreq, stats.current_frequency); level = devfreq_get_freq_level(devfreq, stats.current_frequency); if (level < 0) { if (level < 0) { pr_err(TAG "bad freq %ld\n", stats.current_frequency); pr_err(TAG "bad freq %ld\n", stats.current_frequency); Loading @@ -211,8 +228,11 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, * If there is an extended block of busy processing, * If there is an extended block of busy processing, * increase frequency. Otherwise run the normal algorithm. * increase frequency. Otherwise run the normal algorithm. */ */ if (priv->bin.busy_time > CEILING) { if (priv->bin.busy_time > CEILING || (busy_bin > CEILING && frame_flag)) { val = -1 * level; val = -1 * level; busy_bin = 0; frame_flag = 0; } else { } else { scm_data[0] = level; scm_data[0] = level; Loading