All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix hpd live status bits for g4x
@ 2016-02-10 17:59 ` ville.syrjala
  0 siblings, 0 replies; 8+ messages in thread
From: ville.syrjala @ 2016-02-10 17:59 UTC (permalink / raw)
  To: intel-gfx
  Cc: Shashank Sharma, Sonika Jindal, Daniel Vetter, Jani Nikula,
	Nick Bowler, stable

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Looks like g4x hpd live status bits actually agree with the spec. At
least they do on the machine I have, and apparently on Nick Bowler's
g4x as well.

So gm45 may be the only platform where they don't agree. At least
that seems to be the case based on the (somewhat incomplete)
logs/dumps in [1], and Daniel has also tested this on his gm45
sometime in the past.

So let's change the bits to match the spec on g4x. That actually makes
the g4x bits identical to vlv/chv so we can just share the code
between those platforms, leaving gm45 as the special case.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=52361

Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Nick Bowler <nbowler@draconx.ca>
References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
Reported-by: Nick Bowler <nbowler@draconx.ca>
Cc: stable@vger.kernel.org
Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++-------
 drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 188ad5de020f..678faa957e75 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3296,19 +3296,20 @@ enum skl_disp_power_wells {
 
 #define PORT_HOTPLUG_STAT	_MMIO(dev_priv->info.display_mmio_offset + 0x61114)
 /*
- * HDMI/DP bits are gen4+
+ * HDMI/DP bits are g4x+
  *
  * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
+/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */
+#define   PORTD_HOTPLUG_LIVE_STATUS_GM45	(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS_GM45	(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS_GM45	(1 << 27)
+/* G4X/VLV/CHV DP/HDMI bits again match Bspec */
+#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS_G4X		(1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
-/* VLV DP/HDMI bits again match Bspec */
-#define   PORTD_HOTPLUG_LIVE_STATUS_VLV		(1 << 27)
-#define   PORTC_HOTPLUG_LIVE_STATUS_VLV		(1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS_VLV		(1 << 29)
+#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTD_HOTPLUG_INT_LONG_PULSE		(2 << 21)
 #define   PORTD_HOTPLUG_INT_SHORT_PULSE		(1 << 21)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a073f04a5330..bbe18996efe6 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4490,20 +4490,20 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
 	return I915_READ(PORT_HOTPLUG_STAT) & bit;
 }
 
-static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
-				       struct intel_digital_port *port)
+static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv,
+					struct intel_digital_port *port)
 {
 	u32 bit;
 
 	switch (port->port) {
 	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
+		bit = PORTB_HOTPLUG_LIVE_STATUS_GM45;
 		break;
 	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
+		bit = PORTC_HOTPLUG_LIVE_STATUS_GM45;
 		break;
 	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
+		bit = PORTD_HOTPLUG_LIVE_STATUS_GM45;
 		break;
 	default:
 		MISSING_CASE(port->port);
@@ -4555,8 +4555,8 @@ bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
 		return cpt_digital_port_connected(dev_priv, port);
 	else if (IS_BROXTON(dev_priv))
 		return bxt_digital_port_connected(dev_priv, port);
-	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
-		return vlv_digital_port_connected(dev_priv, port);
+	else if (IS_GM45(dev_priv))
+		return gm45_digital_port_connected(dev_priv, port);
 	else
 		return g4x_digital_port_connected(dev_priv, port);
 }
-- 
2.4.10


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/i915: Fix hpd live status bits for g4x
@ 2016-02-10 17:59 ` ville.syrjala
  0 siblings, 0 replies; 8+ messages in thread
From: ville.syrjala @ 2016-02-10 17:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, stable, Nick Bowler

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Looks like g4x hpd live status bits actually agree with the spec. At
least they do on the machine I have, and apparently on Nick Bowler's
g4x as well.

So gm45 may be the only platform where they don't agree. At least
that seems to be the case based on the (somewhat incomplete)
logs/dumps in [1], and Daniel has also tested this on his gm45
sometime in the past.

