mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
Merge "msm: kgsl: Store power_interval_timeout in msec"
This commit is contained in:
commit
e6c07194da
9 changed files with 34 additions and 40 deletions
|
|
@ -420,9 +420,8 @@ static void adreno_input_event(struct input_handle *handle, unsigned int type,
|
|||
*/
|
||||
|
||||
device->flags |= KGSL_FLAG_WAKE_ON_TOUCH;
|
||||
kgsl_start_idle_timer(device);
|
||||
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
} else if (device->state == KGSL_STATE_SLUMBER) {
|
||||
schedule_work(&adreno_dev->input_work);
|
||||
}
|
||||
|
|
@ -1076,7 +1075,7 @@ static int adreno_of_get_power(struct adreno_device *adreno_dev,
|
|||
l3_pwrlevel_probe(device, pdev->dev.of_node);
|
||||
|
||||
/* Default timeout is 80 ms across all targets */
|
||||
device->pwrctrl.interval_timeout = msecs_to_jiffies(80);
|
||||
device->pwrctrl.interval_timeout = 80;
|
||||
|
||||
device->pwrctrl.minbw_timeout = 10;
|
||||
|
||||
|
|
@ -1883,8 +1882,7 @@ static void adreno_pwrctrl_active_count_put(struct adreno_device *adreno_dev)
|
|||
kgsl_pwrscale_update(device);
|
||||
}
|
||||
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
trace_kgsl_active_count(device,
|
||||
|
|
|
|||
|
|
@ -2736,8 +2736,7 @@ static void a6xx_gmu_active_count_put(struct adreno_device *adreno_dev)
|
|||
if (atomic_dec_and_test(&device->active_cnt)) {
|
||||
kgsl_pwrscale_update_stats(device);
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
trace_kgsl_active_count(device,
|
||||
|
|
@ -2933,8 +2932,7 @@ static int a6xx_boot(struct adreno_device *adreno_dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
mod_timer(&device->idle_timer, jiffies +
|
||||
device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
|
||||
kgsl_pwrscale_wake(device);
|
||||
|
||||
|
|
@ -3110,8 +3108,7 @@ static void gmu_idle_check(struct work_struct *work)
|
|||
a6xx_power_off(adreno_dev);
|
||||
} else {
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
done:
|
||||
|
|
|
|||
|
|
@ -298,8 +298,7 @@ static void a6xx_hwsched_active_count_put(struct adreno_device *adreno_dev)
|
|||
if (atomic_dec_and_test(&device->active_cnt)) {
|
||||
kgsl_pwrscale_update_stats(device);
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
trace_kgsl_active_count(device,
|
||||
|
|
@ -527,8 +526,7 @@ static int a6xx_hwsched_boot(struct adreno_device *adreno_dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
mod_timer(&device->idle_timer, jiffies +
|
||||
device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
|
||||
kgsl_pwrscale_wake(device);
|
||||
|
||||
|
|
@ -666,8 +664,7 @@ static void hwsched_idle_check(struct work_struct *work)
|
|||
a6xx_hwsched_power_off(adreno_dev);
|
||||
} else {
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
done:
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ static void a6xx_rgmu_active_count_put(struct adreno_device *adreno_dev)
|
|||
if (atomic_dec_and_test(&device->active_cnt)) {
|
||||
kgsl_pwrscale_update_stats(device);
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
trace_kgsl_active_count(device,
|
||||
|
|
@ -856,8 +855,7 @@ static void rgmu_idle_check(struct work_struct *work)
|
|||
a6xx_power_off(adreno_dev);
|
||||
} else {
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
done:
|
||||
|
|
@ -891,8 +889,7 @@ static int a6xx_boot(struct adreno_device *adreno_dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
mod_timer(&device->idle_timer, jiffies +
|
||||
device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
|
||||
kgsl_pwrscale_wake(device);
|
||||
|
||||
|
|
|
|||
|
|
@ -2454,8 +2454,7 @@ static void _dispatcher_update_timers(struct adreno_device *adreno_dev)
|
|||
/* Kick the idle timer */
|
||||
mutex_lock(&device->mutex);
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
mutex_unlock(&device->mutex);
|
||||
|
||||
/* Check to see if we need to update the command timer */
|
||||
|
|
|
|||
|
|
@ -1307,8 +1307,7 @@ static void adreno_hwsched_work(struct kthread_work *work)
|
|||
} else {
|
||||
mutex_lock(&device->mutex);
|
||||
kgsl_pwrscale_update(device);
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
mutex_unlock(&device->mutex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -602,6 +602,18 @@ static inline bool kgsl_state_is_nap_or_minbw(struct kgsl_device *device)
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* kgsl_start_idle_timer - Start the idle timer
|
||||
* @device: A KGSL device handle
|
||||
*
|
||||
* Start the idle timer to expire in 'interval_timeout' milliseconds
|
||||
*/
|
||||
static inline void kgsl_start_idle_timer(struct kgsl_device *device)
|
||||
{
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies + msecs_to_jiffies(device->pwrctrl.interval_timeout));
|
||||
}
|
||||
|
||||
int kgsl_readtimestamp(struct kgsl_device *device, void *priv,
|
||||
enum kgsl_timestamp_type type, unsigned int *timestamp);
|
||||
|
||||
|
|
|
|||
|
|
@ -273,14 +273,14 @@ void kgsl_pwrctrl_set_constraint(struct kgsl_device *device,
|
|||
pwrc_old->sub_type = pwrc->sub_type;
|
||||
pwrc_old->hint.pwrlevel.level = constraint;
|
||||
pwrc_old->owner_id = id;
|
||||
pwrc_old->expires = jiffies + device->pwrctrl.interval_timeout;
|
||||
pwrc_old->expires = jiffies + msecs_to_jiffies(device->pwrctrl.interval_timeout);
|
||||
kgsl_pwrctrl_pwrlevel_change(device, constraint);
|
||||
/* Trace the constraint being set by the driver */
|
||||
trace_kgsl_constraint(device, pwrc_old->type, constraint, 1);
|
||||
} else if ((pwrc_old->type == pwrc->type) &&
|
||||
(pwrc_old->hint.pwrlevel.level == constraint)) {
|
||||
pwrc_old->owner_id = id;
|
||||
pwrc_old->expires = jiffies + device->pwrctrl.interval_timeout;
|
||||
pwrc_old->expires = jiffies + msecs_to_jiffies(device->pwrctrl.interval_timeout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -528,7 +528,7 @@ static ssize_t __timer_store(struct device *dev, struct device_attribute *attr,
|
|||
mutex_lock(&device->mutex);
|
||||
/* Let the timeout be requested in ms, but convert to jiffies. */
|
||||
if (timer == KGSL_PWR_IDLE_TIMER)
|
||||
device->pwrctrl.interval_timeout = msecs_to_jiffies(val);
|
||||
device->pwrctrl.interval_timeout = val;
|
||||
|
||||
mutex_unlock(&device->mutex);
|
||||
|
||||
|
|
@ -548,8 +548,7 @@ static ssize_t idle_timer_show(struct device *dev,
|
|||
struct kgsl_device *device = dev_get_drvdata(dev);
|
||||
|
||||
/* Show the idle_timeout converted to msec */
|
||||
return scnprintf(buf, PAGE_SIZE, "%u\n",
|
||||
jiffies_to_msecs(device->pwrctrl.interval_timeout));
|
||||
return scnprintf(buf, PAGE_SIZE, "%u\n", device->pwrctrl.interval_timeout);
|
||||
}
|
||||
|
||||
static ssize_t minbw_timer_store(struct device *dev,
|
||||
|
|
@ -1653,9 +1652,7 @@ done:
|
|||
kgsl_pwrctrl_request_state(device, KGSL_STATE_NONE);
|
||||
|
||||
if (device->state == KGSL_STATE_ACTIVE)
|
||||
mod_timer(&device->idle_timer,
|
||||
jiffies +
|
||||
device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
}
|
||||
|
||||
if (device->state != KGSL_STATE_MINBW)
|
||||
|
|
@ -1851,8 +1848,7 @@ static int _wake(struct kgsl_device *device)
|
|||
kgsl_pwrctrl_pwrlevel_change_settings(device, 1);
|
||||
/* All settings for power level transitions are complete*/
|
||||
pwr->previous_pwrlevel = pwr->active_pwrlevel;
|
||||
mod_timer(&device->idle_timer, jiffies +
|
||||
device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
del_timer_sync(&device->pwrctrl.minbw_timer);
|
||||
break;
|
||||
case KGSL_STATE_AWARE:
|
||||
|
|
@ -1860,8 +1856,7 @@ static int _wake(struct kgsl_device *device)
|
|||
/* Enable state before turning on irq */
|
||||
kgsl_pwrctrl_set_state(device, KGSL_STATE_ACTIVE);
|
||||
kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_ON);
|
||||
mod_timer(&device->idle_timer, jiffies +
|
||||
device->pwrctrl.interval_timeout);
|
||||
kgsl_start_idle_timer(device);
|
||||
del_timer_sync(&device->pwrctrl.minbw_timer);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ struct kgsl_pwrlevel {
|
|||
* @min_pwrlevel - minimum allowable powerlevel per the user
|
||||
* @num_pwrlevels - number of available power levels
|
||||
* @throttle_mask - LM throttle mask
|
||||
* @interval_timeout - timeout in jiffies to be idle before a power event
|
||||
* @interval_timeout - timeout to be idle before a power event
|
||||
* @clock_times - Each GPU frequency's accumulated active time in us
|
||||
* @clk_stats - structure of clock statistics
|
||||
* @input_disable - To disable GPU wakeup on touch input event
|
||||
|
|
|
|||
Loading…
Reference in a new issue