diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-14 02:26:32 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-14 03:51:39 -0400 |
commit | 1f19ac2a0b1ad8e2a9c382efa7416b014c988949 (patch) | |
tree | eed77d3ea3529bf81194d94fbc764780ef3d3da2 | |
parent | e3d5457c7caabb77b3f1d0b09c4a63362e9b04d2 (diff) |
drm/i915: Add distinct stubs for PM hibernation phases
Currently for handling the extra hibernation phases we just call the
equivalent suspend/resume phases. In the next couple of patches, I wish
to specialise the hibernation phases to reduce the amount of work
required for handling GEM objects.
v2: There are more! Don't forget the freeze phases.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Cc: David Weinehall <david.weinehall@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1463207195-22076-1-git-send-email-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 198f79369003..816cacddbe88 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -1115,6 +1115,39 @@ static int i915_pm_resume(struct device *dev) | |||
1115 | return i915_drm_resume(drm_dev); | 1115 | return i915_drm_resume(drm_dev); |
1116 | } | 1116 | } |
1117 | 1117 | ||
1118 | /* freeze: before creating the hibernation_image */ | ||
1119 | static int i915_pm_freeze(struct device *dev) | ||
1120 | { | ||
1121 | return i915_pm_suspend(dev); | ||
1122 | } | ||
1123 | |||
1124 | static int i915_pm_freeze_late(struct device *dev) | ||
1125 | { | ||
1126 | return i915_pm_suspend_late(dev); | ||
1127 | } | ||
1128 | |||
1129 | /* thaw: called after creating the hibernation image, but before turning off. */ | ||
1130 | static int i915_pm_thaw_early(struct device *dev) | ||
1131 | { | ||
1132 | return i915_pm_resume_early(dev); | ||
1133 | } | ||
1134 | |||
1135 | static int i915_pm_thaw(struct device *dev) | ||
1136 | { | ||
1137 | return i915_pm_resume(dev); | ||
1138 | } | ||
1139 | |||
1140 | /* restore: called after loading the hibernation image. */ | ||
1141 | static int i915_pm_restore_early(struct device *dev) | ||
1142 | { | ||
1143 | return i915_pm_resume_early(dev); | ||
1144 | } | ||
1145 | |||
1146 | static int i915_pm_restore(struct device *dev) | ||
1147 | { | ||
1148 | return i915_pm_resume(dev); | ||
1149 | } | ||
1150 | |||
1118 | /* | 1151 | /* |
1119 | * Save all Gunit registers that may be lost after a D3 and a subsequent | 1152 | * Save all Gunit registers that may be lost after a D3 and a subsequent |
1120 | * S0i[R123] transition. The list of registers needing a save/restore is | 1153 | * S0i[R123] transition. The list of registers needing a save/restore is |
@@ -1669,14 +1702,14 @@ static const struct dev_pm_ops i915_pm_ops = { | |||
1669 | * @restore, @restore_early : called after rebooting and restoring the | 1702 | * @restore, @restore_early : called after rebooting and restoring the |
1670 | * hibernation image [PMSG_RESTORE] | 1703 | * hibernation image [PMSG_RESTORE] |
1671 | */ | 1704 | */ |
1672 | .freeze = i915_pm_suspend, | 1705 | .freeze = i915_pm_freeze, |
1673 | .freeze_late = i915_pm_suspend_late, | 1706 | .freeze_late = i915_pm_freeze_late, |
1674 | .thaw_early = i915_pm_resume_early, | 1707 | .thaw_early = i915_pm_thaw_early, |
1675 | .thaw = i915_pm_resume, | 1708 | .thaw = i915_pm_thaw, |
1676 | .poweroff = i915_pm_suspend, | 1709 | .poweroff = i915_pm_suspend, |
1677 | .poweroff_late = i915_pm_poweroff_late, | 1710 | .poweroff_late = i915_pm_poweroff_late, |
1678 | .restore_early = i915_pm_resume_early, | 1711 | .restore_early = i915_pm_restore_early, |
1679 | .restore = i915_pm_resume, | 1712 | .restore = i915_pm_restore, |
1680 | 1713 | ||
1681 | /* S0ix (via runtime suspend) event handlers */ | 1714 | /* S0ix (via runtime suspend) event handlers */ |
1682 | .runtime_suspend = intel_runtime_suspend, | 1715 | .runtime_suspend = intel_runtime_suspend, |