aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/etnaviv
diff options
context:
space:
mode:
authorGravatar Lucas Stach <l.stach@pengutronix.de> 2023-06-07 15:02:20 +0200
committerGravatar Lucas Stach <l.stach@pengutronix.de> 2023-07-17 11:32:21 +0200
commit448406eaf6c2a1f9941af1027dc610fd7461f0dc (patch)
tree66edf83fcc5ec4ab2880fcb609986f269cf4d119 /drivers/gpu/drm/etnaviv
parentdrm/etnaviv: make clock handling symetric between runtime resume and suspend (diff)
downloadlinux-448406eaf6c2a1f9941af1027dc610fd7461f0dc.tar.gz
linux-448406eaf6c2a1f9941af1027dc610fd7461f0dc.tar.bz2
linux-448406eaf6c2a1f9941af1027dc610fd7461f0dc.zip
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>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 73ce95df4cc0..d3187ca9e1a3 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1743,13 +1743,11 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
if (ret)
goto out_workqueue;
- if (IS_ENABLED(CONFIG_PM))
- ret = pm_runtime_get_sync(gpu->dev);
- else
+ if (!IS_ENABLED(CONFIG_PM)) {
ret = etnaviv_gpu_clk_enable(gpu);
- if (ret < 0)
- goto out_sched;
-
+ if (ret < 0)
+ goto out_sched;
+ }
gpu->drm = drm;
gpu->fence_context = dma_fence_context_alloc(1);
@@ -1761,9 +1759,6 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
priv->gpu[priv->num_gpus++] = gpu;
- pm_runtime_mark_last_busy(gpu->dev);
- pm_runtime_put_autosuspend(gpu->dev);
-
return 0;
out_sched:
@@ -1944,7 +1939,7 @@ static int etnaviv_gpu_rpm_resume(struct device *dev)
return ret;
/* Re-initialise the basic hardware state */
- if (gpu->drm && gpu->initialized) {
+ if (gpu->initialized) {
ret = etnaviv_gpu_hw_resume(gpu);
if (ret) {
etnaviv_gpu_clk_disable(gpu);