public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: vlv: init only needed state during early power well enabling
Date: Wed, 30 Apr 2014 09:55:48 +0200	[thread overview]
Message-ID: <20140430075548.GD20800@phenom.ffwll.local> (raw)
In-Reply-To: <1398421145-17392-1-git-send-email-imre.deak@intel.com>

On Fri, Apr 25, 2014 at 01:19:05PM +0300, Imre Deak wrote:
> During the initial power well enabling on the driver init/resume path
> we can avoid initialzing part of the HW/SW state that will be
> initialized anyway by the subsequent init/resume code. For some steps
> like HPD initialization this redundancy is not only an overhead but an
> actual problem, since they can't be run this early in the overall init
> sequence.
> 
> Add a flag marking the init phase and skip reinitialzing state that is
> not strictly necessary based on that.
> 
> This is also needed by the upcoming HPD init restructuring by Thierry
> and Daniel.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Not too happy with the layering violation. But we've discussed this
extensively on irc, and there doesn't seem to be anything less ugly
available.

Queued for -next, thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_drv.h |  1 +
>  drivers/gpu/drm/i915/intel_pm.c | 14 ++++++++++----
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 7d6acb4..b589fc0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -929,6 +929,7 @@ struct i915_power_domains {
>  	 * time are on. They are kept on until after the first modeset.
>  	 */
>  	bool init_power_on;
> +	bool initializing;
>  	int power_well_count;
>  
>  	struct mutex lock;
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 75c1c76..34b689f 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5622,11 +5622,13 @@ static void vlv_display_power_well_enable(struct drm_i915_private *dev_priv,
>  	spin_unlock_irq(&dev_priv->irq_lock);
>  
>  	/*
> -	 * During driver initialization we need to defer enabling hotplug
> -	 * processing until fbdev is set up.
> +	 * During driver initialization/resume we can avoid restoring the
> +	 * part of the HW/SW state that will be inited anyway explicitly.
>  	 */
> -	if (dev_priv->enable_hotplug_processing)
> -		intel_hpd_init(dev_priv->dev);
> +	if (dev_priv->power_domains.initializing)
> +		return;
> +
> +	intel_hpd_init(dev_priv->dev);
>  
>  	i915_redisable_vga_power_on(dev_priv->dev);
>  }
> @@ -5990,9 +5992,13 @@ static void intel_power_domains_resume(struct drm_i915_private *dev_priv)
>  
>  void intel_power_domains_init_hw(struct drm_i915_private *dev_priv)
>  {
> +	struct i915_power_domains *power_domains = &dev_priv->power_domains;
> +
> +	power_domains->initializing = true;
>  	/* For now, we need the power well to be always enabled. */
>  	intel_display_set_init_power(dev_priv, true);
>  	intel_power_domains_resume(dev_priv);
> +	power_domains->initializing = false;
>  }
>  
>  void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv)
> -- 
> 1.8.4
> 
> _______________________________________________
> 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

      reply	other threads:[~2014-04-30  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25 10:19 [PATCH] drm/i915: vlv: init only needed state during early power well enabling Imre Deak
2014-04-30  7:55 ` Daniel Vetter [this message]

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=20140430075548.GD20800@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.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