diff options
author | Imre Deak <[email protected]> | 2016-02-17 14:17:42 +0200 |
---|---|---|
committer | Jani Nikula <[email protected]> | 2016-02-22 17:44:35 +0200 |
commit | 5af9a454769bb5528ba1e5268e5649414ae832bd (patch) | |
tree | a654fc2620b275c07eecaf39ebbf938232e9fad9 /lib/mpi/mpiutil.c | |
parent | 81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff) |
drm/i915: Add helper to get a display power ref if it was already enabled
We have many places in the code where we check if a given display power
domain is enabled and if so access registers backed by this power
domain. We assumed that some modeset lock will prevent the power
reference from vanishing in the middle of the HW access, but this
assumption doesn't always hold. In such cases we get either the wakeref
not held, or an unclaimed register access error message. To fix this in
a future-proof way that's independent of other locks wrap any such
access with a get_ref_if_enabled()/put_ref() pair.
Kudos to Ville and Joonas for the ideas of this new interface.
v2:
- init the power_domains ptr when declaring it everywhere (Joonas)
v3:
- don't report the device to be powered if runtime PM is disabled
CC: Mika Kuoppala <[email protected]>
CC: Chris Wilson <[email protected]>
CC: Joonas Lahtinen <[email protected]>
CC: Ville Syrjälä <[email protected]>
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Joonas Lahtinen <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 09731280028ce03e6a27e1998137f1775a2839f3)
Signed-off-by: Jani Nikula <[email protected]>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions