All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH 3/8] drm/i915/psr: Make all PSR register relative to mmio base
Date: Fri, 22 Mar 2019 11:15:05 +0200	[thread overview]
Message-ID: <874l7vclt2.fsf@intel.com> (raw)
In-Reply-To: <20190321180143.22519-3-jose.souza@intel.com>

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.

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

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-03-22  9:14 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 [this message]
2019-03-22 17:27     ` Dhinakaran Pandiyan
2019-03-26 20:44       ` Souza, Jose
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=874l7vclt2.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@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.