All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Atwood, Matthew S" <matthew.s.atwood@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"De Marchi, Lucas" <lucas.demarchi@intel.com>
Cc: "mahesh1.kumar@intel.com" <mahesh1.kumar@intel.com>
Subject: Re: [PATCH 02/22] drm/i915/tgl: select correct bit for port select
Date: Thu, 18 Jul 2019 20:20:09 +0000	[thread overview]
Message-ID: <f8c7524780a1848ef8fc8ccb08434bde6d709e6d.camel@intel.com> (raw)
In-Reply-To: <20190713010940.17711-3-lucas.demarchi@intel.com>

On Fri, 2019-07-12 at 18:09 -0700, Lucas De Marchi wrote:
> From: Mahesh Kumar <mahesh1.kumar@intel.com>
> 
> Bit definitions for port-select got changed for TRANS_CLK_SEL &
> TRANS_DDI_FUNC_CTL registers in TGL.
> 
> v2 (Lucas):
>   - Nuke TRANS_DDI_PORT_NONE since it's 0: we are already clearing
>     {TGL_,}TRANS_DDI_PORT_MASK (suggested by Ville)
>   - Also cover haswell_get_ddi_port_state() in intel_display.c that
> was
>     missing
>   - Define macros using the _SHIFT macros so we don't lose other
> users
> 
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c     | 47 +++++++++++++++---
> --
>  drivers/gpu/drm/i915/display/intel_display.c |  6 ++-
>  drivers/gpu/drm/i915/i915_reg.h              | 11 +++--
>  3 files changed, 50 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 8445244aa593..339c01e567ab 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -1773,7 +1773,10 @@ void intel_ddi_enable_transcoder_func(const
> struct intel_crtc_state *crtc_state)
>  
>  	/* Enable TRANS_DDI_FUNC_CTL for the pipe to work in HDMI mode
> */
>  	temp = TRANS_DDI_FUNC_ENABLE;
> -	temp |= TRANS_DDI_SELECT_PORT(port);
> +	if (INTEL_GEN(dev_priv) >= 12)
> +		temp |= TGL_TRANS_DDI_SELECT_PORT(port);
> +	else
> +		temp |= TRANS_DDI_SELECT_PORT(port);
>  
>  	switch (crtc_state->pipe_bpp) {
>  	case 18:
> @@ -1853,8 +1856,13 @@ void intel_ddi_disable_transcoder_func(const
> struct intel_crtc_state *crtc_state
>  	i915_reg_t reg = TRANS_DDI_FUNC_CTL(cpu_transcoder);
>  	u32 val = I915_READ(reg);
>  
> -	val &= ~(TRANS_DDI_FUNC_ENABLE | TRANS_DDI_PORT_MASK |
> TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
> -	val |= TRANS_DDI_PORT_NONE;
> +	if (INTEL_GEN(dev_priv) >= 12) {
> +		val &= ~(TRANS_DDI_FUNC_ENABLE |
> TGL_TRANS_DDI_PORT_MASK |
> +			 TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
> +	} else {
> +		val &= ~(TRANS_DDI_FUNC_ENABLE | TRANS_DDI_PORT_MASK |
> +			 TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
> +	}
>  	I915_WRITE(reg, val);
>  
>  	if (dev_priv->quirks & QUIRK_INCREASE_DDI_DISABLED_TIME &&
> @@ -2006,10 +2014,19 @@ static void
> intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
>  	mst_pipe_mask = 0;
>  	for_each_pipe(dev_priv, p) {
>  		enum transcoder cpu_transcoder = (enum transcoder)p;
> +		unsigned int port_mask, ddi_select;
> +
> +		if (INTEL_GEN(dev_priv) >= 12) {
> +			port_mask = TGL_TRANS_DDI_PORT_MASK;
> +			ddi_select = TGL_TRANS_DDI_SELECT_PORT(port);
> +		} else {
> +			port_mask = TRANS_DDI_PORT_MASK;
> +			ddi_select = TRANS_DDI_SELECT_PORT(port);
> +		}
>  
>  		tmp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
>  
> -		if ((tmp & TRANS_DDI_PORT_MASK) !=
> TRANS_DDI_SELECT_PORT(port))
> +		if ((tmp & port_mask) != ddi_select)
>  			continue;
>  
>  		if ((tmp & TRANS_DDI_MODE_SELECT_MASK) ==
> @@ -2126,9 +2143,14 @@ void intel_ddi_enable_pipe_clock(const struct
> intel_crtc_state *crtc_state)
>  	enum port port = encoder->port;
>  	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>  
> -	if (cpu_transcoder != TRANSCODER_EDP)
> -		I915_WRITE(TRANS_CLK_SEL(cpu_transcoder),
> -			   TRANS_CLK_SEL_PORT(port));
> +	if (cpu_transcoder != TRANSCODER_EDP) {
> +		if (INTEL_GEN(dev_priv) >= 12)
> +			I915_WRITE(TRANS_CLK_SEL(cpu_transcoder),
> +				   TGL_TRANS_CLK_SEL_PORT(port));
> +		else
> +			I915_WRITE(TRANS_CLK_SEL(cpu_transcoder),
> +				   TRANS_CLK_SEL_PORT(port));
> +	}
>  }
>  
>  void intel_ddi_disable_pipe_clock(const struct intel_crtc_state
> *crtc_state)
> @@ -2136,9 +2158,14 @@ void intel_ddi_disable_pipe_clock(const struct
> intel_crtc_state *crtc_state)
>  	struct drm_i915_private *dev_priv = to_i915(crtc_state-
> >base.crtc->dev);
>  	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>  
> -	if (cpu_transcoder != TRANSCODER_EDP)
> -		I915_WRITE(TRANS_CLK_SEL(cpu_transcoder),
> -			   TRANS_CLK_SEL_DISABLED);
> +	if (cpu_transcoder != TRANSCODER_EDP) {
> +		if (INTEL_GEN(dev_priv) >= 12)
> +			I915_WRITE(TRANS_CLK_SEL(cpu_transcoder),
> +				   TGL_TRANS_CLK_SEL_DISABLED);
> +		else
> +			I915_WRITE(TRANS_CLK_SEL(cpu_transcoder),
> +				   TRANS_CLK_SEL_DISABLED);
> +	}
>  }
>  
>  static void _skl_ddi_set_iboost(struct drm_i915_private *dev_priv,
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index e25b82d07d4f..51e4f6798a6b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -10353,7 +10353,11 @@ static void
> haswell_get_ddi_port_state(struct intel_crtc *crtc,
>  
>  	tmp = I915_READ(TRANS_DDI_FUNC_CTL(pipe_config-
> >cpu_transcoder));
>  
> -	port = (tmp & TRANS_DDI_PORT_MASK) >> TRANS_DDI_PORT_SHIFT;
> +	if (INTEL_GEN(dev_priv) >= 12)
> +		port = (tmp & TGL_TRANS_DDI_PORT_MASK) >>
> +			TGL_TRANS_DDI_PORT_SHIFT;
> +	else
> +		port = (tmp & TRANS_DDI_PORT_MASK) >>
> TRANS_DDI_PORT_SHIFT;
>  
>  	if (INTEL_GEN(dev_priv) >= 11)
>  		icelake_get_ddi_pll(dev_priv, port, pipe_config);
> diff --git a/drivers/gpu/drm/i915/i915_reg.h
> b/drivers/gpu/drm/i915/i915_reg.h
> index 0dd4506323f2..def71fd2e4d1 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -9391,10 +9391,12 @@ enum skl_power_gate {
>  
>  #define  TRANS_DDI_FUNC_ENABLE		(1 << 31)
>  /* Those bits are ignored by pipe EDP since it can only connect to
> DDI A */
> -#define  TRANS_DDI_PORT_MASK		(7 << 28)
>  #define  TRANS_DDI_PORT_SHIFT		28
> -#define  TRANS_DDI_SELECT_PORT(x)	((x) << 28)
> -#define  TRANS_DDI_PORT_NONE		(0 << 28)
> +#define  TGL_TRANS_DDI_PORT_SHIFT	27
> +#define  TRANS_DDI_PORT_MASK		(7 << TRANS_DDI_PORT_SHIFT)
> +#define  TGL_TRANS_DDI_PORT_MASK	(0xf <<
> TGL_TRANS_DDI_PORT_SHIFT)
> +#define  TRANS_DDI_SELECT_PORT(x)	((x) << TRANS_DDI_PORT_SHIFT)
> +#define  TGL_TRANS_DDI_SELECT_PORT(x)	(((x) + 1) <<
> TGL_TRANS_DDI_PORT_SHIFT)
>  #define  TRANS_DDI_MODE_SELECT_MASK	(7 << 24)
>  #define  TRANS_DDI_MODE_SELECT_HDMI	(0 << 24)
>  #define  TRANS_DDI_MODE_SELECT_DVI	(1 << 24)
> @@ -9604,6 +9606,9 @@ enum skl_power_gate {
>  /* For each transcoder, we need to select the corresponding port
> clock */
>  #define  TRANS_CLK_SEL_DISABLED		(0x0 << 29)
>  #define  TRANS_CLK_SEL_PORT(x)		(((x) + 1) << 29)
> +#define  TGL_TRANS_CLK_SEL_DISABLED	(0x0 << 28)
> +#define  TGL_TRANS_CLK_SEL_PORT(x)	(((x) + 1) << 28)
> +
>  
>  #define CDCLK_FREQ			_MMIO(0x46200)
>  
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-07-18 20:20 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-13  1:09 [PATCH 00/22] Tiger Lake part 2 Lucas De Marchi
2019-07-13  1:09 ` [PATCH 01/22] drm/i915/tgl: skip setting PORT_CL_DW12_* on initialization Lucas De Marchi
2019-07-18 20:35   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 02/22] drm/i915/tgl: select correct bit for port select Lucas De Marchi
2019-07-16 21:37   ` Srivatsa, Anusha
2019-07-18 20:20   ` Atwood, Matthew S [this message]
2019-07-13  1:09 ` [PATCH 03/22] drm/i915/tgl: update ddi/tc clock_off bits Lucas De Marchi
2019-07-16 22:41   ` Srivatsa, Anusha
2019-07-18 21:09   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 04/22] drm/i915/tgl: Add hpd interrupt handling Lucas De Marchi
2019-07-19 13:47   ` Ville Syrjälä
2019-07-19 16:45     ` Lucas De Marchi
2019-07-19 17:08       ` Ville Syrjälä
2019-07-19 17:14         ` Ville Syrjälä
2019-07-19 17:28           ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 05/22] drm/i915/tgl: Update north display hotplug detection to TGL connections Lucas De Marchi
2019-07-16 23:09   ` Srivatsa, Anusha
2019-07-13  1:09 ` [PATCH 06/22] drm/i915/tgl: handle DP aux interrupts Lucas De Marchi
2019-07-17  0:14   ` Srivatsa, Anusha
2019-07-13  1:09 ` [PATCH 07/22] drm/i915/dmc: Load DMC on TGL Lucas De Marchi
2019-07-19 10:44   ` Anshuman Gupta
2019-07-19 15:34     ` Lucas De Marchi
2019-07-19 16:05   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 08/22] drm/i915/tgl: Add DKL phy pll registers Lucas De Marchi
2019-07-19 21:22   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 09/22] drm/i915/tgl: re-indent code to prepare for DKL changes Lucas De Marchi
2019-07-22 22:31   ` Atwood, Matthew S
2019-07-13  1:09 ` [PATCH 10/22] drm/i915/tgl: Add DKL phy pll state calculations Lucas De Marchi
2019-07-13  1:09 ` [PATCH 11/22] drm/i915/tgl: start adding the DKL PLLs to use on TC ports Lucas De Marchi
2019-07-13  1:09 ` [PATCH 12/22] drm/i915/tgl: Add support for dkl pll write Lucas De Marchi
2019-07-13  1:09 ` [PATCH 13/22] drm/i915/gen12: add support for reading the timestamp frequency Lucas De Marchi
2019-07-13  1:09 ` [PATCH 14/22] drm/i915/tgl: allow the reg_read ioctl to read the RCS TIMESTAMP register Lucas De Marchi
2019-07-13  1:09 ` [PATCH 15/22] drm/i915/tgl: Introduce initial Tigerlake Workarounds Lucas De Marchi
2019-07-13  1:09 ` [PATCH 16/22] drm/i915/tgl: Implement Wa_1604555607 Lucas De Marchi
2019-07-18  6:03   ` Tvrtko Ursulin
2019-07-19 17:41     ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 17/22] drm/i915/tgl: Implement Wa_1406941453 Lucas De Marchi
2019-07-23 16:35   ` Summers, Stuart
2019-07-13  1:09 ` [PATCH 18/22] drm/i915/tgl: Define MOCS entries for Tigerlake Lucas De Marchi
2019-07-18 13:08   ` Ville Syrjälä
2019-07-18 17:09     ` Daniele Ceraolo Spurio
2019-07-18 17:44       ` Ville Syrjälä
2019-07-24 22:32       ` Lucas De Marchi
2019-07-25 18:26         ` Lis, Tomasz
2019-07-13  1:09 ` [PATCH 19/22] drm/i915/tgl: Tigerlake only has global MOCS registers Lucas De Marchi
2019-07-18 17:40   ` Daniele Ceraolo Spurio
2019-07-19 19:42     ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 20/22] drm/i915: Move MOCS setup to intel_mocs.c Lucas De Marchi
2019-07-23 16:30   ` Summers, Stuart
2019-07-13  1:09 ` [PATCH 21/22] drm/i915/tgl: Add and use new DC5 and DC6 residency counter registers Lucas De Marchi
2019-07-18  5:47   ` Anshuman Gupta
2019-07-19 15:58     ` Atwood, Matthew S
2019-07-19 18:39     ` Lucas De Marchi
2019-07-22  7:41       ` Anshuman Gupta
2019-07-22 17:40         ` Lucas De Marchi
2019-07-13  1:09 ` [PATCH 22/22] drm/i915/mst: Do not hardcoded the crtcs that encoder can connect Lucas De Marchi
2019-07-18 13:10   ` Ville Syrjälä
2019-08-15 17:41     ` James Ausmus
2019-07-13  1:19 ` ✗ Fi.CI.CHECKPATCH: warning for Tiger Lake part 2 Patchwork
2019-07-13  1:38 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-14 20:26 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-07-15 22:32 ` ✗ Fi.CI.CHECKPATCH: warning for Tiger Lake part 2 (rev2) Patchwork
2019-07-15 22:55 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-16  0:02 ` ✗ Fi.CI.IGT: failure " 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=f8c7524780a1848ef8fc8ccb08434bde6d709e6d.camel@intel.com \
    --to=matthew.s.atwood@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=mahesh1.kumar@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.