All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>,
	"jani.nikula@linux.intel.com" <jani.nikula@linux.intel.com>
Subject: Re: [PATCH 3/8] drm/i915/psr: Make all PSR register relative to mmio base
Date: Tue, 26 Mar 2019 20:44:34 +0000	[thread overview]
Message-ID: <069cef6321362031acfe9d8c3c67a97d8afc30c6.camel@intel.com> (raw)
In-Reply-To: <0b0c6eb6555afb2dfefcea16a0bb3e828b38eca7.camel@intel.com>


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

On Fri, 2019-03-22 at 10:27 -0700, Dhinakaran Pandiyan wrote:
> On Fri, 2019-03-22 at 11:15 +0200, Jani Nikula wrote:
> > On Thu, 21 Mar 2019, José Roberto de Souza <jose.souza@intel.com>
> > wrote:
> > > Right now it have a mix of PSR registers that are relative to PSR
> > > mmio base and other register with a hardcoded address, lets keep
> > > it
> > > consistented and have it all relative to mmio base.
> > 
> > This is not strictly limited to this patch, but an overall trend.
> > The
> > thing that really bugs me with this is losing more of the actual
> > absolute mmio addresses from the file. When you're seeking to add a
> > new
> > register, you can't trivially grep for it in the file anymore. Not
> > all
> > of our register names match the spec (and the spec occasionally
> > also
> > changes register names) so being able to find the offset is
> > important.

I understand but for new gens BSpec is using relative address see BSpec
50583 and 50577 for example.

> 
> Fully agreed.
> 
> I think we can do something along the lines of  
> 
> #define _HSW_PSR_OFFSET BDW_EDP_PSR_BASE - HSW_PSR_PSR_BASE
> #define _BDW_PSR_CTL 0x6f800
> 
> _MMIO_HSW_ADJUST(pipe, reg)  IS_HASWELL(dev_priv) ?
> 				MMIO_TRANS2((pipe), reg -
> _HSW_PSR_OFFSET) : 					MMIO_TRANS2((pi
> pe), reg)

To MMIO_TRANS2() work we need to give the reg based on the first
transcoder, what you think about this?


#define _HSW_EDP_PSR_BASE	0x64000

/* _PSR_CTL_A to follow BSpec naming or we could keep _PSR_CTL_A */
#define _SRD_CTL_A		0x60800
#define _SRD_CTL_EDP		0x6F800
#define EDP_PSR_CTL				(_MMIO_TRANS2(dev_priv-
>psr.transcoder, _SRD_CTL_A) - dev_priv->psr.mmio_base_adjust)

intel_psr_enable_locked()
	if (IS_HASWELL(dev_priv))
		dev_priv->psr.mmio_base_adjust = _SRD_CTL_EDP
- _HSW_EDP_PSR_BASE;

The only concern here it that _SRD_CTL_A(and the other registers
conterparts) could give the understand that PSR could be enabled in
regular transcoders what it not the case in current gens.


