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

Commit d9d17048 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: Update total time at right place for accurate GPU busy"

parents 5669eca9 cd3f7a05
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ int kgsl_devfreq_get_dev_status(struct device *dev,
	struct kgsl_device *device = dev_get_drvdata(dev);
	struct kgsl_pwrctrl *pwrctrl;
	struct kgsl_pwrscale *pwrscale;
	ktime_t tmp;
	ktime_t tmp1, tmp2;

	if (device == NULL)
		return -ENODEV;
@@ -529,6 +529,8 @@ int kgsl_devfreq_get_dev_status(struct device *dev,
	pwrctrl = &device->pwrctrl;

	mutex_lock(&device->mutex);

	tmp1 = ktime_get();
	/*
	 * If the GPU clock is on grab the latest power counter
	 * values.  Otherwise the most recent ACTIVE values will
@@ -536,9 +538,9 @@ int kgsl_devfreq_get_dev_status(struct device *dev,
	 */
	kgsl_pwrscale_update_stats(device);

	tmp = ktime_get();
	stat->total_time = ktime_us_delta(tmp, pwrscale->time);
	pwrscale->time = tmp;
	tmp2 = ktime_get();
	stat->total_time = ktime_us_delta(tmp2, pwrscale->time);
	pwrscale->time = tmp1;

	stat->busy_time = pwrscale->accum_stats.busy_time;