summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorPeter Boonstoppel <pboonstoppel@nvidia.com>2017-05-01 13:19:23 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-29 14:12:19 -0400
commit635e9946b718d9f0c35053b59c745ae529429f25 (patch)
tree5b28900613bac95cc5908c5665d9e494e6e104a1 /drivers/gpu/nvgpu
parentf7e37e6847896992077fe8d434ea14a751318175 (diff)
gpu: nvgpu: Remove gk20a_scale_notify_busy/idle() hooks
Remove dependency for nvgpu to invoke devfreq govenor on every gk20a_busy/idle() call. This dependency was originally necessary to track GPU load (busy vs idle) in software. However, since we currently read the load GPU from HW/PMU there is no need to invoke the devfreq governor in this path. Instead it can use timer-based polling. Jira NVGPU-20 Change-Id: Id09f89a8a562ed49164a2e06dcbb901e4a46e7d5 Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: https://git-master/r/1473140 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c10
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.c35
2 files changed, 0 insertions, 45 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 99bbc25e..c6794e44 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -96,8 +96,6 @@ int gk20a_busy(struct gk20a *g)
96 } 96 }
97 } 97 }
98 98
99 gk20a_scale_notify_busy(dev);
100
101fail: 99fail:
102 up_read(&g->busy_lock); 100 up_read(&g->busy_lock);
103 101
@@ -121,16 +119,8 @@ void gk20a_idle(struct gk20a *g)
121 return; 119 return;
122 120
123 if (pm_runtime_enabled(dev)) { 121 if (pm_runtime_enabled(dev)) {
124#ifdef CONFIG_PM
125 if (atomic_read(&g->dev->power.usage_count) == 1)
126 gk20a_scale_notify_idle(dev);
127#endif
128
129 pm_runtime_mark_last_busy(dev); 122 pm_runtime_mark_last_busy(dev);
130 pm_runtime_put_sync_autosuspend(dev); 123 pm_runtime_put_sync_autosuspend(dev);
131
132 } else {
133 gk20a_scale_notify_idle(dev);
134 } 124 }
135} 125}
136 126
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
index df4e4996..636bfad4 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
@@ -268,41 +268,6 @@ void gk20a_scale_resume(struct device *dev)
268} 268}
269 269
270/* 270/*
271 * gk20a_scale_notify(dev, busy)
272 *
273 * Calling this function informs that the device is idling (..or busy). This
274 * data is used to estimate the current load
275 */
276
277static void gk20a_scale_notify(struct device *dev, bool busy)
278{
279 struct gk20a *g = get_gk20a(dev);
280 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
281 struct gk20a_scale_profile *profile = g->scale_profile;
282 struct devfreq *devfreq = l->devfreq;
283
284 /* Is the device profile initialised? */
285 if (!(profile && devfreq))
286 return;
287
288 mutex_lock(&devfreq->lock);
289 profile->dev_stat.busy = busy;
290 update_devfreq(devfreq);
291 mutex_unlock(&devfreq->lock);
292}
293
294void gk20a_scale_notify_idle(struct device *dev)
295{
296 gk20a_scale_notify(dev, false);
297
298}
299
300void gk20a_scale_notify_busy(struct device *dev)
301{
302 gk20a_scale_notify(dev, true);
303}
304
305/*
306 * gk20a_scale_get_dev_status(dev, *stat) 271 * gk20a_scale_get_dev_status(dev, *stat)
307 * 272 *
308 * This function queries the current device status. 273 * This function queries the current device status.