Skip to contentSkip to conversation

Add BXT A0/A1 WA for HPD swap in generic way

PATCH In review Sonika Jindal 6 participants 17 messages Aug 10, 2015 – Aug 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add BXT A0/A1 WA for HPD swap in generic way

This series adds BXT HPD pin swap WA for A0/A1 by setting right hpd_pin and irq_port for PORT_B.

Sonika Jindal (3):
drm/i915: Dont enable hpd for eDP drm/i915/bxt: Add HPD support for DDIA drm/i915/bxt: WA for swapped HPD pins in A stepping

 drivers/gpu/drm/i915/i915_irq.c   |   10 +++-------
 drivers/gpu/drm/i915/intel_ddi.c  |   10 +++++++++-
 drivers/gpu/drm/i915/intel_dp.c   |    4 +++-
 drivers/gpu/drm/i915/intel_hdmi.c |    9 ++++++++-
 4 files changed, 23 insertions(+), 10 deletions(-)
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/3 drm/i915: Dont enable hpd for eDP

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

---
 drivers/gpu/drm/i915/intel_dp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index fcc64e5..5a614c9 100644
@@ -5784,7 +5784,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 	/* Set up the hotplug pin. */
 	switch (port) {
 	case PORT_A:
-		intel_encoder->hpd_pin = HPD_PORT_A;
+		/* Not enabling edp interrupts */
 		break;
 	case PORT_B:
 		intel_encoder->hpd_pin = HPD_PORT_B;
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 23 lines · Sonika Jindal

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

---
  drivers/gpu/drm/i915/intel_dp.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index fcc64e5..5a614c9 100644
@@ -5784,7 +5784,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
  	/* Set up the hotplug pin. */
  	switch (port) {
  	case PORT_A:
-		intel_encoder->hpd_pin = HPD_PORT_A;
+		/* Not enabling edp interrupts */
  		break;
  	case PORT_B:
  		intel_encoder->hpd_pin = HPD_PORT_B;
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#3 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 7 lines · Sivakumar Thulasimani
Quoted 4 lines · Sonika Jindal

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Quoted 28 lines
Quoted 19 lines
---
  drivers/gpu/drm/i915/intel_dp.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index fcc64e5..5a614c9 100644
@@ -5784,7 +5784,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
  	/* Set up the hotplug pin. */
  	switch (port) {
  	case PORT_A:
-		intel_encoder->hpd_pin = HPD_PORT_A;
+		/* Not enabling edp interrupts */
  		break;
  	case PORT_B:
  		intel_encoder->hpd_pin = HPD_PORT_B;
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 4 lines · Jani Nikula
Quoted 3 lines · Sivakumar Thulasimani

On 8/10/2015 10:35 AM, Sonika Jindal wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Nope, we are not removing HPD for edp sinks, it was never there in the first place. It was enabled for CHV (even there by mistake since PORT B/C was both DP and eDP) but it was never there for any other plaforms nor is it used for any purpose (PSR must use it, but i dont see code for it as well).

Quoted 27 lines
Quoted 27 lines
Quoted 19 lines
---
   drivers/gpu/drm/i915/intel_dp.c |    2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index fcc64e5..5a614c9 100644
@@ -5784,7 +5784,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
   	/* Set up the hotplug pin. */
   	switch (port) {
   	case PORT_A:
-		intel_encoder->hpd_pin = HPD_PORT_A;
+		/* Not enabling edp interrupts */
   		break;
   	case PORT_B:
   		intel_encoder->hpd_pin = HPD_PORT_B;
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#5 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 13 lines · Sivakumar Thulasimani
Quoted 4 lines · Jani Nikula
Quoted 3 lines · Sivakumar Thulasimani

On 8/10/2015 10:35 AM, Sonika Jindal wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Quoted 7 lines

Nope, we are not removing HPD for edp sinks, it was never there in the first place. It was
enabled for CHV (even there by mistake since PORT B/C was both DP and eDP) but it was
never there for any other plaforms nor is it used for any purpose (PSR must use it, but i
dont see code for it as well).

Are you saying there's no HPD enabled in our *hardware* for eDP? Or driver?

My point is, is this patch making it harder to enable eDP hpd handling (e.g. for PSR or DP link re-training) in the future? We currently take it into account in a few places, and if we start removing that, it will be a loss of effort to first remove and then add it back.

BR,
Jani.

Quoted 32 lines
Quoted 27 lines
Quoted 27 lines
Quoted 19 lines
---
   drivers/gpu/drm/i915/intel_dp.c |    2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index fcc64e5..5a614c9 100644
@@ -5784,7 +5784,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
   	/* Set up the hotplug pin. */
   	switch (port) {
   	case PORT_A:
-		intel_encoder->hpd_pin = HPD_PORT_A;
+		/* Not enabling edp interrupts */
   		break;
   	case PORT_B:
   		intel_encoder->hpd_pin = HPD_PORT_B;
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
regards,
Sivakumar
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 22 lines · Jani Nikula
Quoted 13 lines · Sivakumar Thulasimani
Quoted 4 lines · Jani Nikula
Quoted 3 lines · Sivakumar Thulasimani

On 8/10/2015 10:35 AM, Sonika Jindal wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Quoted 7 lines

Nope, we are not removing HPD for edp sinks, it was never there in the first place. It was
enabled for CHV (even there by mistake since PORT B/C was both DP and eDP) but it was
never there for any other plaforms nor is it used for any purpose (PSR must use it, but i
dont see code for it as well).

Quoted 7 lines

Are you saying there's no HPD enabled in our *hardware* for eDP? Or driver?

My point is, is this patch making it harder to enable eDP hpd handling (e.g. for PSR or DP link re-training) in the future? We currently take it into account in a few places, and if we start removing that, it will be a loss of effort to first remove and then add it back.

I have a branch with (untested) port A/E HPD support (+ a bunch of SPT+ irq handler reorganization). I guess I should post that in case people are interested in this stuff.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

In reply to Jani Nikula
Quoted 24 lines · Jani Nikula
Quoted 13 lines · Sivakumar Thulasimani
Quoted 4 lines · Jani Nikula
Quoted 3 lines · Sivakumar Thulasimani

On 8/10/2015 10:35 AM, Sonika Jindal wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Quoted 7 lines

Nope, we are not removing HPD for edp sinks, it was never there in the first place. It was
enabled for CHV (even there by mistake since PORT B/C was both DP and eDP) but it was
never there for any other plaforms nor is it used for any purpose (PSR must use it, but i
dont see code for it as well).

Are you saying there's no HPD enabled in our *hardware* for eDP? Or driver?

Quoted 7 lines

My point is, is this patch making it harder to enable eDP hpd handling (e.g. for PSR or DP link re-training) in the future? We currently take it into account in a few places, and if we start removing that, it will be a loss of effort to first remove and then add it back.

BR,
Jani.

i was referring to our driver only.

Our VLV/CHV code already receives hpd for every pps on and off which is later ignored. if we dont disable HPD on eDPs this behavior will be extended for all platforms which i feel is too costly to keep enabled when there is no purpose for it right now.

if anyone later requires HPD , they might need it for PSR panels only and since that code is not available as of now, this can be added along with those changes so i feel this is the better tradeoff :)

Quoted 32 lines
Quoted 32 lines
Quoted 28 lines
Quoted 28 lines
Quoted 20 lines
---
    drivers/gpu/drm/i915/intel_dp.c |    2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index fcc64e5..5a614c9 100644
@@ -5784,7 +5784,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
    	/* Set up the hotplug pin. */
    	switch (port) {
    	case PORT_A:
-		intel_encoder->hpd_pin = HPD_PORT_A;
+		/* Not enabling edp interrupts */
    		break;
    	case PORT_B:
    		intel_encoder->hpd_pin = HPD_PORT_B;
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
regards,
Sivakumar
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 34 lines · Sivakumar Thulasimani
Quoted 24 lines · Jani Nikula
Quoted 13 lines · Sivakumar Thulasimani
Quoted 4 lines · Jani Nikula
Quoted 3 lines · Sivakumar Thulasimani

On 8/10/2015 10:35 AM, Sonika Jindal wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Quoted 7 lines

Nope, we are not removing HPD for edp sinks, it was never there in the first place. It was
enabled for CHV (even there by mistake since PORT B/C was both DP and eDP) but it was
never there for any other plaforms nor is it used for any purpose (PSR must use it, but i
dont see code for it as well).

Are you saying there's no HPD enabled in our *hardware* for eDP? Or driver?

Quoted 7 lines

My point is, is this patch making it harder to enable eDP hpd handling (e.g. for PSR or DP link re-training) in the future? We currently take it into account in a few places, and if we start removing that, it will be a loss of effort to first remove and then add it back.

BR,
Jani.

Quoted 7 lines

i was referring to our driver only.

Our VLV/CHV code already receives hpd for every pps on and off which is later ignored. if we dont disable HPD on eDPs this behavior will be extended for all platforms which i feel is too costly to keep enabled when there is no
purpose for it right now.

don't optimize code because you "feel it's costly", only do it when you have hard numbers. One interrupt per pps on or off transition won't be measurable at all.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 41 lines · Daniel Vetter
Quoted 33 lines · Sivakumar Thulasimani
Quoted 24 lines · Jani Nikula
Quoted 13 lines · Sivakumar Thulasimani
Quoted 4 lines · Jani Nikula
Quoted 3 lines · Sivakumar Thulasimani

On 8/10/2015 10:35 AM, Sonika Jindal wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Quoted 7 lines

Nope, we are not removing HPD for edp sinks, it was never there in the first place. It was
enabled for CHV (even there by mistake since PORT B/C was both DP and eDP) but it was
never there for any other plaforms nor is it used for any purpose (PSR must use it, but i
dont see code for it as well).

Are you saying there's no HPD enabled in our *hardware* for eDP? Or driver?

Quoted 7 lines

My point is, is this patch making it harder to enable eDP hpd handling (e.g. for PSR or DP link re-training) in the future? We currently take it into account in a few places, and if we start removing that, it will be a loss of effort to first remove and then add it back.

BR,
Jani.

Quoted 7 lines

i was referring to our driver only.

Our VLV/CHV code already receives hpd for every pps on and off which is later ignored. if we dont disable HPD on eDPs this behavior will be extended for all platforms which i feel is too costly to keep enabled when there is no
purpose for it right now.

Quoted 4 lines

don't optimize code because you "feel it's costly", only do it when you have hard numbers. One interrupt per pps on or off transition won't be measurable at all.
-Daniel

let me rephrase my concern then :)
a) HPD was never enabled before this patch for edp
b) this patch series will enable hpd for edp
so why should we allow hpd for edp when no one is using it and will cause problems unless ignored explicitly ?

Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

Re: [PATCH 1/3] drm/i915: Dont enable hpd for eDP

Quoted 44 lines · Sivakumar Thulasimani
Quoted 41 lines · Daniel Vetter
Quoted 40 lines · Sivakumar Thulasimani
Quoted 24 lines · Jani Nikula
Quoted 13 lines · Sivakumar Thulasimani
Quoted 4 lines · Jani Nikula
Quoted 3 lines · Sivakumar Thulasimani

On 8/10/2015 10:35 AM, Sonika Jindal wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

With HPD support added for all ports including PORT_A, setting hpd_pin will result in enabling of hpd to edp as well. There is no need to enable HPD on PORT_A hence this patch removes hpd_pin update for PORT_A, where edp will be connected. it can be added back when required

What? You can't just go ahead and remove HPD from eDP sinks.

BR,
Jani.

Quoted 7 lines

Nope, we are not removing HPD for edp sinks, it was never there in the first place. It was
enabled for CHV (even there by mistake since PORT B/C was both DP and eDP) but it was
never there for any other plaforms nor is it used for any purpose (PSR must use it, but i
dont see code for it as well).

Are you saying there's no HPD enabled in our *hardware* for eDP? Or driver?

Quoted 7 lines

My point is, is this patch making it harder to enable eDP hpd handling (e.g. for PSR or DP link re-training) in the future? We currently take it into account in a few places, and if we start removing that, it will be a loss of effort to first remove and then add it back.

BR,
Jani.

i was referring to our driver only.

Our VLV/CHV code already receives hpd for every pps on and off which is later ignored. if we dont disable HPD on eDPs this behavior will be extended for all platforms which i feel is too costly to keep enabled when there is no
purpose for it right now.

Quoted 6 lines
Quoted 4 lines

don't optimize code because you "feel it's costly", only do it when you have hard numbers. One interrupt per pps on or off transition won't be measurable at all.
-Daniel

let me rephrase my concern then :)
a) HPD was never enabled before this patch for edp

