drm/vc4: Use runtime autosuspend to avoid thrashing V3D power state.
authorEric Anholt <eric@anholt.net>
Fri, 4 Nov 2016 22:58:38 +0000 (15:58 -0700)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 9 Mar 2017 17:52:37 +0000 (17:52 +0000)
commit0b68e6bfd1f2a687eb845462c8bdb3e81e8622e4
tree23d6ef41f8a6f210bfe4a65e840f7969ebf04ec1
parentb27b57f21ab839bcf5d4d4c7599765c8afa55fee
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>
(cherry picked from commit 3a62234680d86efa0239665ed8a0e908f1aef147)
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vc4/vc4_gem.c
drivers/gpu/drm/vc4/vc4_v3d.c