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

Commit dca34e2b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Bump the GPU frequency for long blocks of processing"

parents 92239b16 86ff3d53
Loading
Loading
Loading
Loading
+21 −1
Original line number Original line Diff line number Diff line
@@ -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


/*
/*
@@ -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);
@@ -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);
@@ -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;