public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 5/15] drm/i915: take init power domain for sysfs/debugfs entries where needed
Date: Wed, 09 Apr 2014 19:30:48 +0300	[thread overview]
Message-ID: <1397061048.2552.73.camel@ideak-mobl> (raw)
In-Reply-To: <20140409160614.GR18465@intel.com>

On Wed, 2014-04-09 at 19:06 +0300, Ville Syrjälä wrote:
> On Wed, Apr 09, 2014 at 05:21:47PM +0300, Imre Deak wrote:
> > On Wed, 2014-04-09 at 16:15 +0200, Daniel Vetter wrote:
> > > On Tue, Apr 08, 2014 at 10:34:41PM +0300, Imre Deak wrote:
> > > > v2:
> > > > - make it actually compile, I managed to send the wrong version as v1
> > > >   somehow
> > > > 
> > > > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > > 
> > > Usually if we just want the device to be out of D3 we just use
> > > intel_runtime_pm_get/put. On a quick look it seems like that's enough for
> > > these places here, too?
> > 
> > For drpc yes, but for the others we need the DPIO power wells up too. I
> > got for all VLV case the power well ref for simplicity, I can change it
> > to an RPM ref for drpc, if that's ok.
> 
> The dpio_info file would need DPIO wells up. However I think we should
> just kill that file. It just dumps a small subset of the registers w/o
> decoding anything, and we can get more extensive dumps w/ igt, so I
> don't see the point of this file.

Agreed, there are at least the intel_dpio_* tools and other similar ones
for reading registers in other address spaces, so this file looks a bit
arbitrary. I can remove it if no one objects.

> The error handler should already be able to deal with the wells being
> down no?

i915_handle_error can be called from IRQ context, so it can't get power
domain refs. On an interrupt error detection path this isn't a problem
since there the HW is in D0, but here that's not guaranteed.

I took the separate power domain refs in the error _capture_ function
since that's a deferred work. There again D0 is not guaranteed, for
example we could reset the HW, schedule the capture work, drop the last
RPM ref and only then start running the capture function.

> The gt_cutr_freq file just talks to the punit so no need for any power
> wells either AFAICS.

Hm right, this one needs only D0 as drpc. I'll change this too.

--Imre 

