[Intel-gfx] [PATCH 1/4] drm/i915: Add distinct stubs for PM hibernation phases

Imre Deak imre.deak at intel.com
Thu May 12 11:52:55 UTC 2016


On Thu, 2016-05-12 at 12:41 +0100, Chris Wilson wrote:
> 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.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Imre Deak <imre.deak at intel.com>
> Cc: David Weinehall <david.weinehall at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 34 ++++++++++++++++++++++++++++++----
>  1 file changed, 30 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 5ae79601335c..4c17e3e8d0ab 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1115,6 +1115,32 @@ static int i915_pm_resume(struct device *dev)
>  	return i915_drm_resume(drm_dev);
>  }
>  
> +/* thaw and thaw_early are called after creating the hibernation image,
> + * but before turning off.
> + */

We have these explained for all the phases already around i915_pm_ops.

Also would be good to know if you chose restore over freeze to set the
object domains. I don't see a practical problem with it, but freeze
would be a more proper place logically.

> +static int i915_pm_thaw_early(struct device *dev)
> +{
> +	return i915_pm_resume_early(dev);
> +}
> +
> +static int i915_pm_thaw(struct device *dev)
> +{
> +	return i915_pm_resume(dev);
> +}
> +
> +/* restore and restore_early are called when booting from the hibernation
> + * image.
> + */
> +static int i915_pm_restore_early(struct device *dev)
> +{
> +	return i915_pm_resume_early(dev);
> +}
> +
> +static int i915_pm_restore(struct device *dev)
> +{
> +	return i915_pm_resume(dev);
> +}
> +
>  /*
>   * Save all Gunit registers that may be lost after a D3 and a subsequent
>   * S0i[R123] transition. The list of registers needing a save/restore is
> @@ -1671,12 +1697,12 @@ static const struct dev_pm_ops i915_pm_ops = {
>  	 */
>  	.freeze = i915_pm_suspend,
>  	.freeze_late = i915_pm_suspend_late,
> -	.thaw_early = i915_pm_resume_early,
> -	.thaw = i915_pm_resume,
> +	.thaw_early = i915_pm_thaw_early,
> +	.thaw = i915_pm_thaw,
>  	.poweroff = i915_pm_suspend,
>  	.poweroff_late = i915_pm_poweroff_late,
> -	.restore_early = i915_pm_resume_early,
> -	.restore = i915_pm_resume,
> +	.restore_early = i915_pm_restore_early,
> +	.restore = i915_pm_restore,
>  
>  	/* S0ix (via runtime suspend) event handlers */
>  	.runtime_suspend = intel_runtime_suspend,


More information about the Intel-gfx mailing list