It was for port!=A, which means all VLV/CHV + some other machines with eDP on port D.

Quoted 4 lines

b) this patch series will enable hpd for edp
so why should we allow hpd for edp when no one is using it and will cause problems
unless ignored explicitly ?

It's not clear it would cause problems. My ILK still seems happy now that I enabled port A HPD on it [1]. As are the VLV/CHV machines. On BSW we had problems but that turned out to be misconfigured pullups on the HPD pins. Before that got fixed there was a lot of noise on the line whenever the panel was off, and that spurred me to write the patch series to keep the HPD disabled while the port is disabled [2].

[1] http://lists.freedesktop.org/archives/intel-gfx/2015-August/073559.html
[2] http://lists.freedesktop.org/archives/intel-gfx/2015-January/058173.html

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

PATCH 2/3 drm/i915/bxt: Add HPD support for DDIA

In reply to Sonika Jindal

Also remove redundant comments.

---
 drivers/gpu/drm/i915/i915_irq.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +3 -7
index 02b9e73..9b9533a 100644
@@ -90,6 +90,7 @@ static const u32 hpd_status_i915[HPD_NUM_PINS] = {
 
 /* BXT hpd list */
 static const u32 hpd_bxt[HPD_NUM_PINS] = {
+	[HPD_PORT_A] = BXT_DE_PORT_HP_DDIA,
 	[HPD_PORT_B] = BXT_DE_PORT_HP_DDIB,
 	[HPD_PORT_C] = BXT_DE_PORT_HP_DDIC
 };
@@ -3018,30 +3019,25 @@ static void bxt_hpd_irq_setup(struct drm_device *dev)
 	u32 hotplug_port = 0;
 	u32 hotplug_ctrl;
 
-	/* Now, enable HPD */
 	for_each_intel_encoder(dev, intel_encoder) {
 		if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state
 				== HPD_ENABLED)
 			hotplug_port |= hpd_bxt[intel_encoder->hpd_pin];
 	}
 
