From 6f4d1bb2e70e97424d44cba131199b41deb102d8 Mon Sep 17 00:00:00 2001 From: Matt Craighead Date: Tue, 6 Oct 2015 17:22:08 -0500 Subject: gpu: nvgpu: gp10b: skip powergate if no BPMP The powergating APIs only work if the BPMP is running. Skip these calls if it's not available, instead of relying on is_linsim, which doesn't work under all environments. Change-Id: I34325847b2ebf33c5db2f31111c57d22ed28ef53 Signed-off-by: Matt Craighead Reviewed-on: http://git-master/r/812415 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c index eb99a66c..559cad2e 100644 --- a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "gk20a/platform_gk20a.h" #include "gk20a/gk20a.h" #include "platform_tegra.h" @@ -136,7 +137,7 @@ static bool gp10b_tegra_is_railgated(struct platform_device *pdev) { bool ret = false; - if (!tegra_platform_is_linsim()) + if (tegra_bpmp_running()) ret = !tegra_powergate_is_powered(TEGRA_POWERGATE_GPU); return ret; @@ -146,7 +147,7 @@ static int gp10b_tegra_railgate(struct platform_device *pdev) { struct gk20a_platform *platform = gk20a_get_platform(pdev); - if (!tegra_platform_is_linsim() && + if (tegra_bpmp_running() && tegra_powergate_is_powered(TEGRA_POWERGATE_GPU)) { int i; for (i = 0; i < platform->num_clks; i++) { @@ -163,7 +164,7 @@ static int gp10b_tegra_unrailgate(struct platform_device *pdev) int ret = 0; struct gk20a_platform *platform = gk20a_get_platform(pdev); - if (!tegra_platform_is_linsim()) { + if (tegra_bpmp_running()) { int i; ret = tegra_unpowergate_partition(TEGRA_POWERGATE_GPU); for (i = 0; i < platform->num_clks; i++) { -- cgit v1.2.2