> 
> #define EDP_PSR_CTL(pipe) _MMIO_HSW_ADJUST((pipe), _BDW_PSR_CTL)
> 
> 
> I'd like at least BDW+ addresses to be in the code.
> 
> -DK
> 
> > When we added the macros that use ->pipe_offsets and
> > ->trans_offsets, we
> > took care to have at least one of the offsets in the file. I'm
> > wondering
> > if we could do something like that here as well.
> > 
> > BR,
> > Jani.
> > 
> > 
> > > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_reg.h | 11 ++++-------
> > >  1 file changed, 4 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_reg.h
> > > b/drivers/gpu/drm/i915/i915_reg.h
> > > index 28728399e607..e1ed2ba1c315 100644
> > > --- a/drivers/gpu/drm/i915/i915_reg.h
> > > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > > @@ -4326,7 +4326,7 @@ enum {
> > >  #define   EDP_PSR_DEBUG_MASK_DISP_REG_WRITE    (1 << 16) /*
> > > Reserved in
> > > ICL+ */
> > >  #define   EDP_PSR_DEBUG_EXIT_ON_PIXEL_UNDERRUN (1 << 15) /* SKL+
> > > */
> > >  
> > > -#define EDP_PSR2_CTL			_MMIO(0x6f900)
> > > +#define EDP_PSR2_CTL			_MMIO(dev_priv-
> > > >psr.mmio_base +
> > > 0x100)
> > >  #define   EDP_PSR2_ENABLE		(1 << 31)
> > >  #define   EDP_SU_TRACK_ENABLE		(1 << 30)
> > >  #define   EDP_Y_COORDINATE_VALID	(1 << 26) /* GLK and CNL+ */
> > > @@ -4344,7 +4344,7 @@ enum {
> > >  #define   EDP_PSR2_IDLE_FRAME_MASK	0xf
> > >  #define   EDP_PSR2_IDLE_FRAME_SHIFT	0
> > >  
> > > -#define PSR_EVENT				_MMIO(0x6F848)
> > > +#define PSR_EVENT				_MMIO(dev_priv-
> > > >psr.mmio_base +
> > > 0x48)
> > >  #define  PSR_EVENT_PSR2_WD_TIMER_EXPIRE		(1 << 17)
> > >  #define  PSR_EVENT_PSR2_DISABLED		(1 << 16)
> > >  #define  PSR_EVENT_SU_DIRTY_FIFO_UNDERRUN	(1 << 15)
> > > @@ -4362,14 +4362,11 @@ enum {
> > >  #define  PSR_EVENT_LPSP_MODE_EXIT		(1 << 1)
> > >  #define  PSR_EVENT_PSR_DISABLE			(1 << 0)
> > >  
> > > -#define EDP_PSR2_STATUS			_MMIO(0x6f940)
> > > +#define EDP_PSR2_STATUS			_MMIO(dev_priv-
> > > >psr.mmio_base +
> > > 0x140)
> > >  #define EDP_PSR2_STATUS_STATE_MASK     (0xf << 28)
> > >  #define EDP_PSR2_STATUS_STATE_SHIFT    28
> > >  
> > > -#define _PSR2_SU_STATUS_0		0x6F914
> > > -#define _PSR2_SU_STATUS_1		0x6F918
> > > -#define _PSR2_SU_STATUS_2		0x6F91C
> > > -#define _PSR2_SU_STATUS(index)		_MMIO(_PICK_EVEN((index
> > > ),
> > > _PSR2_SU_STATUS_0, _PSR2_SU_STATUS_1))
> > > +#define _PSR2_SU_STATUS(index)		_MMIO(dev_priv-
> > > >psr.mmio_base +
> > > 0x114 + (index) * 4)
> > >  #define PSR2_SU_STATUS(frame)		(_PSR2_SU_STATUS((frame
> > > ) / 3))
> > >  #define PSR2_SU_STATUS_SHIFT(frame)	(((frame) % 3) * 10)
> > >  #define PSR2_SU_STATUS_MASK(frame)	(0x3ff <<
> > > PSR2_SU_STATUS_SHIFT(frame))

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2019-03-26 20:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 18:01 [PATCH 1/8] drm/i915/psr: Remove partial PSR support on multiple transcoders José Roberto de Souza
2019-03-21 18:01 ` [PATCH 2/8] drm/i915: Move PSR mmio base to PSR struct José Roberto de Souza
2019-03-21 18:01 ` [PATCH 3/8] drm/i915/psr: Make all PSR register relative to mmio base José Roberto de Souza
2019-03-22  9:15   ` Jani Nikula
2019-03-22 17:27     ` Dhinakaran Pandiyan
2019-03-26 20:44       ` Souza, Jose [this message]
2019-03-21 18:01 ` [PATCH 4/8] drm/i915/psr: Make mmio base relative to transcoder offset José Roberto de Souza
2019-03-21 18:01 ` [PATCH 5/8] drm/i915/psr: Initialize PSR mutex even when sink is not reliable José Roberto de Souza
2019-03-21 18:01 ` [PATCH 6/8] drm/i915/psr: Do not enable PSR in interlaced mode for all GENs José Roberto de Souza
2019-03-21 18:01 ` [PATCH 7/8] drm/i915: Remove unused VLV/CHV PSR registers José Roberto de Souza
2019-03-21 18:01 ` [PATCH 8/8] drm/i915/bdw+: Move misc display IRQ handling to it own function José Roberto de Souza
2019-03-21 18:20 ` [PATCH 1/8] drm/i915/psr: Remove partial PSR support on multiple transcoders Ville Syrjälä
2019-03-21 21:54 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] " Patchwork
2019-03-21 21:58 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-21 22:24 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-22 16:14 ` ✓ Fi.CI.IGT: " 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=069cef6321362031acfe9d8c3c67a97d8afc30c6.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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 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.