-	/* Mask all HPD control bits */
 	hotplug_ctrl = I915_READ(BXT_HOTPLUG_CTL) & ~BXT_HOTPLUG_CTL_MASK;
 
-	/* Enable requested port in hotplug control */
-	/* TODO: implement (short) HPD support on port A */
-	WARN_ON_ONCE(hotplug_port & BXT_DE_PORT_HP_DDIA);
+	if (hotplug_port & BXT_DE_PORT_HP_DDIA)
+		hotplug_ctrl |= BXT_DDIA_HPD_ENABLE;
 	if (hotplug_port & BXT_DE_PORT_HP_DDIB)
 		hotplug_ctrl |= BXT_DDIB_HPD_ENABLE;
 	if (hotplug_port & BXT_DE_PORT_HP_DDIC)
 		hotplug_ctrl |= BXT_DDIC_HPD_ENABLE;
 	I915_WRITE(BXT_HOTPLUG_CTL, hotplug_ctrl);
 
-	/* Unmask DDI hotplug in IMR */
 	hotplug_ctrl = I915_READ(GEN8_DE_PORT_IMR) & ~hotplug_port;
 	I915_WRITE(GEN8_DE_PORT_IMR, hotplug_ctrl);
 
-	/* Enable DDI hotplug in IER */
 	hotplug_ctrl = I915_READ(GEN8_DE_PORT_IER) | hotplug_port;
 	I915_WRITE(GEN8_DE_PORT_IER, hotplug_ctrl);
 	POSTING_READ(GEN8_DE_PORT_IER);
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/3
#12 lore raw

