Skip to content

Commit 448406e

Browse files
committed
drm/etnaviv: avoid runtime PM usage in etnaviv_gpu_bind
Nothing in this callpath actually touches the GPU, so there is no reason to get it out of suspend state here. Only if runtime PM isn't enabled at all we must make sure to enable the clocks, so the GPU init routine can access the GPU later on. This also removes the need to guard against the state where the driver isn't fully initialized yet in the runtime PM resume handler. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
1 parent 7cb5449 commit 448406e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,13 +1743,11 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
17431743
if (ret)
17441744
goto out_workqueue;
17451745

1746-
if (IS_ENABLED(CONFIG_PM))
1747-
ret = pm_runtime_get_sync(gpu->dev);
1748-
else
1746+
if (!IS_ENABLED(CONFIG_PM)) {
17491747
ret = etnaviv_gpu_clk_enable(gpu);
1750-
if (ret < 0)
1751-
goto out_sched;
1752-
1748+
if (ret < 0)
1749+
goto out_sched;
1750+
}
17531751

17541752
gpu->drm = drm;
17551753
gpu->fence_context = dma_fence_context_alloc(1);
@@ -1761,9 +1759,6 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
17611759

17621760
priv->gpu[priv->num_gpus++] = gpu;
17631761

1764-
pm_runtime_mark_last_busy(gpu->dev);
1765-
pm_runtime_put_autosuspend(gpu->dev);
1766-
17671762
return 0;
17681763

17691764
out_sched:
@@ -1944,7 +1939,7 @@ static int etnaviv_gpu_rpm_resume(struct device *dev)
19441939
return ret;
19451940

19461941
/* Re-initialise the basic hardware state */
1947-
if (gpu->drm && gpu->initialized) {
1942+
if (gpu->initialized) {
19481943
ret = etnaviv_gpu_hw_resume(gpu);
19491944
if (ret) {
19501945
etnaviv_gpu_clk_disable(gpu);

0 commit comments

Comments
 (0)