> 
> > 
> > --Imre
> > 
> > > -Daniel
> > > 
> > > > ---
> > > >  drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++++++--
> > > >  drivers/gpu/drm/i915/i915_sysfs.c   |  4 ++++
> > > >  2 files changed, 20 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > > > index 02f1b39..ac91a44 100644
> > > > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > > > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > > > @@ -1239,9 +1239,13 @@ static int vlv_drpc_info(struct seq_file *m)
> > > >  	u32 rpmodectl1, rcctl1;
> > > >  	unsigned fw_rendercount = 0, fw_mediacount = 0;
> > > >  
> > > > +	intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
> > > > +
> > > >  	rpmodectl1 = I915_READ(GEN6_RP_CONTROL);
> > > >  	rcctl1 = I915_READ(GEN6_RC_CONTROL);
> > > >  
> > > > +	intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
> > > > +
> > > >  	seq_printf(m, "Video Turbo Mode: %s\n",
> > > >  		   yesno(rpmodectl1 & GEN6_RP_MEDIA_TURBO));
> > > >  	seq_printf(m, "Turbo enabled: %s\n",
> > > > @@ -1916,9 +1920,11 @@ static int i915_dpio_info(struct seq_file *m, void *data)
> > > >  		return 0;
> > > >  	}
> > > >  
> > > > +	intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
> > > > +
> > > >  	ret = mutex_lock_interruptible(&dev_priv->dpio_lock);
> > > >  	if (ret)
> > > > -		return ret;
> > > > +		goto out;
> > > >  
> > > >  	seq_printf(m, "DPIO_CTL: 0x%08x\n", I915_READ(DPIO_CTL));
> > > >  
> > > > @@ -1946,8 +1952,10 @@ static int i915_dpio_info(struct seq_file *m, void *data)
> > > >  		   vlv_dpio_read(dev_priv, PIPE_A, VLV_CMN_DW0));
> > > >  
> > > >  	mutex_unlock(&dev_priv->dpio_lock);
> > > > +out:
> > > > +	intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
> > > >  
> > > > -	return 0;
> > > > +	return ret;
> > > >  }
> > > >  
> > > >  static int i915_llc(struct seq_file *m, void *data)
> > > > @@ -3304,9 +3312,15 @@ static int
> > > >  i915_wedged_set(void *data, u64 val)
> > > >  {
> > > >  	struct drm_device *dev = data;
> > > > +	struct drm_i915_private *dev_priv = dev->dev_private;
> > > > +
> > > > +	intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
> > > >  
> > > >  	i915_handle_error(dev, val,
> > > >  			  "Manually setting wedged to %llu", val);
> > > > +
> > > > +	intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
> > > > +
> > > >  	return 0;
> > > >  }
> > > >  
> > > > diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> > > > index 9c57029..552c4ed 100644
> > > > --- a/drivers/gpu/drm/i915/i915_sysfs.c
> > > > +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> > > > @@ -263,6 +263,8 @@ static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
> > > >  
> > > >  	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> > > >  
> > > > +	intel_display_power_get(dev_priv, POWER_DOMAIN_INIT);
> > > > +
> > > >  	mutex_lock(&dev_priv->rps.hw_lock);
> > > >  	if (IS_VALLEYVIEW(dev_priv->dev)) {
> > > >  		u32 freq;
> > > > @@ -273,6 +275,8 @@ static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
> > > >  	}
> > > >  	mutex_unlock(&dev_priv->rps.hw_lock);
> > > >  
> > > > +	intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
> > > > +
> > > >  	return snprintf(buf, PAGE_SIZE, "%d\n", ret);
> > > >  }
> > > >  
> > > > -- 
> > > > 1.8.3.2
> > > > 
> > > > _______________________________________________
> > > > Intel-gfx mailing list
> > > > Intel-gfx@lists.freedesktop.org
> > > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > > 
> > 
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 


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

  reply	other threads:[~2014-04-09 16:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 16:57 [PATCH 00/15] vlv: add support for RPM Imre Deak
2014-04-08 16:57 ` [PATCH 01/15] drm/i915: vlv: clean up GTLC wake control/status register macros Imre Deak
2014-04-16 21:08   ` Rodrigo Vivi
2014-04-16 21:20     ` Imre Deak
2014-04-08 16:57 ` [PATCH 02/15] drm/i915: vlv: clear master interrupt flag when disabling interrupts Imre Deak
2014-04-08 16:57 ` [PATCH 03/15] drm/i915: vlv: add RC6 residency counters Imre Deak
2014-04-08 16:57 ` [PATCH 04/15] drm/i915: fix rc6 status debug print Imre Deak
2014-04-08 16:57 ` [PATCH 05/15] drm/i915: take init power domain for sysfs/debugfs entries where needed Imre Deak
2014-04-08 19:34   ` [PATCH v2 5/15] " Imre Deak
2014-04-09 14:15     ` Daniel Vetter
2014-04-09 14:21       ` Paulo Zanoni
2014-04-09 14:21       ` Imre Deak
2014-04-09 16:06         ` Ville Syrjälä
2014-04-09 16:30           ` Imre Deak [this message]
2014-04-09 16:35           ` Daniel Vetter
2014-04-08 16:57 ` [PATCH 06/15] drm/i915: get init power domain for gpu error state capture Imre Deak
2014-04-09 14:17   ` Daniel Vetter
2014-04-08 16:57 ` [PATCH 07/15] drm/i915: vlv: check port power domain instead of only D0 for eDP VDD on Imre Deak
2014-04-09 14:32   ` Paulo Zanoni
2014-04-09 14:50     ` Imre Deak
2014-04-08 16:57 ` [PATCH 08/15] drm/i915: vlv: setup RPS min/max frequencies once during init time Imre Deak
2014-04-08 16:57 ` [PATCH 09/15] drm/i915: vlv: factor out vlv_force_gfx_clock Imre Deak
2014-04-08 16:57 ` [PATCH 10/15] drm/i915: disable runtime PM until delayed RPS/RC6 enabling completes Imre Deak
2014-04-09 14:19   ` Daniel Vetter
2014-04-09 14:38     ` Imre Deak
2014-04-09 16:38       ` Daniel Vetter
2014-04-09 16:43         ` Daniel Vetter
2014-04-08 16:57 ` [PATCH 11/15] drm/i915: vlv: disable RPM if RC6 is not enabled Imre Deak
2014-04-09 14:36   ` Paulo Zanoni
2014-04-09 14:59     ` Imre Deak
2014-04-09 16:41       ` Daniel Vetter
2014-04-08 16:57 ` [PATCH 12/15] drm/i915: add various missing GTI/Gunit register definitions Imre Deak
2014-04-08 16:57 ` [PATCH 13/15] drm/i915: vlv: add gunit s0ix save/restore helpers Imre Deak
2014-04-08 16:57 ` [PATCH 14/15] drm/i915: vlv: add runtime PM support Imre Deak
2014-04-09 14:22   ` Daniel Vetter
2014-04-09 15:43     ` Imre Deak
2014-04-09 16:45       ` Daniel Vetter
2014-04-09 16:40   ` Paulo Zanoni
2014-04-09 16:47     ` Imre Deak
2014-04-08 16:57 ` [PATCH 15/15] drm/i915: vlv: enable RPM Imre Deak

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=1397061048.2552.73.camel@ideak-mobl \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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