Re: [PATCH 2/3] drm/i915/bxt: Add HPD support for DDIA

Quoted 52 lines · Sonika Jindal

Also remove redundant comments.

---
  drivers/gpu/drm/i915/i915_irq.c |   10 +++-------
  1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +3 -7
index 02b9e73..9b9533a 100644
@@ -90,6 +90,7 @@ static const u32 hpd_status_i915[HPD_NUM_PINS] = {
 
  /* BXT hpd list */
  static const u32 hpd_bxt[HPD_NUM_PINS] = {
+	[HPD_PORT_A] = BXT_DE_PORT_HP_DDIA,
  	[HPD_PORT_B] = BXT_DE_PORT_HP_DDIB,
  	[HPD_PORT_C] = BXT_DE_PORT_HP_DDIC
  };
@@ -3018,30 +3019,25 @@ static void bxt_hpd_irq_setup(struct drm_device *dev)
  	u32 hotplug_port = 0;
  	u32 hotplug_ctrl;
 
-	/* Now, enable HPD */
  	for_each_intel_encoder(dev, intel_encoder) {
  		if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state
  				== HPD_ENABLED)
  			hotplug_port |= hpd_bxt[intel_encoder->hpd_pin];
  	}
 
-	/* Mask all HPD control bits */
  	hotplug_ctrl = I915_READ(BXT_HOTPLUG_CTL) & ~BXT_HOTPLUG_CTL_MASK;
 
