From 6c6936858af4902ca0e170da03ddf92e32b74ae1 Mon Sep 17 00:00:00 2001 From: Matt Pedro Date: Sun, 11 May 2014 22:57:48 -0400 Subject: Revert "gpu: nvgpu: Keep host1x on when GPU on" This reverts commit 20d48a759b032116e3092e1df76518065da59879. Change-Id: I93718a314b70ee9284a83ca69964883e670ad78d Signed-off-by: Matt Pedro Reviewed-on: http://git-master/r/407969 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 57 ++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 21 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 96711c0c..7617c70a 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -740,10 +740,10 @@ void gk20a_put_client(struct gk20a *g) WARN_ON(g->client_refcount < 0); } -static int gk20a_pm_prepare_poweroff(struct device *dev) +static int gk20a_pm_prepare_poweroff(struct device *_dev) { - struct platform_device *pdev = to_platform_device(dev); - struct gk20a *g = get_gk20a(pdev); + struct platform_device *dev = to_platform_device(_dev); + struct gk20a *g = get_gk20a(dev); int ret = 0; gk20a_dbg_fn(""); @@ -770,8 +770,6 @@ static int gk20a_pm_prepare_poweroff(struct device *dev) /* Disable GPCPLL */ ret |= gk20a_suspend_clk_support(g); - - gk20a_platform_channel_idle(pdev); g->power_on = false; return ret; @@ -795,18 +793,14 @@ static void gk20a_detect_chip(struct gk20a *g) g->gpu_characteristics.rev); } -static int gk20a_pm_finalize_poweron(struct device *dev) +static int gk20a_pm_finalize_poweron(struct device *_dev) { - struct platform_device *pdev = to_platform_device(dev); - struct gk20a *g = get_gk20a(pdev); + struct platform_device *dev = to_platform_device(_dev); + struct gk20a *g = get_gk20a(dev); int err, nice_value; gk20a_dbg_fn(""); - err = gk20a_platform_channel_busy(pdev); - if (err) - return err; - if (g->power_on) return 0; @@ -855,7 +849,7 @@ static int gk20a_pm_finalize_poweron(struct device *dev) saving features (blcg/slcg) are enabled. For now, do it here. */ err = gk20a_init_clk_support(g); if (err) { - gk20a_err(dev, "failed to init gk20a clk"); + gk20a_err(&dev->dev, "failed to init gk20a clk"); goto done; } @@ -874,7 +868,7 @@ static int gk20a_pm_finalize_poweron(struct device *dev) err = gk20a_init_fifo_reset_enable_hw(g); if (err) { - gk20a_err(dev, "failed to reset gk20a fifo"); + gk20a_err(&dev->dev, "failed to reset gk20a fifo"); goto done; } @@ -883,43 +877,43 @@ static int gk20a_pm_finalize_poweron(struct device *dev) err = gk20a_init_mm_support(g); if (err) { - gk20a_err(dev, "failed to init gk20a mm"); + gk20a_err(&dev->dev, "failed to init gk20a mm"); goto done; } err = gk20a_init_pmu_support(g); if (err) { - gk20a_err(dev, "failed to init gk20a pmu"); + gk20a_err(&dev->dev, "failed to init gk20a pmu"); goto done; } err = gk20a_init_fifo_support(g); if (err) { - gk20a_err(dev, "failed to init gk20a fifo"); + gk20a_err(&dev->dev, "failed to init gk20a fifo"); goto done; } err = gk20a_init_gr_support(g); if (err) { - gk20a_err(dev, "failed to init gk20a gr"); + gk20a_err(&dev->dev, "failed to init gk20a gr"); goto done; } err = gk20a_init_pmu_setup_hw2(g); if (err) { - gk20a_err(dev, "failed to init gk20a pmu_hw2"); + gk20a_err(&dev->dev, "failed to init gk20a pmu_hw2"); goto done; } err = gk20a_init_therm_support(g); if (err) { - gk20a_err(dev, "failed to init gk20a therm"); + gk20a_err(&dev->dev, "failed to init gk20a therm"); goto done; } err = gk20a_init_gpu_characteristics(g); if (err) { - gk20a_err(dev, "failed to init gk20a gpu characteristics"); + gk20a_err(&dev->dev, "failed to init gk20a gpu characteristics"); goto done; } @@ -1546,6 +1540,27 @@ void gk20a_busy_noresume(struct platform_device *pdev) pm_runtime_get_noresume(&pdev->dev); } +int gk20a_channel_busy(struct platform_device *pdev) +{ + int ret = 0; + + ret = gk20a_platform_channel_busy(pdev); + if (ret) + return ret; + + ret = gk20a_busy(pdev); + if (ret) + gk20a_platform_channel_idle(pdev); + + return ret; +} + +void gk20a_channel_idle(struct platform_device *pdev) +{ + gk20a_idle(pdev); + gk20a_platform_channel_idle(pdev); +} + int gk20a_busy(struct platform_device *pdev) { int ret = 0; -- cgit v1.2.2