Lines Matching defs:gpu

22 	struct msm_gpu *gpu = dev_to_gpu(dev);
23 struct msm_gpu_devfreq *df = &gpu->devfreq;
46 if (gpu->funcs->gpu_set_freq) {
48 gpu->funcs->gpu_set_freq(gpu, opp, df->suspended);
59 static unsigned long get_freq(struct msm_gpu *gpu)
61 struct msm_gpu_devfreq *df = &gpu->devfreq;
71 if (gpu->funcs->gpu_get_freq)
72 return gpu->funcs->gpu_get_freq(gpu);
74 return clk_get_rate(gpu->core_clk);
80 struct msm_gpu *gpu = dev_to_gpu(dev);
81 struct msm_gpu_devfreq *df = &gpu->devfreq;
88 status->current_frequency = get_freq(gpu);
99 busy_cycles = gpu->funcs->gpu_busy(gpu, &sample_rate);
133 static bool has_devfreq(struct msm_gpu *gpu)
135 struct msm_gpu_devfreq *df = &gpu->devfreq;
139 void msm_devfreq_init(struct msm_gpu *gpu)
141 struct msm_gpu_devfreq *df = &gpu->devfreq;
142 struct msm_drm_private *priv = gpu->dev->dev_private;
146 if (!gpu->funcs->gpu_busy)
161 ret = dev_pm_qos_add_request(&gpu->pdev->dev, &df->boost_freq,
164 DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize QoS\n");
168 msm_devfreq_profile.initial_freq = gpu->fast_rate;
179 df->devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
184 DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n");
192 gpu->cooling = of_devfreq_cooling_register(gpu->pdev->dev.of_node, df->devfreq);
193 if (IS_ERR(gpu->cooling)) {
194 DRM_DEV_ERROR(&gpu->pdev->dev,
196 gpu->cooling = NULL;
199 msm_hrtimer_work_init(&df->boost_work, gpu->worker, msm_devfreq_boost_work,
201 msm_hrtimer_work_init(&df->idle_work, gpu->worker, msm_devfreq_idle_work,
217 void msm_devfreq_cleanup(struct msm_gpu *gpu)
219 struct msm_gpu_devfreq *df = &gpu->devfreq;
221 if (!has_devfreq(gpu))
224 devfreq_cooling_unregister(gpu->cooling);
228 void msm_devfreq_resume(struct msm_gpu *gpu)
230 struct msm_gpu_devfreq *df = &gpu->devfreq;
233 if (!has_devfreq(gpu))
237 df->busy_cycles = gpu->funcs->gpu_busy(gpu, &sample_rate);
245 void msm_devfreq_suspend(struct msm_gpu *gpu)
247 struct msm_gpu_devfreq *df = &gpu->devfreq;
249 if (!has_devfreq(gpu))
270 void msm_devfreq_boost(struct msm_gpu *gpu, unsigned factor)
272 struct msm_gpu_devfreq *df = &gpu->devfreq;
275 if (!has_devfreq(gpu))
278 freq = get_freq(gpu);
294 void msm_devfreq_active(struct msm_gpu *gpu)
296 struct msm_gpu_devfreq *df = &gpu->devfreq;
300 if (!has_devfreq(gpu))
326 msm_devfreq_target(&gpu->pdev->dev, &target_freq, 0);
336 msm_devfreq_boost(gpu, 2);
345 struct msm_gpu *gpu = container_of(df, struct msm_gpu, devfreq);
346 struct msm_drm_private *priv = gpu->dev->dev_private;
355 idle_freq = get_freq(gpu);
358 msm_devfreq_target(&gpu->pdev->dev, &target_freq, 0);
366 void msm_devfreq_idle(struct msm_gpu *gpu)
368 struct msm_gpu_devfreq *df = &gpu->devfreq;
370 if (!has_devfreq(gpu))