-	/* Enable requested port in hotplug control */
-	/* TODO: implement (short) HPD support on port A */
-	WARN_ON_ONCE(hotplug_port & BXT_DE_PORT_HP_DDIA);
+	if (hotplug_port & BXT_DE_PORT_HP_DDIA)
+		hotplug_ctrl |= BXT_DDIA_HPD_ENABLE;
  	if (hotplug_port & BXT_DE_PORT_HP_DDIB)
  		hotplug_ctrl |= BXT_DDIB_HPD_ENABLE;
  	if (hotplug_port & BXT_DE_PORT_HP_DDIC)
  		hotplug_ctrl |= BXT_DDIC_HPD_ENABLE;
  	I915_WRITE(BXT_HOTPLUG_CTL, hotplug_ctrl);
 
-	/* Unmask DDI hotplug in IMR */
  	hotplug_ctrl = I915_READ(GEN8_DE_PORT_IMR) & ~hotplug_port;
  	I915_WRITE(GEN8_DE_PORT_IMR, hotplug_ctrl);
 
-	/* Enable DDI hotplug in IER */
  	hotplug_ctrl = I915_READ(GEN8_DE_PORT_IER) | hotplug_port;
  	I915_WRITE(GEN8_DE_PORT_IER, hotplug_ctrl);
  	POSTING_READ(GEN8_DE_PORT_IER);
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

PATCH 3/3 drm/i915/bxt: WA for swapped HPD pins in A stepping

In reply to Sonika Jindal

WA for BXT A0/A1, where DDIB's HPD pin is swapped to DDIA, so enabling DDIA HPD pin in place of DDIB.

v2: For DP, irq_port is used to determine the encoder instead of hpd_pin and removing the edp HPD logic because port A HPD is not present(Imre)
v3: Rebased on top of Imre's patchset for enabling HPD on PORT A. Added hpd_pin swapping for intel_dp_init_connector, setting encoder for PORT_A as per the WA in irq_port (Imre)
v4: Dont enable interrupt for edp, also reframe the description (Siva)
v5: Don’t check for PORT_A in intel_ddi_init to update dig_port, instead avoid setting hpd_pin itself (Imre)

---
 drivers/gpu/drm/i915/intel_ddi.c  |   10 +++++++++-
 drivers/gpu/drm/i915/intel_dp.c   |    2 ++
 drivers/gpu/drm/i915/intel_hdmi.c |    9 ++++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +9 -1
index e2c6f73..777e3a3 100644
@@ -3225,7 +3225,15 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 			goto err;
 
 		intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
