Lines Matching full:gpu
22 struct msm_gpu *gpu = dev_to_gpu(dev); in msm_devfreq_target() local
23 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_target()
37 * If the GPU is idle, devfreq is not aware, so just stash in msm_devfreq_target()
46 if (gpu->funcs->gpu_set_freq) { in msm_devfreq_target()
48 gpu->funcs->gpu_set_freq(gpu, opp, df->suspended); in msm_devfreq_target()
59 static unsigned long get_freq(struct msm_gpu *gpu) in get_freq() argument
61 struct msm_gpu_devfreq *df = &gpu->devfreq; in get_freq()
64 * If the GPU is idle, use the shadow/saved freq to avoid in get_freq()
71 if (gpu->funcs->gpu_get_freq) in get_freq()
72 return gpu->funcs->gpu_get_freq(gpu); in get_freq()
74 return clk_get_rate(gpu->core_clk); in get_freq()
80 struct msm_gpu *gpu = dev_to_gpu(dev); in msm_devfreq_get_dev_status() local
81 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_get_dev_status()
88 status->current_frequency = get_freq(gpu); in msm_devfreq_get_dev_status()
99 busy_cycles = gpu->funcs->gpu_busy(gpu, &sample_rate); in msm_devfreq_get_dev_status()
133 static bool has_devfreq(struct msm_gpu *gpu) in has_devfreq() argument
135 struct msm_gpu_devfreq *df = &gpu->devfreq; in has_devfreq()
139 void msm_devfreq_init(struct msm_gpu *gpu) in msm_devfreq_init() argument
141 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_init()
142 struct msm_drm_private *priv = gpu->dev->dev_private; in msm_devfreq_init()
146 if (!gpu->funcs->gpu_busy) in msm_devfreq_init()
160 ret = dev_pm_qos_add_request(&gpu->pdev->dev, &df->boost_freq, in msm_devfreq_init()
163 DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize QoS\n"); in msm_devfreq_init()
167 msm_devfreq_profile.initial_freq = gpu->fast_rate; in msm_devfreq_init()
178 df->devfreq = devm_devfreq_add_device(&gpu->pdev->dev, in msm_devfreq_init()
183 DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n"); in msm_devfreq_init()
191 gpu->cooling = of_devfreq_cooling_register(gpu->pdev->dev.of_node, df->devfreq); in msm_devfreq_init()
192 if (IS_ERR(gpu->cooling)) { in msm_devfreq_init()
193 DRM_DEV_ERROR(&gpu->pdev->dev, in msm_devfreq_init()
194 "Couldn't register GPU cooling device\n"); in msm_devfreq_init()
195 gpu->cooling = NULL; in msm_devfreq_init()
198 msm_hrtimer_work_init(&df->boost_work, gpu->worker, msm_devfreq_boost_work, in msm_devfreq_init()
200 msm_hrtimer_work_init(&df->idle_work, gpu->worker, msm_devfreq_idle_work, in msm_devfreq_init()
216 void msm_devfreq_cleanup(struct msm_gpu *gpu) in msm_devfreq_cleanup() argument
218 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_cleanup()
220 if (!has_devfreq(gpu)) in msm_devfreq_cleanup()
223 devfreq_cooling_unregister(gpu->cooling); in msm_devfreq_cleanup()
227 void msm_devfreq_resume(struct msm_gpu *gpu) in msm_devfreq_resume() argument
229 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_resume()
232 if (!has_devfreq(gpu)) in msm_devfreq_resume()
236 df->busy_cycles = gpu->funcs->gpu_busy(gpu, &sample_rate); in msm_devfreq_resume()
244 void msm_devfreq_suspend(struct msm_gpu *gpu) in msm_devfreq_suspend() argument
246 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_suspend()
248 if (!has_devfreq(gpu)) in msm_devfreq_suspend()
269 void msm_devfreq_boost(struct msm_gpu *gpu, unsigned factor) in msm_devfreq_boost() argument
271 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_boost()
274 if (!has_devfreq(gpu)) in msm_devfreq_boost()
277 freq = get_freq(gpu); in msm_devfreq_boost()
293 void msm_devfreq_active(struct msm_gpu *gpu) in msm_devfreq_active() argument
295 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_active()
299 if (!has_devfreq(gpu)) in msm_devfreq_active()
325 msm_devfreq_target(&gpu->pdev->dev, &target_freq, 0); in msm_devfreq_active()
335 msm_devfreq_boost(gpu, 2); in msm_devfreq_active()
344 struct msm_gpu *gpu = container_of(df, struct msm_gpu, devfreq); in msm_devfreq_idle_work() local
345 struct msm_drm_private *priv = gpu->dev->dev_private; in msm_devfreq_idle_work()
354 idle_freq = get_freq(gpu); in msm_devfreq_idle_work()
357 msm_devfreq_target(&gpu->pdev->dev, &target_freq, 0); in msm_devfreq_idle_work()
365 void msm_devfreq_idle(struct msm_gpu *gpu) in msm_devfreq_idle() argument
367 struct msm_gpu_devfreq *df = &gpu->devfreq; in msm_devfreq_idle()
369 if (!has_devfreq(gpu)) in msm_devfreq_idle()