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 12/19] drm/i915: sanitize PUNIT register macro definitions
Date: Mon, 24 Feb 2014 15:12:47 +0200	[thread overview]
Message-ID: <1393247567.13131.80.camel@intelbox> (raw)
In-Reply-To: <20140220114614.5d49e141@jbarnes-desktop>


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

On Thu, 2014-02-20 at 11:46 -0800, Jesse Barnes wrote:
> On Tue, 18 Feb 2014 00:02:13 +0200
> Imre Deak <imre.deak@intel.com> wrote:
> 
> > In the upcoming patches we'll need to access the rest of the fields in
> > the punit power gating register, so prepare for that.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_reg.h     | 29 +++++++++++++++++++++++------
> >  drivers/gpu/drm/i915/intel_uncore.c |  4 +++-
> >  2 files changed, 26 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index 2f564ce..5a700e9 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -377,14 +377,31 @@
> >  #define   DSPFREQSTAT_MASK			(0x3 << DSPFREQSTAT_SHIFT)
> >  #define   DSPFREQGUAR_SHIFT			14
> >  #define   DSPFREQGUAR_MASK			(0x3 << DSPFREQGUAR_SHIFT)
> > +
> > +enum punit_power_well {
> > +	PUNIT_POWER_WELL_RENDER			= 0,
> > +	PUNIT_POWER_WELL_MEDIA			= 1,
> > +	PUNIT_POWER_WELL_DISP2D			= 3,
> > +	PUNIT_POWER_WELL_DPIO_CMN_BC		= 5,
> > +	PUNIT_POWER_WELL_DPIO_TX_B_LANES_01	= 6,
> > +	PUNIT_POWER_WELL_DPIO_TX_B_LANES_23	= 7,
> > +	PUNIT_POWER_WELL_DPIO_TX_C_LANES_01	= 8,
> > +	PUNIT_POWER_WELL_DPIO_TX_C_LANES_23	= 9,
> > +	PUNIT_POWER_WELL_DPIO_RX0		= 10,
> > +	PUNIT_POWER_WELL_DPIO_RX1		= 11,
> > +	PUNIT_POWER_WELL_DPIO_RX2		= 12,
> > +	PUNIT_POWER_WELL_DPIO_RX3		= 13,
> > +
> > +	PUNIT_POWER_WELL_NUM,
> > +};
> > +
> >  #define PUNIT_REG_PWRGT_CTRL			0x60
> >  #define PUNIT_REG_PWRGT_STATUS			0x61
> > -#define	  PUNIT_CLK_GATE			1
> > -#define	  PUNIT_PWR_RESET			2
> > -#define	  PUNIT_PWR_GATE			3
> > -#define	  RENDER_PWRGT				(PUNIT_PWR_GATE << 0)
> > -#define	  MEDIA_PWRGT				(PUNIT_PWR_GATE << 2)
> > -#define	  DISP2D_PWRGT				(PUNIT_PWR_GATE << 6)
> > +#define   PUNIT_PWRGT_MASK(power_well)		(3 << ((power_well) * 2))
> > +#define   PUNIT_PWRGT_PWR_ON(power_well)	(0 << ((power_well) * 2))
> > +#define   PUNIT_PWRGT_CLK_GATE(power_well)	(1 << ((power_well) * 2))
> > +#define   PUNIT_PWRGT_RESET(power_well)		(2 << ((power_well) * 2))
> > +#define   PUNIT_PWRGT_PWR_GATE(power_well)	(3 << ((power_well) * 2))
> >  
> >  #define PUNIT_REG_GPU_LFM			0xd3
> >  #define PUNIT_REG_GPU_FREQ_REQ			0xd4
> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > index c628414..4aab7c2 100644
> > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > @@ -354,7 +354,9 @@ void intel_uncore_sanitize(struct drm_device *dev)
> >  		mutex_lock(&dev_priv->rps.hw_lock);
> >  		reg_val = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_STATUS);
> >  
> > -		if (reg_val & (RENDER_PWRGT | MEDIA_PWRGT | DISP2D_PWRGT))
> > +		if (reg_val & (PUNIT_PWRGT_PWR_GATE(PUNIT_POWER_WELL_RENDER) |
> > +			       PUNIT_PWRGT_PWR_GATE(PUNIT_POWER_WELL_MEDIA) |
> > +			       PUNIT_PWRGT_PWR_GATE(PUNIT_POWER_WELL_DISP2D)))
> >  			vlv_punit_write(dev_priv, PUNIT_REG_PWRGT_CTRL, 0x0);
> >  
> >  		mutex_unlock(&dev_priv->rps.hw_lock);
> 
> I'd like to see a doc reference here, as I never remember which one has
> these bits...

It's the PUNIT 0.8 HAS, will add a comment about it here.

>   Also, are you sure about the RX bits?  The
> PUNIT_HAS_0.8 doc says only subsystems 10-11 cover RX, maybe in a ganged
> config?