-		dev_priv->hotplug.irq_port[port] = intel_dig_port;
+		/*
+		 * On BXT A0/A1, sw needs to activate DDIA HPD logic and
+		 * interrupts to check the external panel connection.
+		 */
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0)
+					 && port == PORT_B)
+			dev_priv->hotplug.irq_port[PORT_A] = intel_dig_port;
+		else
+			dev_priv->hotplug.irq_port[port] = intel_dig_port;
 	}
 
 	/* In theory we don't need the encoder->type check, but leave it just in
drivers/gpu/drm/i915/intel_dp.c +2 -0
index 5a614c9..7fab3e5 100644
@@ -5788,6 +5788,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 		break;
 	case PORT_B:
 		intel_encoder->hpd_pin = HPD_PORT_B;
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0))
+			intel_encoder->hpd_pin = HPD_PORT_A;
 		break;
 	case PORT_C:
 		intel_encoder->hpd_pin = HPD_PORT_C;
drivers/gpu/drm/i915/intel_hdmi.c +8 -1
index 70bad5b..94fa716 100644
@@ -1973,7 +1973,14 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 			intel_hdmi->ddc_bus = GMBUS_PIN_1_BXT;
 		else
 			intel_hdmi->ddc_bus = GMBUS_PIN_DPB;
-		intel_encoder->hpd_pin = HPD_PORT_B;
+		/*
+		 * On BXT A0/A1, sw needs to activate DDIA HPD logic and
+		 * interrupts to check the external panel connection.
+		 */
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0))
+			intel_encoder->hpd_pin = HPD_PORT_A;
+		else
+			intel_encoder->hpd_pin = HPD_PORT_B;
 		break;
 	case PORT_C:
 		if (IS_BROXTON(dev_priv))
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 3/3
#14 lore raw

Re: [PATCH 3/3] drm/i915/bxt: WA for swapped HPD pins in A stepping

Quoted 74 lines · Sonika Jindal

WA for BXT A0/A1, where DDIB's HPD pin is swapped to DDIA, so enabling DDIA HPD pin in place of DDIB.

v2: For DP, irq_port is used to determine the encoder instead of hpd_pin and removing the edp HPD logic because port A HPD is not present(Imre)
v3: Rebased on top of Imre's patchset for enabling HPD on PORT A. Added hpd_pin swapping for intel_dp_init_connector, setting encoder for PORT_A as per the WA in irq_port (Imre)
v4: Dont enable interrupt for edp, also reframe the description (Siva)
v5: Don’t check for PORT_A in intel_ddi_init to update dig_port, instead avoid setting hpd_pin itself (Imre)

---
  drivers/gpu/drm/i915/intel_ddi.c  |   10 +++++++++-
  drivers/gpu/drm/i915/intel_dp.c   |    2 ++
  drivers/gpu/drm/i915/intel_hdmi.c |    9 ++++++++-
  3 files changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +9 -1
index e2c6f73..777e3a3 100644
@@ -3225,7 +3225,15 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
  			goto err;
 
  		intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
-		dev_priv->hotplug.irq_port[port] = intel_dig_port;
+		/*
+		 * On BXT A0/A1, sw needs to activate DDIA HPD logic and
+		 * interrupts to check the external panel connection.
+		 */
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0)
+					 && port == PORT_B)
+			dev_priv->hotplug.irq_port[PORT_A] = intel_dig_port;
+		else
+			dev_priv->hotplug.irq_port[port] = intel_dig_port;
  	}
 
  	/* In theory we don't need the encoder->type check, but leave it just in
drivers/gpu/drm/i915/intel_dp.c +2 -0
index 5a614c9..7fab3e5 100644
@@ -5788,6 +5788,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
  		break;
  	case PORT_B:
  		intel_encoder->hpd_pin = HPD_PORT_B;
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0))
+			intel_encoder->hpd_pin = HPD_PORT_A;
  		break;
  	case PORT_C:
  		intel_encoder->hpd_pin = HPD_PORT_C;
drivers/gpu/drm/i915/intel_hdmi.c +8 -1
index 70bad5b..94fa716 100644
@@ -1973,7 +1973,14 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
  			intel_hdmi->ddc_bus = GMBUS_PIN_1_BXT;
  		else
  			intel_hdmi->ddc_bus = GMBUS_PIN_DPB;
-		intel_encoder->hpd_pin = HPD_PORT_B;
+		/*
+		 * On BXT A0/A1, sw needs to activate DDIA HPD logic and
+		 * interrupts to check the external panel connection.
+		 */
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0))
+			intel_encoder->hpd_pin = HPD_PORT_A;
+		else
+			intel_encoder->hpd_pin = HPD_PORT_B;
  		break;
  	case PORT_C:
  		if (IS_BROXTON(dev_priv))
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

