Lines Matching refs:df

23 	struct msm_gpu_devfreq *df = &gpu->devfreq;  in msm_devfreq_target()  local
40 if (df->idle_freq) { in msm_devfreq_target()
41 df->idle_freq = *freq; in msm_devfreq_target()
47 mutex_lock(&df->lock); in msm_devfreq_target()
48 gpu->funcs->gpu_set_freq(gpu, opp, df->suspended); in msm_devfreq_target()
49 mutex_unlock(&df->lock); in msm_devfreq_target()
61 struct msm_gpu_devfreq *df = &gpu->devfreq; in get_freq() local
68 if (df->idle_freq) in get_freq()
69 return df->idle_freq; in get_freq()
81 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_get_dev_status() local
86 mutex_lock(&df->lock); in msm_devfreq_get_dev_status()
90 status->total_time = ktime_us_delta(time, df->time); in msm_devfreq_get_dev_status()
91 df->time = time; in msm_devfreq_get_dev_status()
93 if (df->suspended) { in msm_devfreq_get_dev_status()
94 mutex_unlock(&df->lock); in msm_devfreq_get_dev_status()
100 busy_time = busy_cycles - df->busy_cycles; in msm_devfreq_get_dev_status()
101 df->busy_cycles = busy_cycles; in msm_devfreq_get_dev_status()
103 mutex_unlock(&df->lock); in msm_devfreq_get_dev_status()
135 struct msm_gpu_devfreq *df = &gpu->devfreq; in has_devfreq() local
136 return !!df->devfreq; in has_devfreq()
141 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_init() local
157 mutex_init(&df->lock); in msm_devfreq_init()
159 dev_pm_qos_add_request(&gpu->pdev->dev, &df->boost_freq, in msm_devfreq_init()
173 df->devfreq = devm_devfreq_add_device(&gpu->pdev->dev, in msm_devfreq_init()
177 if (IS_ERR(df->devfreq)) { in msm_devfreq_init()
179 dev_pm_qos_remove_request(&df->boost_freq); in msm_devfreq_init()
180 df->devfreq = NULL; in msm_devfreq_init()
184 devfreq_suspend_device(df->devfreq); in msm_devfreq_init()
186 gpu->cooling = of_devfreq_cooling_register(gpu->pdev->dev.of_node, df->devfreq); in msm_devfreq_init()
193 msm_hrtimer_work_init(&df->boost_work, gpu->worker, msm_devfreq_boost_work, in msm_devfreq_init()
195 msm_hrtimer_work_init(&df->idle_work, gpu->worker, msm_devfreq_idle_work, in msm_devfreq_init()
199 static void cancel_idle_work(struct msm_gpu_devfreq *df) in cancel_idle_work() argument
201 hrtimer_cancel(&df->idle_work.timer); in cancel_idle_work()
202 kthread_cancel_work_sync(&df->idle_work.work); in cancel_idle_work()
205 static void cancel_boost_work(struct msm_gpu_devfreq *df) in cancel_boost_work() argument
207 hrtimer_cancel(&df->boost_work.timer); in cancel_boost_work()
208 kthread_cancel_work_sync(&df->boost_work.work); in cancel_boost_work()
213 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_cleanup() local
219 dev_pm_qos_remove_request(&df->boost_freq); in msm_devfreq_cleanup()
224 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_resume() local
230 mutex_lock(&df->lock); in msm_devfreq_resume()
231 df->busy_cycles = gpu->funcs->gpu_busy(gpu, &sample_rate); in msm_devfreq_resume()
232 df->time = ktime_get(); in msm_devfreq_resume()
233 df->suspended = false; in msm_devfreq_resume()
234 mutex_unlock(&df->lock); in msm_devfreq_resume()
236 devfreq_resume_device(df->devfreq); in msm_devfreq_resume()
241 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_suspend() local
246 mutex_lock(&df->lock); in msm_devfreq_suspend()
247 df->suspended = true; in msm_devfreq_suspend()
248 mutex_unlock(&df->lock); in msm_devfreq_suspend()
250 devfreq_suspend_device(df->devfreq); in msm_devfreq_suspend()
252 cancel_idle_work(df); in msm_devfreq_suspend()
253 cancel_boost_work(df); in msm_devfreq_suspend()
258 struct msm_gpu_devfreq *df = container_of(work, in msm_devfreq_boost_work() local
261 dev_pm_qos_update_request(&df->boost_freq, 0); in msm_devfreq_boost_work()
266 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_boost() local
281 dev_pm_qos_update_request(&df->boost_freq, freq); in msm_devfreq_boost()
283 msm_hrtimer_queue_work(&df->boost_work, in msm_devfreq_boost()
290 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_active() local
300 cancel_idle_work(df); in msm_devfreq_active()
306 mutex_lock(&df->devfreq->lock); in msm_devfreq_active()
308 target_freq = df->idle_freq; in msm_devfreq_active()
310 idle_time = ktime_to_ms(ktime_sub(ktime_get(), df->idle_time)); in msm_devfreq_active()
312 df->idle_freq = 0; in msm_devfreq_active()
322 mutex_unlock(&df->devfreq->lock); in msm_devfreq_active()
337 struct msm_gpu_devfreq *df = container_of(work, in msm_devfreq_idle_work() local
339 struct msm_gpu *gpu = container_of(df, struct msm_gpu, devfreq); in msm_devfreq_idle_work()
347 mutex_lock(&df->devfreq->lock); in msm_devfreq_idle_work()
354 df->idle_time = ktime_get(); in msm_devfreq_idle_work()
355 df->idle_freq = idle_freq; in msm_devfreq_idle_work()
357 mutex_unlock(&df->devfreq->lock); in msm_devfreq_idle_work()
362 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_idle() local
367 msm_hrtimer_queue_work(&df->idle_work, ms_to_ktime(1), in msm_devfreq_idle()