So let's change the bits to match the spec on g4x. That actually makes
the g4x bits identical to vlv/chv so we can just share the code
between those platforms, leaving gm45 as the special case.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=52361

Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Nick Bowler <nbowler@draconx.ca>
References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
Reported-by: Nick Bowler <nbowler@draconx.ca>
Cc: stable@vger.kernel.org
Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++-------
 drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 188ad5de020f..678faa957e75 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3296,19 +3296,20 @@ enum skl_disp_power_wells {
 
 #define PORT_HOTPLUG_STAT	_MMIO(dev_priv->info.display_mmio_offset + 0x61114)
 /*
- * HDMI/DP bits are gen4+
+ * HDMI/DP bits are g4x+
  *
  * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
+/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */
+#define   PORTD_HOTPLUG_LIVE_STATUS_GM45	(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS_GM45	(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS_GM45	(1 << 27)
+/* G4X/VLV/CHV DP/HDMI bits again match Bspec */
+#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS_G4X		(1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
-/* VLV DP/HDMI bits again match Bspec */
-#define   PORTD_HOTPLUG_LIVE_STATUS_VLV		(1 << 27)
-#define   PORTC_HOTPLUG_LIVE_STATUS_VLV		(1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS_VLV		(1 << 29)
+#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTD_HOTPLUG_INT_LONG_PULSE		(2 << 21)
 #define   PORTD_HOTPLUG_INT_SHORT_PULSE		(1 << 21)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a073f04a5330..bbe18996efe6 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4490,20 +4490,20 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
 	return I915_READ(PORT_HOTPLUG_STAT) & bit;
 }
 
