public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: don't rewrite the GTT on resume v2
Date: Tue, 30 Oct 2012 18:59:31 +0100	[thread overview]
Message-ID: <20121030175931.GA5755@phenom.ffwll.local> (raw)
In-Reply-To: <1351271318-3148-3-git-send-email-jbarnes@virtuousgeek.org>

On Fri, Oct 26, 2012 at 10:08:38AM -0700, Jesse Barnes wrote:
> The BIOS shouldn't be touching this memory across suspend/resume, so
> just leave it alone.  This saves us ~50ms on resume on my T420.
> 
> v2: change gtt restore default on pre-gen4 (Chris)
>     move needs_gtt_restore flag into dev_priv
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

I've just realized: GGTT PTEs are stored in stolen mem, and hence not
restored accross S4.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_dma.c |    4 ++++
>  drivers/gpu/drm/i915/i915_drv.c |    3 ++-
>  drivers/gpu/drm/i915/i915_drv.h |    2 ++
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index b5977b4..c027266 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1339,6 +1339,10 @@ static int i915_load_modeset_init(struct drm_device *dev)
>  	/* FIXME: do pre/post-mode set stuff in core KMS code */
>  	dev->vblank_disable_allowed = 1;
>  
> +	/* Gen4+ should have saner BIOSes (we hope) */
> +	if (INTEL_INFO(dev)->gen < 4)
> +		dev_priv->needs_gtt_restore = true;
> +
>  	ret = intel_fbdev_init(dev);
>  	if (ret)
>  		goto cleanup_irq;
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 4d858a9..be9f47d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -540,7 +540,8 @@ static int i915_drm_thaw(struct drm_device *dev)
>  
>  	intel_gt_reset(dev);
>  
> -	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
> +	if (drm_core_check_feature(dev, DRIVER_MODESET) &&
> +	    dev_priv->needs_gtt_restore) {
>  		mutex_lock(&dev->struct_mutex);
>  		i915_gem_restore_gtt_mappings(dev);
>  		mutex_unlock(&dev->struct_mutex);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 1e84a59..a38eba8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -873,6 +873,8 @@ typedef struct drm_i915_private {
>  
>  	struct delayed_work gen6_power_work;
>  
> +	bool needs_gtt_restore;
> +
>  	enum no_fbc_reason no_fbc_reason;
>  
>  	struct drm_mm_node *compressed_fb;
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  parent reply	other threads:[~2012-10-30 17:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 17:08 [PATCH 1/3] drm/i915: don't block resume on fb console resume Jesse Barnes
2012-10-26 17:08 ` [PATCH 2/3] drm/i915: put ring frequency and turbo setup into a work queue v2 Jesse Barnes
2012-10-30 16:53   ` Rodrigo Vivi
2012-10-30 16:58     ` Jesse Barnes
2012-10-30 17:03       ` Rodrigo Vivi
2012-10-30 17:09         ` Daniel Vetter
2012-10-30 17:17   ` Daniel Vetter
2012-10-31 20:44     ` Jesse Barnes
2012-10-26 17:08 ` [PATCH 3/3] drm/i915: don't rewrite the GTT on resume v2 Jesse Barnes
2012-10-28 10:47   ` Chris Wilson
2012-10-30 17:59   ` Daniel Vetter [this message]
2012-10-30 21:32     ` Chris Wilson
2012-10-30 21:58       ` Daniel Vetter
2012-10-30 23:25       ` Jesse Barnes
2012-10-30 16:58 ` [PATCH 1/3] drm/i915: don't block resume on fb console resume Rodrigo Vivi

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=20121030175931.GA5755@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox