All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4
Date: Tue, 10 Jun 2014 16:42:50 +0300	[thread overview]
Message-ID: <1402407770.7876.72.camel@intelbox> (raw)
In-Reply-To: <1401914722-17532-1-git-send-email-jbarnes@virtuousgeek.org>


[-- Attachment #1.1: Type: text/plain, Size: 4797 bytes --]

On Wed, 2014-06-04 at 13:45 -0700, Jesse Barnes wrote:
> This allows the system to enter the lowest power mode during system freeze.
> 
> v2: delete force wake timer at suspend (Imre)
> v3: add GT work suspend function (Imre)
> v4: use uncore forcewake reset (Daniel)
> 
> Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
>  drivers/gpu/drm/i915/i915_drv.h     |  1 +
>  drivers/gpu/drm/i915/intel_drv.h    |  1 +
>  drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_uncore.c |  2 +-
>  5 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 66c6ffb..7148eac 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
>  		drm_irq_uninstall(dev);
>  		dev_priv->enable_hotplug_processing = false;
>  
> -		intel_disable_gt_powersave(dev);
> +		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we
get here right after runtime resume, the deferred RC6 enabling might be
still pending and so RC6 might not be enabled.

--Imre

>  
>  		/*
>  		 * Disable CRTCs directly since we want to preserve sw state
> @@ -542,8 +542,8 @@ static int i915_drm_freeze(struct drm_device *dev)
>  
>  	i915_save_state(dev);
>  
> +	intel_uncore_forcewake_reset(dev, false);
>  	intel_opregion_fini(dev);
> -	intel_uncore_fini(dev);
>  
>  	console_lock();
>  	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index bea9ab40..89d6b47 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2084,6 +2084,7 @@ extern void intel_uncore_early_sanitize(struct drm_device *dev);
>  extern void intel_uncore_init(struct drm_device *dev);
>  extern void intel_uncore_check_errors(struct drm_device *dev);
>  extern void intel_uncore_fini(struct drm_device *dev);
> +extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
>  
>  void
>  i915_enable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index c597b0d..74fbe4d 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -957,6 +957,7 @@ void intel_init_gt_powersave(struct drm_device *dev);
>  void intel_cleanup_gt_powersave(struct drm_device *dev);
>  void intel_enable_gt_powersave(struct drm_device *dev);
>  void intel_disable_gt_powersave(struct drm_device *dev);
> +void intel_suspend_gt_powersave(struct drm_device *dev);
>  void intel_reset_gt_powersave(struct drm_device *dev);
>  void ironlake_teardown_rc6(struct drm_device *dev);
>  void gen6_update_ring_freq(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 1840d15..139eebe 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4864,6 +4864,26 @@ void intel_cleanup_gt_powersave(struct drm_device *dev)
>  		valleyview_cleanup_gt_powersave(dev);
>  }
>  
> +/**
> + * intel_suspend_gt_powersave - suspend PM work and helper threads
> + * @dev: drm device
> + *
> + * We don't want to disable RC6 or other features here, we just want
> + * to make sure any work we've queued has finished and won't bother
> + * us while we're suspended.
> + */
> +void intel_suspend_gt_powersave(struct drm_device *dev)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +
> +	/* Interrupts should be disabled already to avoid re-arming. */
> +	WARN_ON(dev->irq_enabled);
> +
> +	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> +
> +	cancel_work_sync(&dev_priv->rps.work);
> +}
> +
>  void intel_disable_gt_powersave(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 871c284..741a4e3 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -316,7 +316,7 @@ static void gen6_force_wake_timer(unsigned long arg)
>  	intel_runtime_pm_put(dev_priv);
>  }
>  
> -static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
> +void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	unsigned long irqflags;


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2014-06-10 13:42 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29 21:11 [PATCH 1/4] drm/i915: disable power wells on suspend Jesse Barnes
2014-05-29 21:11 ` [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time Jesse Barnes
2014-05-30 12:54   ` Imre Deak
2014-05-30 15:32     ` Jesse Barnes
2014-05-30 15:40       ` Chris Wilson
2014-05-30 18:20         ` Jesse Barnes
2014-06-02  8:43       ` Daniel Vetter
2014-05-30 18:33   ` [PATCH] drm/i915: leave rc6 enabled at suspend time v2 Jesse Barnes
2014-06-04 19:33     ` [PATCH] drm/i915: leave rc6 enabled at suspend time v3 Jesse Barnes
2014-06-04 20:45       ` [PATCH] drm/i915: leave rc6 enabled at suspend time v4 Jesse Barnes
2014-06-05  9:21         ` Daniel Vetter
2014-06-05 15:50           ` Jesse Barnes
2014-06-10 13:42         ` Imre Deak [this message]
2014-06-10 13:57           ` Daniel Vetter
2014-06-10 14:41             ` Imre Deak
2014-06-10 15:26               ` Daniel Vetter
2014-06-11 22:21                 ` Jesse Barnes
2014-06-11 22:24                   ` Jesse Barnes
2014-06-12 15:08                     ` Imre Deak
2014-05-30 19:00   ` [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time Kristen Carlson Accardi
2014-05-29 21:11 ` [PATCH 3/4] drm/i915: send proper opregion notifications on suspend/resume Jesse Barnes
2014-05-29 21:48   ` [PATCH 3/5] ACPI: export target system state for use by drivers Jesse Barnes
2014-05-30  2:09     ` Rafael J. Wysocki
2014-05-29 21:48   ` [PATCH 4/5] drm/i915: send proper opregion notifications on suspend/resume Jesse Barnes
2014-05-30 13:47   ` [PATCH 3/4] " Imre Deak
2014-05-30 19:08   ` Kristen Carlson Accardi
2014-05-29 21:11 ` [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume Jesse Barnes
2014-05-30 13:37   ` Imre Deak
2014-05-30 18:29     ` Jesse Barnes
2014-05-30 21:12       ` Rafael J. Wysocki
2014-05-30 21:05         ` Jesse Barnes
2014-05-30 18:32   ` [PATCH] drm/i915: make sure PC8 is enabled on suspend and disabled on resume v2 Jesse Barnes
2014-05-30 18:40     ` [PATCH] drm/i915: make sure PC8 is enabled on suspend and disabled on resume v3 Jesse Barnes
2014-05-30 18:48       ` [PATCH] drm/i915: make sure PC8 is enabled on suspend and disabled on resume v4 Jesse Barnes
2014-06-04 20:02         ` Imre Deak
2014-06-02  8:45   ` [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume Daniel Vetter
2014-06-02 11:37     ` Imre Deak
2014-06-02 15:32       ` Daniel Vetter
2014-06-02 15:57         ` Imre Deak
2014-06-02 16:05           ` Daniel Vetter
2014-05-30 12:48 ` [PATCH 1/4] drm/i915: disable power wells on suspend Imre Deak
2014-05-30 18:59   ` Kristen Carlson Accardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402407770.7876.72.camel@intelbox \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.