static ssize_t mali_lock_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) { int val; ssize_t ret = -EINVAL; mutex_lock(&mali_lock_mutex); if (sscanf(buf, "%d", &val) != 1) { pr_info("%s: Invalid mali lock format\n", __func__); goto out; } if (val == 0) { /* unlock */ mali_lock_cnt = mali_dvfs_bottom_lock_pop(); if (mali_lock_cnt == 0) mali_lock_val = 0; } else if (val > 0 && val < 4) { /* lock with level */ mali_lock_cnt = mali_dvfs_bottom_lock_push(val); if (mali_lock_val < val) mali_lock_val = val; } else { pr_info("%s: Lock request is invalid\n", __func__); } ret = n; out: mutex_unlock(&mali_lock_mutex); return ret; }
void gpu_boost_on_touch(void) { if(!mali_touch_boost_level) return; mutex_lock(&boostpop_mutex); if(!is_gpu_boosted) { mali_dvfs_bottom_lock_push(mali_touch_boost_level); is_gpu_boosted = 1; } mutex_unlock(&boostpop_mutex); mod_timer(&boostpop_timer, jiffies + msecs_to_jiffies(1000)); }