diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-10-30 16:22:21 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-02 17:06:47 -0400 |
commit | 0b0df9eb84d68b9daf6b309263d133bb1a720e9b (patch) | |
tree | dc25468bd154855bb4d544f859558a892e2b7bab /drivers/gpu/nvgpu | |
parent | 25440e63d2dfd329ba35aec48f11f0c20b18cdbd (diff) |
gpu: nvgpu: Use nvgpu_is_enabled() for ASPM
Convert disable_aspm and references to that field to use
nvgpu_is_enabled(NVGPU_SUPPORT_ASPM). Initialize it from
gk20a_platform struct at probe time.
This removes another dependency to struct gk20a_platform.
JIRA NVGPU-259
Change-Id: I32e30160f817ea275aa190dcf86c5fd594138d75
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1590124
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/driver_common.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/enabled.h | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index cdb28eaf..b7444a9e 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c | |||
@@ -141,6 +141,8 @@ static void nvgpu_init_pm_vars(struct gk20a *g) | |||
141 | g->pmu.aelpg_param[2] = APCTRL_MINIMUM_TARGET_SAVING_DEFAULT_US; | 141 | g->pmu.aelpg_param[2] = APCTRL_MINIMUM_TARGET_SAVING_DEFAULT_US; |
142 | g->pmu.aelpg_param[3] = APCTRL_POWER_BREAKEVEN_DEFAULT_US; | 142 | g->pmu.aelpg_param[3] = APCTRL_POWER_BREAKEVEN_DEFAULT_US; |
143 | g->pmu.aelpg_param[4] = APCTRL_CYCLES_PER_SAMPLE_MAX_DEFAULT; | 143 | g->pmu.aelpg_param[4] = APCTRL_CYCLES_PER_SAMPLE_MAX_DEFAULT; |
144 | |||
145 | __nvgpu_set_enabled(g, NVGPU_SUPPORT_ASPM, !platform->disable_aspm); | ||
144 | } | 146 | } |
145 | 147 | ||
146 | static void nvgpu_init_vbios_vars(struct gk20a *g) | 148 | static void nvgpu_init_vbios_vars(struct gk20a *g) |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index a282110a..f71a51fd 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -124,7 +124,6 @@ int gk20a_prepare_poweroff(struct gk20a *g) | |||
124 | 124 | ||
125 | int gk20a_finalize_poweron(struct gk20a *g) | 125 | int gk20a_finalize_poweron(struct gk20a *g) |
126 | { | 126 | { |
127 | struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); | ||
128 | int err; | 127 | int err; |
129 | #if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU) | 128 | #if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU) |
130 | u32 nr_pages; | 129 | u32 nr_pages; |
@@ -312,7 +311,7 @@ int gk20a_finalize_poweron(struct gk20a *g) | |||
312 | if (g->ops.xve.available_speeds) { | 311 | if (g->ops.xve.available_speeds) { |
313 | u32 speed; | 312 | u32 speed; |
314 | 313 | ||
315 | if (platform->disable_aspm && g->ops.xve.disable_aspm) | 314 | if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_ASPM) && g->ops.xve.disable_aspm) |
316 | g->ops.xve.disable_aspm(g); | 315 | g->ops.xve.disable_aspm(g); |
317 | 316 | ||
318 | g->ops.xve.available_speeds(g, &speed); | 317 | g->ops.xve.available_speeds(g, &speed); |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 87449ccc..14595497 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h | |||
@@ -125,6 +125,8 @@ struct gk20a; | |||
125 | /* whether to run PREOS binary on dGPUs */ | 125 | /* whether to run PREOS binary on dGPUs */ |
126 | #define NVGPU_PMU_RUN_PREOS 61 | 126 | #define NVGPU_PMU_RUN_PREOS 61 |
127 | 127 | ||
128 | /* set if ASPM is enabled; only makes sense for PCI */ | ||
129 | #define NVGPU_SUPPORT_ASPM 62 | ||
128 | /* | 130 | /* |
129 | * Must be greater than the largest bit offset in the above list. | 131 | * Must be greater than the largest bit offset in the above list. |
130 | */ | 132 | */ |