summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/common/linux/driver_common.c8
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c7
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c9
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c6
5 files changed, 20 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c
index b90574e0..948bb69f 100644
--- a/drivers/gpu/nvgpu/common/linux/driver_common.c
+++ b/drivers/gpu/nvgpu/common/linux/driver_common.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -27,7 +27,6 @@
27#include <nvgpu/debug.h> 27#include <nvgpu/debug.h>
28#include <nvgpu/sizes.h> 28#include <nvgpu/sizes.h>
29 29
30#include "scale.h"
31#include "gk20a/gk20a.h" 30#include "gk20a/gk20a.h"
32#include "platform_gk20a.h" 31#include "platform_gk20a.h"
33#include "module.h" 32#include "module.h"
@@ -226,11 +225,6 @@ int nvgpu_probe(struct gk20a *g,
226 if (err) 225 if (err)
227 return err; 226 return err;
228 227
229
230 /* Initialise scaling */
231 if (IS_ENABLED(CONFIG_GK20A_DEVFREQ))
232 gk20a_scale_init(dev);
233
234 if (platform->late_probe) { 228 if (platform->late_probe) {
235 err = platform->late_probe(dev); 229 err = platform->late_probe(dev);
236 if (err) { 230 if (err) {
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index d22455ff..b0cad0ce 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -264,6 +264,13 @@ int gk20a_pm_finalize_poweron(struct device *dev)
264 if (err) 264 if (err)
265 goto done; 265 goto done;
266 266
267 /* Initialise scaling: it will initialize scaling drive only once */
268 if (IS_ENABLED(CONFIG_GK20A_DEVFREQ)) {
269 gk20a_scale_init(dev);
270 if (platform->initscale)
271 platform->initscale(dev);
272 }
273
267 trace_gk20a_finalize_poweron_done(dev_name(dev)); 274 trace_gk20a_finalize_poweron_done(dev_name(dev));
268 275
269 err = nvgpu_init_os_linux_ops(l); 276 err = nvgpu_init_os_linux_ops(l);
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a.h b/drivers/gpu/nvgpu/common/linux/platform_gk20a.h
index b0c089e6..60e71a74 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a.h
@@ -177,6 +177,9 @@ struct gk20a_platform {
177 /* Called to register GPCPLL with common clk framework */ 177 /* Called to register GPCPLL with common clk framework */
178 int (*clk_register)(struct gk20a *g); 178 int (*clk_register)(struct gk20a *g);
179 179
180 /* platform specific scale init quirks */
181 void (*initscale)(struct device *dev);
182
180 /* Postscale callback is called after frequency change */ 183 /* Postscale callback is called after frequency change */
181 void (*postscale)(struct device *dev, 184 void (*postscale)(struct device *dev,
182 unsigned long freq); 185 unsigned long freq);
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
index c40eafe4..db30fff2 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Tegra Platform Interface 2 * GK20A Tegra Platform Interface
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -592,6 +592,9 @@ static void gk20a_tegra_scale_init(struct device *dev)
592 if (!profile) 592 if (!profile)
593 return; 593 return;
594 594
595 if (profile->private_data)
596 return;
597
595 emc_params = nvgpu_kzalloc(platform->g, sizeof(*emc_params)); 598 emc_params = nvgpu_kzalloc(platform->g, sizeof(*emc_params));
596 if (!emc_params) 599 if (!emc_params)
597 return; 600 return;
@@ -850,9 +853,6 @@ static int gk20a_tegra_late_probe(struct device *dev)
850 /* Cause early VPR resize */ 853 /* Cause early VPR resize */
851 gk20a_tegra_secure_page_alloc(dev); 854 gk20a_tegra_secure_page_alloc(dev);
852 855
853 /* Initialise tegra specific scaling quirks */
854 gk20a_tegra_scale_init(dev);
855
856 return 0; 856 return 0;
857} 857}
858 858
@@ -958,6 +958,7 @@ struct gk20a_platform gm20b_tegra_platform = {
958#endif 958#endif
959 959
960 /* frequency scaling configuration */ 960 /* frequency scaling configuration */
961 .initscale = gk20a_tegra_scale_init,
961 .prescale = gk20a_tegra_prescale, 962 .prescale = gk20a_tegra_prescale,
962#ifdef CONFIG_TEGRA_BWMGR 963#ifdef CONFIG_TEGRA_BWMGR
963 .postscale = gm20b_tegra_postscale, 964 .postscale = gm20b_tegra_postscale,
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
index 00cbe48e..36052ee3 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c
@@ -106,6 +106,9 @@ static void gp10b_tegra_scale_init(struct device *dev)
106 if (!profile) 106 if (!profile)
107 return; 107 return;
108 108
109 if ((struct tegra_bwmgr_client *)profile->private_data)
110 return;
111
109 bwmgr_handle = tegra_bwmgr_register(TEGRA_BWMGR_CLIENT_GPU); 112 bwmgr_handle = tegra_bwmgr_register(TEGRA_BWMGR_CLIENT_GPU);
110 if (!bwmgr_handle) 113 if (!bwmgr_handle)
111 return; 114 return;
@@ -157,8 +160,6 @@ static int gp10b_tegra_late_probe(struct device *dev)
157 /* Cause early VPR resize */ 160 /* Cause early VPR resize */
158 gk20a_tegra_secure_page_alloc(dev); 161 gk20a_tegra_secure_page_alloc(dev);
159 162
160 /* Initialise tegra specific scaling quirks */
161 gp10b_tegra_scale_init(dev);
162 return 0; 163 return 0;
163} 164}
164 165
@@ -405,6 +406,7 @@ struct gk20a_platform gp10b_tegra_platform = {
405 .get_clk_freqs = gp10b_clk_get_freqs, 406 .get_clk_freqs = gp10b_clk_get_freqs,
406 407
407 /* frequency scaling configuration */ 408 /* frequency scaling configuration */
409 .initscale = gp10b_tegra_scale_init,
408 .prescale = gp10b_tegra_prescale, 410 .prescale = gp10b_tegra_prescale,
409 .postscale = gp10b_tegra_postscale, 411 .postscale = gp10b_tegra_postscale,
410 .devfreq_governor = "nvhost_podgov", 412 .devfreq_governor = "nvhost_podgov",