From 6ea0934dd74cc61bb5f039493df567ec3a4f8b22 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 18 Aug 2014 11:00:48 +0300 Subject: gpu: nvgpu: Do not rail gate in simulation Simulation does not model rails, so do not try to control them. Change-Id: I52ec12e7865e18764274dd9ce7a2fbd196b6b9d1 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/482181 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Thomas Cherry Tested-by: Thomas Cherry --- drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index 675a85b3..db501ec2 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c @@ -279,7 +279,12 @@ void gk20a_tegra_calibrate_emc(struct platform_device *pdev, static bool gk20a_tegra_is_railgated(struct platform_device *pdev) { - return !tegra_powergate_is_powered(TEGRA_POWERGATE_GPU); + bool ret = false; + + if (!tegra_platform_is_linsim()) + ret = !tegra_powergate_is_powered(TEGRA_POWERGATE_GPU); + + return ret; } /* @@ -290,7 +295,8 @@ static bool gk20a_tegra_is_railgated(struct platform_device *pdev) static int gk20a_tegra_railgate(struct platform_device *pdev) { - if (tegra_powergate_is_powered(TEGRA_POWERGATE_GPU)) + if (!tegra_platform_is_linsim() && + tegra_powergate_is_powered(TEGRA_POWERGATE_GPU)) tegra_powergate_partition(TEGRA_POWERGATE_GPU); return 0; } @@ -303,8 +309,9 @@ static int gk20a_tegra_railgate(struct platform_device *pdev) static int gk20a_tegra_unrailgate(struct platform_device *pdev) { - int ret; - ret = tegra_unpowergate_partition(TEGRA_POWERGATE_GPU); + int ret = 0; + if (!tegra_platform_is_linsim()) + ret = tegra_unpowergate_partition(TEGRA_POWERGATE_GPU); return ret; } -- cgit v1.2.2