Re: [PATCH 3/3] drm/i915/bxt: WA for swapped HPD pins in A stepping

Quoted 17 lines · Sivakumar Thulasimani
Quoted 14 lines · Sonika Jindal

WA for BXT A0/A1, where DDIB's HPD pin is swapped to DDIA, so enabling DDIA HPD pin in place of DDIB.

v2: For DP, irq_port is used to determine the encoder instead of hpd_pin and removing the edp HPD logic because port A HPD is not present(Imre)
v3: Rebased on top of Imre's patchset for enabling HPD on PORT A. Added hpd_pin swapping for intel_dp_init_connector, setting encoder for PORT_A as per the WA in irq_port (Imre)
v4: Dont enable interrupt for edp, also reframe the description (Siva)
v5: Don’t check for PORT_A in intel_ddi_init to update dig_port, instead avoid setting hpd_pin itself (Imre)

Merged patches 2&3 from this series, thanks.
-Daniel

Quoted 67 lines
Quoted 58 lines
---
 drivers/gpu/drm/i915/intel_ddi.c  |   10 +++++++++-
 drivers/gpu/drm/i915/intel_dp.c   |    2 ++
 drivers/gpu/drm/i915/intel_hdmi.c |    9 ++++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +9 -1
index e2c6f73..777e3a3 100644
@@ -3225,7 +3225,15 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 			goto err;
 		intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
-		dev_priv->hotplug.irq_port[port] = intel_dig_port;
+		/*
+		 * On BXT A0/A1, sw needs to activate DDIA HPD logic and
+		 * interrupts to check the external panel connection.
+		 */
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0)
+					 && port == PORT_B)
+			dev_priv->hotplug.irq_port[PORT_A] = intel_dig_port;
+		else
+			dev_priv->hotplug.irq_port[port] = intel_dig_port;
 	}
 	/* In theory we don't need the encoder->type check, but leave it just in
drivers/gpu/drm/i915/intel_dp.c +2 -0
index 5a614c9..7fab3e5 100644
@@ -5788,6 +5788,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 		break;
 	case PORT_B:
 		intel_encoder->hpd_pin = HPD_PORT_B;
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0))
+			intel_encoder->hpd_pin = HPD_PORT_A;
 		break;
 	case PORT_C:
 		intel_encoder->hpd_pin = HPD_PORT_C;
drivers/gpu/drm/i915/intel_hdmi.c +8 -1
index 70bad5b..94fa716 100644
@@ -1973,7 +1973,14 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 			intel_hdmi->ddc_bus = GMBUS_PIN_1_BXT;
 		else
 			intel_hdmi->ddc_bus = GMBUS_PIN_DPB;
-		intel_encoder->hpd_pin = HPD_PORT_B;
+		/*
+		 * On BXT A0/A1, sw needs to activate DDIA HPD logic and
+		 * interrupts to check the external panel connection.
+		 */
+		if (IS_BROXTON(dev_priv) && (INTEL_REVID(dev) < BXT_REVID_B0))
+			intel_encoder->hpd_pin = HPD_PORT_A;
+		else
+			intel_encoder->hpd_pin = HPD_PORT_B;
 		break;
 	case PORT_C:
 		if (IS_BROXTON(dev_priv))
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 3/3
#16 lore raw

Re: [PATCH 3/3] drm/i915/bxt: WA for swapped HPD pins in A stepping

In reply to Sonika Jindal

Task id: 7125 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
ILK -1 302/302 301/302

SNB                                  315/315              315/315
IVB                                  336/336              336/336
BYT                                  283/283              283/283
HSW                                  378/378              378/378

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*ILK igt@kms_flip@flip-vs-dpms-interruptible PASS(1) DMESG_WARN(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx