summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vc4/vc4_v3d.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-11-05 01:58:38 +0300
committerEric Anholt <eric@anholt.net>2016-11-05 02:12:35 +0300
commit3a62234680d86efa0239665ed8a0e908f1aef147 (patch)
treeda22f4c7c9dac4eb4afb78f6f2cb2ab05771556a /drivers/gpu/drm/vc4/vc4_v3d.c
parent7154d76fedf549607afbc0d13db9aaf02da5cebf (diff)
downloadlinux-3a62234680d86efa0239665ed8a0e908f1aef147.tar.xz
drm/vc4: Use runtime autosuspend to avoid thrashing V3D power state.
The pm_runtime_put() we were using immediately released power on the device, which meant that we were generally turning the device off and on once per frame. In many profiles I've looked at, that added up to about 1% of CPU time, but this could get worse in the case of frequent rendering and readback (as may happen in X rendering). By keeping the device on until we've been idle for a couple of frames, we drop the overhead of runtime PM down to sub-.1%. Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_v3d.c')
-rw-r--r--drivers/gpu/drm/vc4/vc4_v3d.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index e6d3c6028341..7cc346ad9b0b 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -222,6 +222,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data)
return ret;
}
+ pm_runtime_use_autosuspend(dev);
+ pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */
pm_runtime_enable(dev);
return 0;