public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Xiong Zhang <xiong.y.zhang@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/6 v3] drm/i915/skl: enable DDI-E hotplug
Date: Wed, 26 Aug 2015 10:25:44 +0300	[thread overview]
Message-ID: <87vbc28q9z.fsf@intel.com> (raw)
In-Reply-To: <1439798150-12603-1-git-send-email-xiong.y.zhang@intel.com>

On Mon, 17 Aug 2015, Xiong Zhang <xiong.y.zhang@intel.com> wrote:
> v2: fix one error found by checkpath.pl
> v3: Add one ignored break for switch-case. DDI-E hotplug
>     function doesn't work after updating drm-intel tree,
>     I checked the code and found this missing which isn't
>     the root cause for broke DDI-E hp.  The broken
>     DDI-E hp function is fixed by "Adding DDI_E power
>     well domain".
>
> Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Tested-by: Timo Aaltonen <timo.aaltonen@canonical.com>

Pushed to drm-intel-next-fixes.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  1 +
>  drivers/gpu/drm/i915/i915_irq.c      | 48 +++++++++++++++++++++++++++++++++---
>  drivers/gpu/drm/i915/i915_reg.h      | 12 +++++++++
>  drivers/gpu/drm/i915/intel_display.c |  3 +++
>  drivers/gpu/drm/i915/intel_dp.c      |  3 +++
>  drivers/gpu/drm/i915/intel_hotplug.c |  3 +++
>  6 files changed, 66 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index e0f3f05..5f6fd0b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -215,6 +215,7 @@ enum hpd_pin {
>  	HPD_PORT_B,
>  	HPD_PORT_C,
>  	HPD_PORT_D,
> +	HPD_PORT_E,
>  	HPD_NUM_PINS
>  };
>  
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index a051045..8485bea 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -61,6 +61,13 @@ static const u32 hpd_cpt[HPD_NUM_PINS] = {
>  	[HPD_PORT_D] = SDE_PORTD_HOTPLUG_CPT
>  };
>  
> +static const u32 hpd_spt[HPD_NUM_PINS] = {
> +	[HPD_PORT_B] = SDE_PORTB_HOTPLUG_CPT,
> +	[HPD_PORT_C] = SDE_PORTC_HOTPLUG_CPT,
> +	[HPD_PORT_D] = SDE_PORTD_HOTPLUG_CPT,
> +	[HPD_PORT_E] = SDE_PORTE_HOTPLUG_SPT
> +};
> +
>  static const u32 hpd_mask_i915[HPD_NUM_PINS] = {
>  	[HPD_CRT] = CRT_HOTPLUG_INT_EN,
>  	[HPD_SDVO_B] = SDVOB_HOTPLUG_INT_EN,
> @@ -1253,6 +1260,8 @@ static bool pch_port_hotplug_long_detect(enum port port, u32 val)
>  		return val & PORTC_HOTPLUG_LONG_DETECT;
>  	case PORT_D:
>  		return val & PORTD_HOTPLUG_LONG_DETECT;
> +	case PORT_E:
> +		return val & PORTE_HOTPLUG_LONG_DETECT;
>  	default:
>  		return false;
>  	}
> @@ -1753,7 +1762,12 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	int pipe;
> -	u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT;
> +	u32 hotplug_trigger;
> +
> +	if (HAS_PCH_SPT(dev))
> +		hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_SPT;
> +	else
> +		hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT;
>  
>  	if (hotplug_trigger) {
>  		u32 dig_hotplug_reg, pin_mask, long_mask;
> @@ -1761,9 +1775,23 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir)
>  		dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG);
>  		I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg);
>  
> -		intel_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger,
> -				   dig_hotplug_reg, hpd_cpt,
> -				   pch_port_hotplug_long_detect);
> +		if (HAS_PCH_SPT(dev)) {
> +			intel_get_hpd_pins(&pin_mask, &long_mask,
> +					   hotplug_trigger,
> +					   dig_hotplug_reg, hpd_spt,
> +					   pch_port_hotplug_long_detect);
> +
> +			/* detect PORTE HP event */
> +			dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG2);
> +			if (pch_port_hotplug_long_detect(PORT_E,
> +							 dig_hotplug_reg))
> +				long_mask |= 1 << HPD_PORT_E;
> +		} else
> +			intel_get_hpd_pins(&pin_mask, &long_mask,
> +					   hotplug_trigger,
> +					   dig_hotplug_reg, hpd_cpt,
> +					   pch_port_hotplug_long_detect);
> +
>  		intel_hpd_irq_handler(dev, pin_mask, long_mask);
>  	}
>  
> @@ -2985,6 +3013,11 @@ static void ibx_hpd_irq_setup(struct drm_device *dev)
>  		for_each_intel_encoder(dev, intel_encoder)
>  			if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state == HPD_ENABLED)
>  				enabled_irqs |= hpd_ibx[intel_encoder->hpd_pin];
> +	} else if (HAS_PCH_SPT(dev)) {
> +		hotplug_irqs = SDE_HOTPLUG_MASK_SPT;
> +		for_each_intel_encoder(dev, intel_encoder)
> +			if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state == HPD_ENABLED)
> +				enabled_irqs |= hpd_spt[intel_encoder->hpd_pin];
>  	} else {
>  		hotplug_irqs = SDE_HOTPLUG_MASK_CPT;
>  		for_each_intel_encoder(dev, intel_encoder)
> @@ -3006,6 +3039,13 @@ static void ibx_hpd_irq_setup(struct drm_device *dev)
>  	hotplug |= PORTC_HOTPLUG_ENABLE | PORTC_PULSE_DURATION_2ms;
>  	hotplug |= PORTB_HOTPLUG_ENABLE | PORTB_PULSE_DURATION_2ms;
>  	I915_WRITE(PCH_PORT_HOTPLUG, hotplug);
> +
> +	/* enable SPT PORTE hot plug */
> +	if (HAS_PCH_SPT(dev)) {
> +		hotplug = I915_READ(PCH_PORT_HOTPLUG2);
> +		hotplug |= PORTE_HOTPLUG_ENABLE;
> +		I915_WRITE(PCH_PORT_HOTPLUG2, hotplug);
> +	}
>  }
>  
>  static void bxt_hpd_irq_setup(struct drm_device *dev)
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 1fa0554..7187383 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -5958,6 +5958,7 @@ enum skl_disp_power_wells {
>  #define SDE_AUXC_CPT		(1 << 26)
>  #define SDE_AUXB_CPT		(1 << 25)
>  #define SDE_AUX_MASK_CPT	(7 << 25)
> +#define SDE_PORTE_HOTPLUG_SPT	(1 << 25)
>  #define SDE_PORTD_HOTPLUG_CPT	(1 << 23)
>  #define SDE_PORTC_HOTPLUG_CPT	(1 << 22)
>  #define SDE_PORTB_HOTPLUG_CPT	(1 << 21)
> @@ -5968,6 +5969,10 @@ enum skl_disp_power_wells {
>  				 SDE_PORTD_HOTPLUG_CPT |	\
>  				 SDE_PORTC_HOTPLUG_CPT |	\
>  				 SDE_PORTB_HOTPLUG_CPT)
> +#define SDE_HOTPLUG_MASK_SPT	(SDE_PORTE_HOTPLUG_SPT |	\
> +				 SDE_PORTD_HOTPLUG_CPT |	\
> +				 SDE_PORTC_HOTPLUG_CPT |	\
> +				 SDE_PORTB_HOTPLUG_CPT)
>  #define SDE_GMBUS_CPT		(1 << 17)
>  #define SDE_ERROR_CPT		(1 << 16)
>  #define SDE_AUDIO_CP_REQ_C_CPT	(1 << 10)
> @@ -6039,6 +6044,13 @@ enum skl_disp_power_wells {
>  #define  PORTB_HOTPLUG_SHORT_DETECT	(1 << 0)
>  #define  PORTB_HOTPLUG_LONG_DETECT	(2 << 0)
>  
> +#define PCH_PORT_HOTPLUG2        0xc403C		/* SHOTPLUG_CTL2 */
> +#define PORTE_HOTPLUG_ENABLE            (1 << 4)
> +#define PORTE_HOTPLUG_STATUS_MASK	(0x3 << 0)
> +#define  PORTE_HOTPLUG_NO_DETECT	(0 << 0)
> +#define  PORTE_HOTPLUG_SHORT_DETECT	(1 << 0)
> +#define  PORTE_HOTPLUG_LONG_DETECT	(2 << 0)
> +
>  #define PCH_GPIOA               0xc5010
>  #define PCH_GPIOB               0xc5014
>  #define PCH_GPIOC               0xc5018
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f604ce1..5510eb8c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -1098,6 +1098,9 @@ bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,
>  		case PORT_D:
>  			bit = SDE_PORTD_HOTPLUG_CPT;
>  			break;
> +		case PORT_E:
> +			bit = SDE_PORTE_HOTPLUG_SPT;
> +			break;
>  		default:
>  			return true;
>  		}
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index b905c19..4776f87 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5916,6 +5916,9 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
>  	case PORT_D:
>  		intel_encoder->hpd_pin = HPD_PORT_D;
>  		break;
> +	case PORT_E:
> +		intel_encoder->hpd_pin = HPD_PORT_E;
> +		break;
>  	default:
>  		BUG();
>  	}
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index 032a0bf..53c0173 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -91,6 +91,9 @@ bool intel_hpd_pin_to_port(enum hpd_pin pin, enum port *port)
>  	case HPD_PORT_D:
>  		*port = PORT_D;
>  		return true;
> +	case HPD_PORT_E:
> +		*port = PORT_E;
> +		return true;
>  	default:
>  		return false;	/* no hpd */
>  	}
> -- 
> 2.1.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2015-08-26  7:22 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06  7:51 [PATCH 1/6] drm/i915/skl: Enable DDI-E Xiong Zhang
2015-08-06  7:51 ` [PATCH 2/6] drm/i915: Set power domain for DDI-E Xiong Zhang
2015-08-11  6:12   ` Zhang, Xiong Y
2015-08-06  7:51 ` [PATCH 3/6] drm/i915: Set alternate aux " Xiong Zhang
2015-08-08  0:01   ` [PATCH] " Rodrigo Vivi
2015-08-11  6:18     ` Zhang, Xiong Y
2015-08-13  8:40     ` shuang.he
2015-08-06  7:51 ` [PATCH 4/6] drm/i915: eDP can be present on DDI-E Xiong Zhang
2015-08-11  6:27   ` Zhang, Xiong Y
2015-08-11  9:47   ` Daniel Vetter
2015-08-11 10:09     ` Zhang, Xiong Y
2015-08-11 18:42     ` Vivi, Rodrigo
2015-08-12 10:27       ` Zhang, Xiong Y
2015-08-12 12:32         ` Daniel Vetter
2015-08-12 16:38           ` Vivi, Rodrigo
2015-08-31 15:47   ` Jani Nikula
2015-08-06  7:51 ` [PATCH 5/6] drm/i915/skl: enable DDIE hotplug Xiong Zhang
2015-08-08  0:06   ` Rodrigo Vivi
2015-08-10  6:53     ` [PATCH 5/6 v2] drm/i915/skl: enable DDI-E hotplug Xiong Zhang
2015-08-17  7:55       ` [PATCH 5/6 v3] " Xiong Zhang
2015-08-26  7:25         ` Jani Nikula [this message]
2015-08-06  7:51 ` [PATCH 6/6] drm/i915: Enable HDMI on DDI-E Xiong Zhang
2015-08-08  0:09   ` Rodrigo Vivi
2015-08-11  9:58   ` Daniel Vetter
2015-08-12 10:39     ` [PATCH 6/6 v3] " Xiong Zhang
2015-08-12 12:33       ` Daniel Vetter
2015-08-13  2:57         ` Zhang, Xiong Y
2015-08-14  8:42           ` Daniel Vetter
2015-08-14 10:38             ` Zhang, Xiong Y
2015-08-17  8:04             ` Xiong Zhang
2015-08-31 15:47               ` Jani Nikula
2015-08-12 14:19   ` [PATCH 6/6] " shuang.he
2015-08-06 13:30 ` [PATCH 1/6] drm/i915/skl: Enable DDI-E Daniel Vetter
2015-08-06 15:37   ` Vivi, Rodrigo
2015-08-08  0:35   ` [PATCH 8/6] " Rodrigo Vivi
2015-08-11  7:12     ` Zhang, Xiong Y
2015-08-31 15:48     ` Jani Nikula
2015-08-06 15:14 ` [PATCH 1/6] " Daniel Vetter
2015-08-06 15:50   ` Vivi, Rodrigo
2015-08-08  0:33   ` [PATCH 7/6] drm/i915/skl: DDI-E and DDI-A shares 4 lanes Rodrigo Vivi
2015-08-11  7:05     ` Zhang, Xiong Y
2015-08-11 18:38       ` Vivi, Rodrigo
2015-08-12  2:20         ` Zhang, Xiong Y
2015-08-12 16:51           ` Vivi, Rodrigo
2015-08-13  3:27             ` Zhang, Xiong Y
2015-08-13  5:48               ` Jindal, Sonika
2015-08-26  8:15                 ` Jani Nikula
2015-08-26 16:38                   ` Vivi, Rodrigo
2015-08-27  2:52                     ` Zhang, Xiong Y
2015-08-27 14:31                       ` Timo Aaltonen
2015-08-27 17:59                         ` Vivi, Rodrigo
2015-08-12 21:29       ` Timo Aaltonen

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=87vbc28q9z.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=xiong.y.zhang@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