diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-03-29 18:00:24 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-11 13:56:06 -0400 |
commit | 19fdb429c2b04d13faecad8b2e5466e9f3c7b8c7 (patch) | |
tree | e92f6d93ae2593286546f983b9a1fff8638aa9a6 /drivers/gpu/nvgpu/common/nvgpu_common.c | |
parent | 1a4647272f4fe50137c79583b698c1ef6f5def12 (diff) |
gpu: nvgpu: Wrappers for checking platform type
Add nvgpu_* wrappers for determining if we're running in simulation
or silicon, and if we're running in hypervisor.
The new wrappers require struct gk20a pointer, and gk20a_fence_wait()
did not have access to one. Add struct gk20a pointer as the first
parameter.
JIRA NVGPU-16
Change-Id: I73b2b8f091ca29fb1827054abd2adaf583710331
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1331565
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/nvgpu_common.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/nvgpu_common.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/nvgpu_common.c b/drivers/gpu/nvgpu/common/nvgpu_common.c index a07a8f7d..f8f4a636 100644 --- a/drivers/gpu/nvgpu/common/nvgpu_common.c +++ b/drivers/gpu/nvgpu/common/nvgpu_common.c | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <nvgpu/kmem.h> | 20 | #include <nvgpu/kmem.h> |
21 | #include <nvgpu/nvgpu_common.h> | 21 | #include <nvgpu/nvgpu_common.h> |
22 | #include <nvgpu/soc.h> | ||
22 | 23 | ||
23 | #include "gk20a/gk20a_scale.h" | 24 | #include "gk20a/gk20a_scale.h" |
24 | #include "gk20a/gk20a.h" | 25 | #include "gk20a/gk20a.h" |
@@ -60,7 +61,7 @@ static void nvgpu_init_vars(struct gk20a *g) | |||
60 | static void nvgpu_init_timeout(struct gk20a *g) | 61 | static void nvgpu_init_timeout(struct gk20a *g) |
61 | { | 62 | { |
62 | g->gr_idle_timeout_default = CONFIG_GK20A_DEFAULT_TIMEOUT; | 63 | g->gr_idle_timeout_default = CONFIG_GK20A_DEFAULT_TIMEOUT; |
63 | if (tegra_platform_is_silicon()) | 64 | if (nvgpu_platform_is_silicon(g)) |
64 | g->timeouts_enabled = true; | 65 | g->timeouts_enabled = true; |
65 | } | 66 | } |
66 | 67 | ||
@@ -85,17 +86,17 @@ static void nvgpu_init_pm_vars(struct gk20a *g) | |||
85 | * power features and for silicon platforms, read from platform data | 86 | * power features and for silicon platforms, read from platform data |
86 | */ | 87 | */ |
87 | g->slcg_enabled = | 88 | g->slcg_enabled = |
88 | tegra_platform_is_silicon() ? platform->enable_slcg : false; | 89 | nvgpu_platform_is_silicon(g) ? platform->enable_slcg : false; |
89 | g->blcg_enabled = | 90 | g->blcg_enabled = |
90 | tegra_platform_is_silicon() ? platform->enable_blcg : false; | 91 | nvgpu_platform_is_silicon(g) ? platform->enable_blcg : false; |
91 | g->elcg_enabled = | 92 | g->elcg_enabled = |
92 | tegra_platform_is_silicon() ? platform->enable_elcg : false; | 93 | nvgpu_platform_is_silicon(g) ? platform->enable_elcg : false; |
93 | g->elpg_enabled = | 94 | g->elpg_enabled = |
94 | tegra_platform_is_silicon() ? platform->enable_elpg : false; | 95 | nvgpu_platform_is_silicon(g) ? platform->enable_elpg : false; |
95 | g->aelpg_enabled = | 96 | g->aelpg_enabled = |
96 | tegra_platform_is_silicon() ? platform->enable_aelpg : false; | 97 | nvgpu_platform_is_silicon(g) ? platform->enable_aelpg : false; |
97 | g->mscg_enabled = | 98 | g->mscg_enabled = |
98 | tegra_platform_is_silicon() ? platform->enable_mscg : false; | 99 | nvgpu_platform_is_silicon(g) ? platform->enable_mscg : false; |
99 | 100 | ||
100 | /* set default values to aelpg parameters */ | 101 | /* set default values to aelpg parameters */ |
101 | g->pmu.aelpg_param[0] = APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US; | 102 | g->pmu.aelpg_param[0] = APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US; |