You're right, I overlooked this, there are only 2 RX lanes. We don't use
them atm, but we'll still need to disable those wells. I'll fix this up.

--Imre

> 
> Otherwise:
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> 


[-- 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

  reply	other threads:[~2014-02-24 13:12 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17 22:02 [PATCH 00/19] drm/i915: vlv power domains support Imre Deak
2014-02-17 22:02 ` [PATCH 01/19] drm/i915: use drm_i915_private everywhere in the power domain api Imre Deak
2014-02-20 19:16   ` Jesse Barnes
2014-02-17 22:02 ` [PATCH 02/19] drm/i915: fold in __intel_power_well_get/put functions Imre Deak
2014-02-20 19:17   ` Jesse Barnes
2014-02-20 19:44     ` Chris Wilson
2014-02-24 13:23   ` Paulo Zanoni
2014-02-24 14:07     ` Imre Deak
2014-02-17 22:02 ` [PATCH 03/19] drm/i915: move modeset_update_power_wells earlier Imre Deak
2014-02-20 19:18   ` Jesse Barnes
2014-02-17 22:02 ` [PATCH 04/19] drm/i915: move power domain macros to intel_pm.c Imre Deak
2014-02-20 19:21   ` Jesse Barnes
2014-02-24 13:38     ` Paulo Zanoni
2014-02-24 13:54       ` Imre Deak
2014-02-17 22:02 ` [PATCH 05/19] drm/i915: power domains: add power well ops Imre Deak
2014-02-20 19:26   ` Jesse Barnes
2014-02-24 11:42     ` Imre Deak
2014-02-17 22:02 ` [PATCH 06/19] drm/i915: remove power_well->always_on flag Imre Deak
2014-02-20 19:27   ` Jesse Barnes
2014-02-17 22:02 ` [PATCH 07/19] drm/i915: add port power domains Imre Deak
2014-02-20 19:31   ` Jesse Barnes
2014-02-24 11:52     ` Imre Deak
2014-03-05 10:11   ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 08/19] drm/i915: get port power domain in connector detect Imre Deak
2014-02-19 12:35   ` Ville Syrjälä
2014-02-19 12:39     ` Imre Deak
2014-02-20 19:33       ` Jesse Barnes
2014-02-24 11:56         ` Imre Deak
2014-03-05 10:15           ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 09/19] drm/i915: check port power domain when reading the encoder hw state Imre Deak
2014-02-20 19:36   ` Jesse Barnes
2014-02-24 12:53     ` Imre Deak
2014-03-05 10:21   ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 10/19] drm/i915: check pipe power domain when reading its " Imre Deak
2014-02-20 19:37   ` Jesse Barnes
2014-03-05 10:24     ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 11/19] drm/i915: vlv: keep first level vblank IRQs masked Imre Deak
2014-02-18 16:54   ` Ville Syrjälä
2014-02-17 22:02 ` [PATCH 12/19] drm/i915: sanitize PUNIT register macro definitions Imre Deak
2014-02-20 19:46   ` Jesse Barnes
2014-02-24 13:12     ` Imre Deak [this message]
2014-02-17 22:02 ` [PATCH 13/19] drm/i915: factor out reset_vblank_counter Imre Deak
2014-02-18 16:55   ` Ville Syrjälä
2014-02-17 22:02 ` [PATCH 14/19] drm/i915: switch order of power domain init wrt. irq install Imre Deak
2014-02-20 19:48   ` Jesse Barnes
2014-02-24 13:23     ` Imre Deak
2014-03-05 10:29       ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 15/19] drm/i915: use power domain api to check vga power state Imre Deak
2014-02-20 19:51   ` Jesse Barnes
2014-03-05 10:31     ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 16/19] drm/i915: sanity check power well sw state against hw state Imre Deak
2014-02-18 16:55   ` Ville Syrjälä
2014-02-18 17:37     ` Imre Deak
2014-02-18 17:59       ` Ville Syrjälä
2014-03-05 10:32         ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 17/19] drm/i915: vlv: factor out valleyview_display_irq_install Imre Deak
2014-02-20 19:56   ` Jesse Barnes
2014-02-24 13:34     ` Imre Deak
2014-02-17 22:02 ` [PATCH 18/19] drm/i915: move hsw power domain comment to its right place Imre Deak
2014-02-20 19:53   ` Jesse Barnes
2014-03-05 10:34     ` Daniel Vetter
2014-02-17 22:02 ` [PATCH 19/19] drm/i915: power domains: add vlv power wells Imre Deak
2014-02-19 12:29   ` Ville Syrjälä
2014-02-20 19:58     ` Jesse Barnes
2014-02-26 18:02       ` Imre Deak
2014-02-26 19:52         ` Jesse Barnes
2014-02-27 10:03           ` Imre Deak
2014-03-05 10:38           ` Daniel Vetter

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=1393247567.13131.80.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.