public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Ander Conselvan De Oliveira <conselvan2@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: Call the sync_hw hook for power wells without a domain
Date: Thu, 16 Feb 2017 16:55:36 +0200	[thread overview]
Message-ID: <20170216145536.GG18432@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <1487237461.3185.4.camel@gmail.com>

On Thu, Feb 16, 2017 at 11:31:01AM +0200, Ander Conselvan De Oliveira wrote:
> On Wed, 2017-02-15 at 13:59 +0200, Imre Deak wrote:
> > So far the sync_hw hook wasn't called for power wells not belonging to
> > any power domain, that is the GEN9 PW1 and MISC_IO power wells. This
> > wasn't a problem so far since the goal of the sync_hw hook - to clear
> > the corresponding BIOS request bit - was guaranteed by clearing the
> > whole BIOS request register elsewhere. This will change with the next
> > patch, so fix up the inconsistency.
> > 
> > Cc: Ander Conselvan de Oliveira <conselvan2@gmail.com>
> > Cc: David Weinehall <david.weinehall@linux.intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_runtime_pm.c | 34 +++++++++++++++++++++------------
> >  1 file changed, 22 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > index 0f64bc1..f9aff26 100644
> > --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > @@ -49,17 +49,24 @@
> >   * present for a given platform.
> >   */
> >  
> > -#define for_each_power_well(i, power_well, domain_mask, power_domains)	\
> > -	for (i = 0;							\
> > -	     i < (power_domains)->power_well_count &&			\
> > +#define for_each_power_well(i, power_well)				\
> > +	for ((i) = 0;							\
> > +	     (i) < (power_domains)->power_well_count &&			\
> 
> This now requires that power_domains is in scope to work properly. Would it make
> sense to still pass that as argument to the macro or, alternatively, pass
> dev_priv?

Yes, that was a copy/paste fail. Yep, dev_priv simplifies things, will
change to that.

> Could probably nuke the i parameter too, since no caller uses it?

Ok. I also moved these to i915_dev.h. I'll resend the patchset after a
trybot round.

> 
> But either way,
> 
> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>

Thanks,
Imre

> 
> >  		 ((power_well) = &(power_domains)->power_wells[i]);	\
> > -	     i++)							\
> > +	     (i)++)
> > +
> > +#define for_each_power_well_rev(i, power_well)				 \
> > +	for ((i) = (power_domains)->power_well_count - 1;                  \
> > +	     (i) >= 0 && ((power_well) = &(power_domains)->power_wells[i]);\
> > +	     (i)--)
> > +
> > +#define for_each_power_domain_well(i, power_well, domain_mask, power_domains) \
> > +	for_each_power_well(i, power_well)				\
> >  		for_each_if ((power_well)->domains & (domain_mask))
> >  
> > -#define for_each_power_well_rev(i, power_well, domain_mask, power_domains) \
> > -	for (i = (power_domains)->power_well_count - 1;			 \
> > -	     i >= 0 && ((power_well) = &(power_domains)->power_wells[i]);\
> > -	     i--)							 \
> > +#define for_each_power_domain_well_rev(i, power_well, domain_mask,	\
> > +				       power_domains)			\
> > +	for_each_power_well_rev(i, power_well)				\
> >  		for_each_if ((power_well)->domains & (domain_mask))
> >  
> >  bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
> > @@ -210,7 +217,8 @@ bool __intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
> >  
> >  	is_enabled = true;
> >  
> > -	for_each_power_well_rev(i, power_well, BIT_ULL(domain), power_domains) {
> > +	for_each_power_domain_well_rev(i, power_well, BIT_ULL(domain),
> > +				       power_domains) {
> >  		if (power_well->always_on)
> >  			continue;
> >  
> > @@ -1665,7 +1673,8 @@ __intel_display_power_get_domain(struct drm_i915_private *dev_priv,
> >  	struct i915_power_well *power_well;
> >  	int i;
> >  
> > -	for_each_power_well(i, power_well, BIT_ULL(domain), power_domains)
> > +	for_each_power_domain_well(i, power_well, BIT_ULL(domain),
> > +				   power_domains)
> >  		intel_power_well_get(dev_priv, power_well);
> >  
> >  	power_domains->domain_use_count[domain]++;
> > @@ -1760,7 +1769,8 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
> >  	     intel_display_power_domain_str(domain));
> >  	power_domains->domain_use_count[domain]--;
> >  
> > -	for_each_power_well_rev(i, power_well, BIT_ULL(domain), power_domains)
> > +	for_each_power_domain_well_rev(i, power_well, BIT_ULL(domain),
> > +				       power_domains)
> >  		intel_power_well_put(dev_priv, power_well);
> >  
> >  	mutex_unlock(&power_domains->lock);
> > @@ -2427,7 +2437,7 @@ static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
> >  	int i;
> >  
> >  	mutex_lock(&power_domains->lock);
> > -	for_each_power_well(i, power_well, POWER_DOMAIN_MASK, power_domains) {
> > +	for_each_power_well(i, power_well) {
> >  		power_well->ops->sync_hw(dev_priv, power_well);
> >  		power_well->hw_enabled = power_well->ops->is_enabled(dev_priv,
> >  								     power_well);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-16 14:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 11:59 [PATCH 0/4] drm/i915: Fix clearing of BIOS power well requests Imre Deak
2017-02-15 11:59 ` [PATCH 1/4] drm/i915: Remove redundant toggling from the power well sync_hw hooks Imre Deak
2017-02-16  9:13   ` Ander Conselvan De Oliveira
2017-02-15 11:59 ` [PATCH 2/4] drm/i915: Call the sync_hw hook for power wells without a domain Imre Deak
2017-02-16  9:31   ` Ander Conselvan De Oliveira
2017-02-16 14:55     ` Imre Deak [this message]
2017-02-15 11:59 ` [PATCH 3/4] drm/i915/gen9: Fix clearing of the BIOS power well request register Imre Deak
2017-02-16  9:43   ` Ander Conselvan De Oliveira
2017-02-16 15:13     ` Imre Deak
2017-02-15 11:59 ` [PATCH 4/4] drm/i915: Preserve the state of power wells not explicitly enabled Imre Deak
2017-02-16 12:18   ` Ander Conselvan De Oliveira
2017-02-16 12:41     ` Imre Deak
2017-02-15 14:52 ` ✓ Fi.CI.BAT: success for drm/i915: Fix clearing of BIOS power well requests Patchwork

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=20170216145536.GG18432@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=conselvan2@gmail.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