Commit 448406ea authored by Lucas Stach's avatar Lucas Stach

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: default avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarChristian Gmeiner <cgmeiner@igalia.com>
parent 7cb54494
...@@ -1743,13 +1743,11 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master, ...@@ -1743,13 +1743,11 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
if (ret) if (ret)
goto out_workqueue; goto out_workqueue;
if (IS_ENABLED(CONFIG_PM)) if (!IS_ENABLED(CONFIG_PM)) {
ret = pm_runtime_get_sync(gpu->dev);
else
ret = etnaviv_gpu_clk_enable(gpu); ret = etnaviv_gpu_clk_enable(gpu);
if (ret < 0) if (ret < 0)
goto out_sched; goto out_sched;
}
gpu->drm = drm; gpu->drm = drm;
gpu->fence_context = dma_fence_context_alloc(1); gpu->fence_context = dma_fence_context_alloc(1);
...@@ -1761,9 +1759,6 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master, ...@@ -1761,9 +1759,6 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
priv->gpu[priv->num_gpus++] = gpu; priv->gpu[priv->num_gpus++] = gpu;
pm_runtime_mark_last_busy(gpu->dev);
pm_runtime_put_autosuspend(gpu->dev);
return 0; return 0;
out_sched: out_sched:
...@@ -1944,7 +1939,7 @@ static int etnaviv_gpu_rpm_resume(struct device *dev) ...@@ -1944,7 +1939,7 @@ static int etnaviv_gpu_rpm_resume(struct device *dev)
return ret; return ret;
/* Re-initialise the basic hardware state */ /* Re-initialise the basic hardware state */
if (gpu->drm && gpu->initialized) { if (gpu->initialized) {
ret = etnaviv_gpu_hw_resume(gpu); ret = etnaviv_gpu_hw_resume(gpu);
if (ret) { if (ret) {
etnaviv_gpu_clk_disable(gpu); etnaviv_gpu_clk_disable(gpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment