summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-01-06 07:54:48 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-01-21 11:36:41 -0500
commitf28526bb727679de8016c66607a204f5c294b014 (patch)
tree8d466fcbe4beaab7705d0c33256b6e82b5d998e7 /drivers/gpu/nvgpu/gk20a/gk20a_scale.c
parentcd09ac26c7e10fbc4ca96b54be3b1578614e3680 (diff)
gpu: nvgpu: move pmu_load_update() to get_dev_status()
We currently call gk20a_pmu_load_update() before calling update_devfreq() But it is possible to disable governor and set a constant/max frequency. In that case we will unnecessarily keep executing gk20a_pmu_load_update() for each submit Hence. move gk20a_pmu_load_update() to gk20a_scale_get_dev_status() so that we call gk20a_pmu_load_update() only when we really have to scale the frequency Bug 200161377 Change-Id: Ifac5a659a3a2d088b636f048213c2fbec801bdb9 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/929509 (cherry picked from commit f857a1b31400dfc0c35c58c6424aaac36bc09e7c) Reviewed-on: http://git-master/r/933704 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
index 82e24535..65772d3b 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
@@ -190,18 +190,10 @@ void gk20a_scale_resume(struct platform_device *pdev)
190 190
191static void gk20a_scale_notify(struct platform_device *pdev, bool busy) 191static void gk20a_scale_notify(struct platform_device *pdev, bool busy)
192{ 192{
193 struct gk20a_platform *platform = platform_get_drvdata(pdev);
194 struct gk20a *g = get_gk20a(pdev); 193 struct gk20a *g = get_gk20a(pdev);
195 struct gk20a_scale_profile *profile = g->scale_profile; 194 struct gk20a_scale_profile *profile = g->scale_profile;
196 struct devfreq *devfreq = g->devfreq; 195 struct devfreq *devfreq = g->devfreq;
197 196
198 /* update the software shadow */
199 gk20a_pmu_load_update(g);
200
201 /* inform edp about new constraint */
202 if (platform->prescale)
203 platform->prescale(pdev);
204
205 /* Is the device profile initialised? */ 197 /* Is the device profile initialised? */
206 if (!(profile && devfreq)) 198 if (!(profile && devfreq))
207 return; 199 return;
@@ -237,6 +229,13 @@ static int gk20a_scale_get_dev_status(struct device *dev,
237 struct platform_device *pdev = to_platform_device(dev); 229 struct platform_device *pdev = to_platform_device(dev);
238 struct gk20a_platform *platform = platform_get_drvdata(pdev); 230 struct gk20a_platform *platform = platform_get_drvdata(pdev);
239 231
232 /* update the software shadow */
233 gk20a_pmu_load_update(g);
234
235 /* inform edp about new constraint */
236 if (platform->prescale)
237 platform->prescale(pdev);
238
240 /* Make sure there are correct values for the current frequency */ 239 /* Make sure there are correct values for the current frequency */
241 profile->dev_stat.current_frequency = 240 profile->dev_stat.current_frequency =
242 platform->clk_get_rate(profile->pdev); 241 platform->clk_get_rate(profile->pdev);