-static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
-				       struct intel_digital_port *port)
+static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv,
+					struct intel_digital_port *port)
 {
 	u32 bit;
 
 	switch (port->port) {
 	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
+		bit = PORTB_HOTPLUG_LIVE_STATUS_GM45;
 		break;
 	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
+		bit = PORTC_HOTPLUG_LIVE_STATUS_GM45;
 		break;
 	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
+		bit = PORTD_HOTPLUG_LIVE_STATUS_GM45;
 		break;
 	default:
 		MISSING_CASE(port->port);
@@ -4555,8 +4555,8 @@ bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
 		return cpt_digital_port_connected(dev_priv, port);
 	else if (IS_BROXTON(dev_priv))
 		return bxt_digital_port_connected(dev_priv, port);
-	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
-		return vlv_digital_port_connected(dev_priv, port);
+	else if (IS_GM45(dev_priv))
+		return gm45_digital_port_connected(dev_priv, port);
 	else
 		return g4x_digital_port_connected(dev_priv, port);
 }
-- 
2.4.10

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Fix hpd live status bits for g4x
  2016-02-10 17:59 ` ville.syrjala
@ 2016-02-11 10:03   ` Daniel Vetter
  -1 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2016-02-11 10:03 UTC (permalink / raw)
  To: ville.syrjala
  Cc: intel-gfx, Shashank Sharma, Sonika Jindal, Daniel Vetter,
	Jani Nikula, Nick Bowler, stable

On Wed, Feb 10, 2016 at 07:59:05PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> 
> Looks like g4x hpd live status bits actually agree with the spec. At
> least they do on the machine I have, and apparently on Nick Bowler's
> g4x as well.
> 
> So gm45 may be the only platform where they don't agree. At least
> that seems to be the case based on the (somewhat incomplete)
> logs/dumps in [1], and Daniel has also tested this on his gm45
> sometime in the past.
> 
> So let's change the bits to match the spec on g4x. That actually makes
> the g4x bits identical to vlv/chv so we can just share the code
> between those platforms, leaving gm45 as the special case.
> 
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=52361
> 
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Sonika Jindal <sonika.jindal@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Nick Bowler <nbowler@draconx.ca>
> References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
> Reported-by: Nick Bowler <nbowler@draconx.ca>
> Cc: stable@vger.kernel.org
> Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
> Signed-off-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>

Yeah I'm hopeful this will work. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Since CI is down and this is super restricted impact and fixing a
regression I'm voting that we'll pick it up right away. Jani, are you ok
with that?
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++-------
>  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
>  2 files changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 188ad5de020f..678faa957e75 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -3296,19 +3296,20 @@ enum skl_disp_power_wells {
>  
>  #define PORT_HOTPLUG_STAT	_MMIO(dev_priv->info.display_mmio_offset + 0x61114)
>  /*
> - * HDMI/DP bits are gen4+
> + * HDMI/DP bits are g4x+
>   *
>   * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
>   * Please check the detailed lore in the commit message for for experimental
>   * evidence.
>   */
> -#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
> +/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */
> +#define   PORTD_HOTPLUG_LIVE_STATUS_GM45	(1 << 29)
> +#define   PORTC_HOTPLUG_LIVE_STATUS_GM45	(1 << 28)
> +#define   PORTB_HOTPLUG_LIVE_STATUS_GM45	(1 << 27)
> +/* G4X/VLV/CHV DP/HDMI bits again match Bspec */
> +#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
>  #define   PORTC_HOTPLUG_LIVE_STATUS_G4X		(1 << 28)
> -#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
> -/* VLV DP/HDMI bits again match Bspec */
> -#define   PORTD_HOTPLUG_LIVE_STATUS_VLV		(1 << 27)
> -#define   PORTC_HOTPLUG_LIVE_STATUS_VLV		(1 << 28)
> -#define   PORTB_HOTPLUG_LIVE_STATUS_VLV		(1 << 29)
> +#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
>  #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
>  #define   PORTD_HOTPLUG_INT_LONG_PULSE		(2 << 21)
>  #define   PORTD_HOTPLUG_INT_SHORT_PULSE		(1 << 21)
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index a073f04a5330..bbe18996efe6 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4490,20 +4490,20 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
>  	return I915_READ(PORT_HOTPLUG_STAT) & bit;
>  }
>  
> -static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
> -				       struct intel_digital_port *port)
> +static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv,
> +					struct intel_digital_port *port)
>  {
>  	u32 bit;
>  
>  	switch (port->port) {
>  	case PORT_B:
> -		bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
> +		bit = PORTB_HOTPLUG_LIVE_STATUS_GM45;
>  		break;
>  	case PORT_C:
> -		bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
> +		bit = PORTC_HOTPLUG_LIVE_STATUS_GM45;
>  		break;
>  	case PORT_D:
> -		bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> +		bit = PORTD_HOTPLUG_LIVE_STATUS_GM45;
>  		break;
>  	default:
>  		MISSING_CASE(port->port);
> @@ -4555,8 +4555,8 @@ bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
>  		return cpt_digital_port_connected(dev_priv, port);
>  	else if (IS_BROXTON(dev_priv))
>  		return bxt_digital_port_connected(dev_priv, port);
> -	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> -		return vlv_digital_port_connected(dev_priv, port);
> +	else if (IS_GM45(dev_priv))
> +		return gm45_digital_port_connected(dev_priv, port);
>  	else
>  		return g4x_digital_port_connected(dev_priv, port);
>  }
> -- 
> 2.4.10
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Fix hpd live status bits for g4x
@ 2016-02-11 10:03   ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2016-02-11 10:03 UTC (permalink / raw)
  To: ville.syrjala; +Cc: Daniel Vetter, intel-gfx, Nick Bowler, stable

On Wed, Feb 10, 2016 at 07:59:05PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Looks like g4x hpd live status bits actually agree with the spec. At
> least they do on the machine I have, and apparently on Nick Bowler's
> g4x as well.
> 
> So gm45 may be the only platform where they don't agree. At least
> that seems to be the case based on the (somewhat incomplete)
> logs/dumps in [1], and Daniel has also tested this on his gm45
> sometime in the past.
> 
> So let's change the bits to match the spec on g4x. That actually makes
> the g4x bits identical to vlv/chv so we can just share the code
> between those platforms, leaving gm45 as the special case.
> 
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=52361
> 
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Sonika Jindal <sonika.jindal@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Nick Bowler <nbowler@draconx.ca>
> References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
> Reported-by: Nick Bowler <nbowler@draconx.ca>
> Cc: stable@vger.kernel.org
> Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Yeah I'm hopeful this will work. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Since CI is down and this is super restricted impact and fixing a
regression I'm voting that we'll pick it up right away. Jani, are you ok
with that?
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++-------
>  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
>  2 files changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 188ad5de020f..678faa957e75 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -3296,19 +3296,20 @@ enum skl_disp_power_wells {
>  
>  #define PORT_HOTPLUG_STAT	_MMIO(dev_priv->info.display_mmio_offset + 0x61114)
>  /*
> - * HDMI/DP bits are gen4+
> + * HDMI/DP bits are g4x+
>   *
>   * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
>   * Please check the detailed lore in the commit message for for experimental
>   * evidence.
>   */
> -#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
> +/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */
> +#define   PORTD_HOTPLUG_LIVE_STATUS_GM45	(1 << 29)
> +#define   PORTC_HOTPLUG_LIVE_STATUS_GM45	(1 << 28)
> +#define   PORTB_HOTPLUG_LIVE_STATUS_GM45	(1 << 27)
> +/* G4X/VLV/CHV DP/HDMI bits again match Bspec */
> +#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
>  #define   PORTC_HOTPLUG_LIVE_STATUS_G4X		(1 << 28)
> -#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
> -/* VLV DP/HDMI bits again match Bspec */
> -#define   PORTD_HOTPLUG_LIVE_STATUS_VLV		(1 << 27)
> -#define   PORTC_HOTPLUG_LIVE_STATUS_VLV		(1 << 28)
> -#define   PORTB_HOTPLUG_LIVE_STATUS_VLV		(1 << 29)
> +#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
>  #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
>  #define   PORTD_HOTPLUG_INT_LONG_PULSE		(2 << 21)
>  #define   PORTD_HOTPLUG_INT_SHORT_PULSE		(1 << 21)
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index a073f04a5330..bbe18996efe6 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4490,20 +4490,20 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
>  	return I915_READ(PORT_HOTPLUG_STAT) & bit;
>  }
>  
> -static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
> -				       struct intel_digital_port *port)
> +static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv,
> +					struct intel_digital_port *port)
>  {
>  	u32 bit;
>  
>  	switch (port->port) {
>  	case PORT_B:
> -		bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
> +		bit = PORTB_HOTPLUG_LIVE_STATUS_GM45;
>  		break;
>  	case PORT_C:
> -		bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
> +		bit = PORTC_HOTPLUG_LIVE_STATUS_GM45;
>  		break;
>  	case PORT_D:
> -		bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> +		bit = PORTD_HOTPLUG_LIVE_STATUS_GM45;
>  		break;
>  	default:
>  		MISSING_CASE(port->port);
> @@ -4555,8 +4555,8 @@ bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
>  		return cpt_digital_port_connected(dev_priv, port);
>  	else if (IS_BROXTON(dev_priv))
>  		return bxt_digital_port_connected(dev_priv, port);
> -	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> -		return vlv_digital_port_connected(dev_priv, port);
> +	else if (IS_GM45(dev_priv))
> +		return gm45_digital_port_connected(dev_priv, port);
>  	else
>  		return g4x_digital_port_connected(dev_priv, port);
>  }
> -- 
> 2.4.10
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Fix hpd live status bits for g4x
  2016-02-11 10:03   ` Daniel Vetter
  (?)
@ 2016-02-12  6:26   ` Jani Nikula
  2016-02-15 17:13       ` Ville Syrjälä
  -1 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2016-02-12  6:26 UTC (permalink / raw)
  To: Daniel Vetter, ville.syrjala
  Cc: intel-gfx, Shashank Sharma, Sonika Jindal, Daniel Vetter,
	Nick Bowler, stable

On Thu, 11 Feb 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Feb 10, 2016 at 07:59:05PM +0200, ville.syrjala@linux.intel.com wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> 
>> Looks like g4x hpd live status bits actually agree with the spec. At
>> least they do on the machine I have, and apparently on Nick Bowler's
>> g4x as well.
>> 
>> So gm45 may be the only platform where they don't agree. At least
>> that seems to be the case based on the (somewhat incomplete)
>> logs/dumps in [1], and Daniel has also tested this on his gm45
>> sometime in the past.
>> 
>> So let's change the bits to match the spec on g4x. That actually makes
>> the g4x bits identical to vlv/chv so we can just share the code
>> between those platforms, leaving gm45 as the special case.
>> 
>> [1] https://bugzilla.kernel.org/show_bug.cgi?id=52361
>> 
>> Cc: Shashank Sharma <shashank.sharma@intel.com>
>> Cc: Sonika Jindal <sonika.jindal@intel.com>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Nick Bowler <nbowler@draconx.ca>
>> References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
>> Reported-by: Nick Bowler <nbowler@draconx.ca>
>> Cc: stable@vger.kernel.org
>> Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Yeah I'm hopeful this will work. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Since CI is down and this is super restricted impact and fixing a
> regression I'm voting that we'll pick it up right away. Jani, are you ok
> with that?

Ack.

> -Daniel
>
>> ---
>>  drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++-------
>>  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
>>  2 files changed, 15 insertions(+), 14 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
>> index 188ad5de020f..678faa957e75 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -3296,19 +3296,20 @@ enum skl_disp_power_wells {
>>  
>>  #define PORT_HOTPLUG_STAT	_MMIO(dev_priv->info.display_mmio_offset + 0x61114)
>>  /*
>> - * HDMI/DP bits are gen4+
>> + * HDMI/DP bits are g4x+
>>   *
>>   * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
>>   * Please check the detailed lore in the commit message for for experimental
>>   * evidence.
>>   */
>> -#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
>> +/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */
>> +#define   PORTD_HOTPLUG_LIVE_STATUS_GM45	(1 << 29)
>> +#define   PORTC_HOTPLUG_LIVE_STATUS_GM45	(1 << 28)
>> +#define   PORTB_HOTPLUG_LIVE_STATUS_GM45	(1 << 27)
>> +/* G4X/VLV/CHV DP/HDMI bits again match Bspec */
>> +#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
>>  #define   PORTC_HOTPLUG_LIVE_STATUS_G4X		(1 << 28)
>> -#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
>> -/* VLV DP/HDMI bits again match Bspec */
>> -#define   PORTD_HOTPLUG_LIVE_STATUS_VLV		(1 << 27)
>> -#define   PORTC_HOTPLUG_LIVE_STATUS_VLV		(1 << 28)
>> -#define   PORTB_HOTPLUG_LIVE_STATUS_VLV		(1 << 29)
>> +#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
>>  #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
>>  #define   PORTD_HOTPLUG_INT_LONG_PULSE		(2 << 21)
>>  #define   PORTD_HOTPLUG_INT_SHORT_PULSE		(1 << 21)
>> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>> index a073f04a5330..bbe18996efe6 100644
>> --- a/drivers/gpu/drm/i915/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>> @@ -4490,20 +4490,20 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
>>  	return I915_READ(PORT_HOTPLUG_STAT) & bit;
>>  }
>>  
>> -static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
>> -				       struct intel_digital_port *port)
>> +static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv,
>> +					struct intel_digital_port *port)
>>  {
>>  	u32 bit;
>>  
>>  	switch (port->port) {
>>  	case PORT_B:
>> -		bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
>> +		bit = PORTB_HOTPLUG_LIVE_STATUS_GM45;
>>  		break;
>>  	case PORT_C:
>> -		bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
>> +		bit = PORTC_HOTPLUG_LIVE_STATUS_GM45;
>>  		break;
>>  	case PORT_D:
>> -		bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
>> +		bit = PORTD_HOTPLUG_LIVE_STATUS_GM45;
>>  		break;
>>  	default:
>>  		MISSING_CASE(port->port);
>> @@ -4555,8 +4555,8 @@ bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
>>  		return cpt_digital_port_connected(dev_priv, port);
>>  	else if (IS_BROXTON(dev_priv))
>>  		return bxt_digital_port_connected(dev_priv, port);
>> -	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
>> -		return vlv_digital_port_connected(dev_priv, port);
>> +	else if (IS_GM45(dev_priv))
>> +		return gm45_digital_port_connected(dev_priv, port);
>>  	else
>>  		return g4x_digital_port_connected(dev_priv, port);
>>  }
>> -- 
>> 2.4.10
>> 

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✗ Fi.CI.BAT: warning for drm/i915: Fix hpd live status bits for g4x
  2016-02-10 17:59 ` ville.syrjala
  (?)
  (?)
@ 2016-02-15 14:05 ` Patchwork
  -1 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2016-02-15 14:05 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

== Summary ==

Series 3243v1 drm/i915: Fix hpd live status bits for g4x
http://patchwork.freedesktop.org/api/1.0/series/3243/revisions/1/mbox/

Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                pass       -> DMESG-WARN (ilk-hp8440p) UNSTABLE
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (skl-i5k-2)
        Subgroup suspend-read-crc-pipe-c:
                pass       -> DMESG-WARN (skl-i5k-2)
                dmesg-warn -> PASS       (bsw-nuc-2)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> DMESG-WARN (bsw-nuc-2)
                fail       -> PASS       (bdw-nuci7)
                pass       -> DMESG-WARN (byt-nuc)
        Subgroup basic-rte:
                dmesg-warn -> PASS       (bsw-nuc-2)

bdw-nuci7        total:162  pass:152  dwarn:0   dfail:0   fail:0   skip:10 
bdw-ultra        total:165  pass:152  dwarn:0   dfail:0   fail:0   skip:13 
bsw-nuc-2        total:165  pass:135  dwarn:1   dfail:0   fail:0   skip:29 
byt-nuc          total:165  pass:140  dwarn:1   dfail:0   fail:0   skip:24 
hsw-brixbox      total:165  pass:151  dwarn:0   dfail:0   fail:0   skip:14 
hsw-gt2          total:165  pass:154  dwarn:0   dfail:0   fail:1   skip:10 
ilk-hp8440p      total:165  pass:115  dwarn:1   dfail:0   fail:1   skip:48 
ivb-t430s        total:165  pass:150  dwarn:0   dfail:0   fail:1   skip:14 
skl-i5k-2        total:165  pass:149  dwarn:1   dfail:0   fail:0   skip:15 
snb-dellxps      total:165  pass:142  dwarn:0   dfail:0   fail:1   skip:22 
snb-x220t        total:165  pass:142  dwarn:0   dfail:0   fail:2   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1391/

f2110d8eac120416f8f5669f2aa561d9ab330a77 drm-intel-nightly: 2016y-02m-15d-09h-53m-04s UTC integration manifest
618b5aeb2c5b496b1ed112b47529cc8ddad2f862 drm/i915: Fix hpd live status bits for g4x

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Fix hpd live status bits for g4x
  2016-02-12  6:26   ` Jani Nikula
@ 2016-02-15 17:13       ` Ville Syrjälä
  0 siblings, 0 replies; 8+ messages in thread
From: Ville Syrjälä @ 2016-02-15 17:13 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Daniel Vetter, intel-gfx, Shashank Sharma, Sonika Jindal,
	Daniel Vetter, Nick Bowler, stable

On Fri, Feb 12, 2016 at 08:26:27AM +0200, Jani Nikula wrote:
> On Thu, 11 Feb 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Feb 10, 2016 at 07:59:05PM +0200, ville.syrjala@linux.intel.com wrote:
> >> From: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> >> 
> >> Looks like g4x hpd live status bits actually agree with the spec. At
> >> least they do on the machine I have, and apparently on Nick Bowler's
> >> g4x as well.
> >> 
> >> So gm45 may be the only platform where they don't agree. At least
> >> that seems to be the case based on the (somewhat incomplete)
> >> logs/dumps in [1], and Daniel has also tested this on his gm45
> >> sometime in the past.
> >> 
> >> So let's change the bits to match the spec on g4x. That actually makes
> >> the g4x bits identical to vlv/chv so we can just share the code
> >> between those platforms, leaving gm45 as the special case.
> >> 
> >> [1] https://bugzilla.kernel.org/show_bug.cgi?id=52361
> >> 
> >> Cc: Shashank Sharma <shashank.sharma@intel.com>
> >> Cc: Sonika Jindal <sonika.jindal@intel.com>
> >> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> >> Cc: Nick Bowler <nbowler@draconx.ca>
> >> References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
> >> Reported-by: Nick Bowler <nbowler@draconx.ca>
> >> Cc: stable@vger.kernel.org
> >> Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
> >> Signed-off-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> >
> > Yeah I'm hopeful this will work. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> > Since CI is down and this is super restricted impact and fixing a
> > regression I'm voting that we'll pick it up right away. Jani, are you ok
> > with that?
> 
> Ack.

"Right away" was slightly dealyed by my lazyness.
Anyway, pushed this to dinq. Thanks for the review.

> 
> > -Daniel
> >
> >> ---
> >>  drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++-------
> >>  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
> >>  2 files changed, 15 insertions(+), 14 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> >> index 188ad5de020f..678faa957e75 100644
> >> --- a/drivers/gpu/drm/i915/i915_reg.h
> >> +++ b/drivers/gpu/drm/i915/i915_reg.h
> >> @@ -3296,19 +3296,20 @@ enum skl_disp_power_wells {
> >>  
> >>  #define PORT_HOTPLUG_STAT	_MMIO(dev_priv->info.display_mmio_offset + 0x61114)
> >>  /*
> >> - * HDMI/DP bits are gen4+
> >> + * HDMI/DP bits are g4x+
> >>   *
> >>   * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
> >>   * Please check the detailed lore in the commit message for for experimental
> >>   * evidence.
> >>   */
> >> -#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
> >> +/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */
> >> +#define   PORTD_HOTPLUG_LIVE_STATUS_GM45	(1 << 29)
> >> +#define   PORTC_HOTPLUG_LIVE_STATUS_GM45	(1 << 28)
> >> +#define   PORTB_HOTPLUG_LIVE_STATUS_GM45	(1 << 27)
> >> +/* G4X/VLV/CHV DP/HDMI bits again match Bspec */
> >> +#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
> >>  #define   PORTC_HOTPLUG_LIVE_STATUS_G4X		(1 << 28)
> >> -#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
> >> -/* VLV DP/HDMI bits again match Bspec */
> >> -#define   PORTD_HOTPLUG_LIVE_STATUS_VLV		(1 << 27)
> >> -#define   PORTC_HOTPLUG_LIVE_STATUS_VLV		(1 << 28)
> >> -#define   PORTB_HOTPLUG_LIVE_STATUS_VLV		(1 << 29)
> >> +#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
> >>  #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
> >>  #define   PORTD_HOTPLUG_INT_LONG_PULSE		(2 << 21)
> >>  #define   PORTD_HOTPLUG_INT_SHORT_PULSE		(1 << 21)
> >> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> >> index a073f04a5330..bbe18996efe6 100644
> >> --- a/drivers/gpu/drm/i915/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/intel_dp.c
> >> @@ -4490,20 +4490,20 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
> >>  	return I915_READ(PORT_HOTPLUG_STAT) & bit;
> >>  }
> >>  
> >> -static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
> >> -				       struct intel_digital_port *port)
> >> +static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv,
> >> +					struct intel_digital_port *port)
> >>  {
> >>  	u32 bit;
> >>  
> >>  	switch (port->port) {
> >>  	case PORT_B:
> >> -		bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
> >> +		bit = PORTB_HOTPLUG_LIVE_STATUS_GM45;
> >>  		break;
> >>  	case PORT_C:
> >> -		bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
> >> +		bit = PORTC_HOTPLUG_LIVE_STATUS_GM45;
> >>  		break;
> >>  	case PORT_D:
> >> -		bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> >> +		bit = PORTD_HOTPLUG_LIVE_STATUS_GM45;
> >>  		break;
> >>  	default:
> >>  		MISSING_CASE(port->port);
> >> @@ -4555,8 +4555,8 @@ bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
> >>  		return cpt_digital_port_connected(dev_priv, port);
> >>  	else if (IS_BROXTON(dev_priv))
> >>  		return bxt_digital_port_connected(dev_priv, port);
> >> -	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> >> -		return vlv_digital_port_connected(dev_priv, port);
> >> +	else if (IS_GM45(dev_priv))
> >> +		return gm45_digital_port_connected(dev_priv, port);
> >>  	else
> >>  		return g4x_digital_port_connected(dev_priv, port);
> >>  }
> >> -- 
> >> 2.4.10
> >> 
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

-- 
Ville Syrj�l�
Intel OTC

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Fix hpd live status bits for g4x
@ 2016-02-15 17:13       ` Ville Syrjälä
  0 siblings, 0 replies; 8+ messages in thread
From: Ville Syrjälä @ 2016-02-15 17:13 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Daniel Vetter, intel-gfx, stable, Nick Bowler

On Fri, Feb 12, 2016 at 08:26:27AM +0200, Jani Nikula wrote:
> On Thu, 11 Feb 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Feb 10, 2016 at 07:59:05PM +0200, ville.syrjala@linux.intel.com wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> 
> >> Looks like g4x hpd live status bits actually agree with the spec. At
> >> least they do on the machine I have, and apparently on Nick Bowler's
> >> g4x as well.
> >> 
> >> So gm45 may be the only platform where they don't agree. At least
> >> that seems to be the case based on the (somewhat incomplete)
> >> logs/dumps in [1], and Daniel has also tested this on his gm45
> >> sometime in the past.
> >> 
> >> So let's change the bits to match the spec on g4x. That actually makes
> >> the g4x bits identical to vlv/chv so we can just share the code
> >> between those platforms, leaving gm45 as the special case.
> >> 
> >> [1] https://bugzilla.kernel.org/show_bug.cgi?id=52361
> >> 
> >> Cc: Shashank Sharma <shashank.sharma@intel.com>
> >> Cc: Sonika Jindal <sonika.jindal@intel.com>
> >> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> >> Cc: Nick Bowler <nbowler@draconx.ca>
> >> References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
> >> Reported-by: Nick Bowler <nbowler@draconx.ca>
> >> Cc: stable@vger.kernel.org
> >> Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid")
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Yeah I'm hopeful this will work. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> > Since CI is down and this is super restricted impact and fixing a
> > regression I'm voting that we'll pick it up right away. Jani, are you ok
> > with that?
> 
> Ack.

"Right away" was slightly dealyed by my lazyness.
Anyway, pushed this to dinq. Thanks for the review.

> 
> > -Daniel
> >
> >> ---
> >>  drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++-------
> >>  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
> >>  2 files changed, 15 insertions(+), 14 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> >> index 188ad5de020f..678faa957e75 100644
> >> --- a/drivers/gpu/drm/i915/i915_reg.h
> >> +++ b/drivers/gpu/drm/i915/i915_reg.h
> >> @@ -3296,19 +3296,20 @@ enum skl_disp_power_wells {
> >>  
> >>  #define PORT_HOTPLUG_STAT	_MMIO(dev_priv->info.display_mmio_offset + 0x61114)
> >>  /*
> >> - * HDMI/DP bits are gen4+
> >> + * HDMI/DP bits are g4x+
> >>   *
> >>   * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
> >>   * Please check the detailed lore in the commit message for for experimental
> >>   * evidence.
> >>   */
> >> -#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
> >> +/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */
> >> +#define   PORTD_HOTPLUG_LIVE_STATUS_GM45	(1 << 29)
> >> +#define   PORTC_HOTPLUG_LIVE_STATUS_GM45	(1 << 28)
> >> +#define   PORTB_HOTPLUG_LIVE_STATUS_GM45	(1 << 27)
> >> +/* G4X/VLV/CHV DP/HDMI bits again match Bspec */
> >> +#define   PORTD_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
> >>  #define   PORTC_HOTPLUG_LIVE_STATUS_G4X		(1 << 28)
> >> -#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 27)
> >> -/* VLV DP/HDMI bits again match Bspec */
> >> -#define   PORTD_HOTPLUG_LIVE_STATUS_VLV		(1 << 27)
> >> -#define   PORTC_HOTPLUG_LIVE_STATUS_VLV		(1 << 28)
> >> -#define   PORTB_HOTPLUG_LIVE_STATUS_VLV		(1 << 29)
> >> +#define   PORTB_HOTPLUG_LIVE_STATUS_G4X		(1 << 29)
> >>  #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
> >>  #define   PORTD_HOTPLUG_INT_LONG_PULSE		(2 << 21)
> >>  #define   PORTD_HOTPLUG_INT_SHORT_PULSE		(1 << 21)
> >> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> >> index a073f04a5330..bbe18996efe6 100644
> >> --- a/drivers/gpu/drm/i915/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/intel_dp.c
> >> @@ -4490,20 +4490,20 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
> >>  	return I915_READ(PORT_HOTPLUG_STAT) & bit;
> >>  }
> >>  
> >> -static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
> >> -				       struct intel_digital_port *port)
> >> +static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv,
> >> +					struct intel_digital_port *port)
> >>  {
> >>  	u32 bit;
> >>  
> >>  	switch (port->port) {
> >>  	case PORT_B:
> >> -		bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
> >> +		bit = PORTB_HOTPLUG_LIVE_STATUS_GM45;
> >>  		break;
> >>  	case PORT_C:
> >> -		bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
> >> +		bit = PORTC_HOTPLUG_LIVE_STATUS_GM45;
> >>  		break;
> >>  	case PORT_D:
> >> -		bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> >> +		bit = PORTD_HOTPLUG_LIVE_STATUS_GM45;
> >>  		break;
> >>  	default:
> >>  		MISSING_CASE(port->port);
> >> @@ -4555,8 +4555,8 @@ bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
> >>  		return cpt_digital_port_connected(dev_priv, port);
> >>  	else if (IS_BROXTON(dev_priv))
> >>  		return bxt_digital_port_connected(dev_priv, port);
> >> -	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> >> -		return vlv_digital_port_connected(dev_priv, port);
> >> +	else if (IS_GM45(dev_priv))
> >> +		return gm45_digital_port_connected(dev_priv, port);
> >>  	else
> >>  		return g4x_digital_port_connected(dev_priv, port);
> >>  }
> >> -- 
> >> 2.4.10
> >> 
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-15 17:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10 17:59 [PATCH] drm/i915: Fix hpd live status bits for g4x ville.syrjala
2016-02-10 17:59 ` ville.syrjala
2016-02-11 10:03 ` Daniel Vetter
2016-02-11 10:03   ` Daniel Vetter
2016-02-12  6:26   ` Jani Nikula
2016-02-15 17:13     ` Ville Syrjälä
2016-02-15 17:13       ` Ville Syrjälä
2016-02-15 14:05 ` ✗ Fi.CI.BAT: warning for " Patchwork

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.