Merge "msm: kgsl: Update total time at right place for accurate GPU busy"

This commit is contained in:
Linux Build Service Account 2017-07-25 15:29:45 -07:00 committed by Gerrit - the friendly Code Review server
commit dd657527ba

View file

@ -591,7 +591,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;
@ -602,6 +602,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
@ -609,9 +611,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;