Skip to contentSkip to conversation

drm/i915: (VLV2) Fix the hotplug detection bits

PATCH Superseded Todd Previte 4 participants 15 messages Jan 21, 2014 – Jan 23, 2014

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

PATCH 1/1 drm/i915: (VLV2) Fix the hotplug detection bits

These bits are in reverse order in the header from those defined in the specification. Change the bit positions for ports B and D to correctly match the spec.

---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -2
index 10ecf90..2d77b51 100644
@@ -2083,9 +2083,9 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
+#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 29)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
Signature · 1 line
1.8.3.2
maintainer
#1 lore raw
Quoted 3 lines · Todd Previte

These bits are in reverse order in the header from those defined in the specification. Change the bit positions for ports B and D to correctly match the spec.

Your signed-off-by is missing. The git commit -s option will add it for you.

drivers/gpu/drm/i915/i915_reg.h line 2085

Quoted 12 lines
---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 10ecf90..2d77b51 100644
@@ -2083,9 +2083,9 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */

Please read the comment above, and check out

commit 0ce99f749b3834edeb500e17d6ad17e86b60ff83

Author: Daniel Vetter <[email protected]>
Date:   Fri Jul 26 11:27:49 2013 +0200

drm/i915: fix gen4 digital port hotplug definitions

Since the definitions are used for both pre-PCH and VLV in g4x_dp_detect() we should try to figure out whether the bits are really different between them or not. Or if the VLV specs are confused too.

Meanwhile, I'll go pat myself on the back for seeing this patch coming, and asking for Daniel to add that comment...

BR,
Jani.

Quoted 15 lines
drivers/gpu/drm/i915/i915_reg.h +2 -2
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
+#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 29)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
Signature · 6 lines
1.8.3.2

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

PATCH v2 1/1 drm/i915: (VLV2) Fix the hotplug detection bits

In reply to Todd Previte

These bits are in reverse order in the header from those defined in the specification. Change the bit positions for ports B and D to correctly match the spec.

- Added sign-off

---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -2
index 10ecf90..2d77b51 100644
@@ -2083,9 +2083,9 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
+#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 29)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
Signature · 1 line
1.8.3.2
#3 lore raw
Quoted 17 lines · Todd Previte

These bits are in reverse order in the header from those defined in the specification. Change the bit positions for ports B and D to correctly match the spec.

- Added sign-off

---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 10ecf90..2d77b51 100644

drivers/gpu/drm/i915/i915_reg.h line 2088

Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h +2 -2
@@ -2083,9 +2083,9 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
+#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 29)

As Jani explained, this will break g4x. And it might very well be that this particular lie has been carried forward until baytrail, so I think we must cross check Bspec first with the reality of shipping platforms. -Daniel

Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw
Quoted 22 lines · Daniel Vetter
Quoted 21 lines · Todd Previte

These bits are in reverse order in the header from those defined in the specification. Change the bit positions for ports B and D to correctly match the spec.

- Added sign-off

---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -1
index 10ecf90..2d77b51 100644
@@ -2083,9 +2083,9 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
Quoted 8 lines

drivers/gpu/drm/i915/i915_reg.h line 2088

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +2 -1
+#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 29)

As Jani explained, this will break g4x. And it might very well be that this particular lie has been carried forward until baytrail, so I think we must cross check Bspec first with the reality of shipping platforms.

FYI I just checked this on Jani's ELK, and it agrees with the spec. Port B is bit 29 and port C is bit 28. Both are HDMI/DVI ports on the board. No DP connectors present unfortunately. Which explains why things work since we don't check the live status on HDMI ports.

Signature · 2 lines
Ville Syrjälä
Intel OTC
maintainer
#5 lore raw
In reply to Todd Previte
Quoted 5 lines · Todd Previte

These bits are in reverse order in the header from those defined in the specification. Change the bit positions for ports B and D to correctly match the spec.

- Added sign-off

And please also read the rest of my previous mail! :)

Jani.

Quoted 30 lines
---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -2
index 10ecf90..2d77b51 100644
@@ -2083,9 +2083,9 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
+#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 29)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
Signature · 6 lines
1.8.3.2

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

(no subject)

In reply to Todd Previte

Addresses the comments and feedback herein. VLV2 and gen4 have separate bit definitions now. The correct bits are selected in gen4x_dp_detect() based on the detected platform.

#7 lore raw

PATCH v3 1/1 drm/i915: VLV2 - Fix hotplug detect bits

Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions

---
 drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++---
 drivers/gpu/drm/i915/intel_dp.c | 39 +++++++++++++++++++++++++++------------
 2 files changed, 35 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +8 -3
index 2d77b51..0e65717 100644
@@ -2083,9 +2083,14 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
-#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+/* VLV hot plug bits are different */
+#define   VLV_PORTD_HOTPLUG_LIVE_STATUS	(1 << 27)
+#define   VLV_PORTC_HOTPLUG_LIVE_STATUS	(1 << 28)
+#define   VLV_PORTB_HOTPLUG_LIVE_STATUS	(1 << 29)
+
+#define   PORTD_HOTPLUG_LIVE_STATUS		(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS		(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS		(1 << 27)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
drivers/gpu/drm/i915/intel_dp.c +27 -12
index 1386efb..1f080b2 100644
@@ -2946,18 +2946,33 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 		return status;
 	}
 
-	switch (intel_dig_port->port) {
-	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS;
-		break;
-	default:
-		return connector_status_unknown;
+	if (IS_VALLEYVIEW(dev)) {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = VLV_PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = VLV_PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = VLV_PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+	} else {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
 	}
 
 	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
Signature · 1 line
1.8.3.2
maintainer Reviewed-by on v3 1/1
#8 lore raw

Re: [PATCH v3] drm/i915: VLV2 - Fix hotplug detect bits

Quoted 24 lines · Todd Previte

Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions

---
 drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++---
 drivers/gpu/drm/i915/intel_dp.c | 39 +++++++++++++++++++++++++++------------
 2 files changed, 35 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -1
index 2d77b51..0e65717 100644
@@ -2083,9 +2083,14 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)

drivers/gpu/drm/i915/i915_reg.h line 2093

Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +8 -2
-#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+/* VLV hot plug bits are different */
+#define   VLV_PORTD_HOTPLUG_LIVE_STATUS	(1 << 27)
+#define   VLV_PORTC_HOTPLUG_LIVE_STATUS	(1 << 28)
+#define   VLV_PORTB_HOTPLUG_LIVE_STATUS	(1 << 29)
+
+#define   PORTD_HOTPLUG_LIVE_STATUS		(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS		(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS		(1 << 27)

For future reference, changes unrelated to the commit message are generally frowned upon; style changes (like the spaces-to-tabs change for the existing defines) should be kept separate.

Quoted 60 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
drivers/gpu/drm/i915/intel_dp.c +27 -12
index 1386efb..1f080b2 100644
@@ -2946,18 +2946,33 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 		return status;
 	}
 
-	switch (intel_dig_port->port) {
-	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS;
-		break;
-	default:
-		return connector_status_unknown;
+	if (IS_VALLEYVIEW(dev)) {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = VLV_PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = VLV_PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = VLV_PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+	} else {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
 	}
 
 	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
Signature · 6 lines
1.8.3.2

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

Re: [PATCH v3] drm/i915: VLV2 - Fix hotplug detect bits

In reply to Todd Previte
Quoted 9 lines · Todd Previte

Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions

Btw this might be a relevant bug report:
https://bugs.freedesktop.org/show_bug.cgi?id=73951

Quoted 85 lines
---
 drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++---
 drivers/gpu/drm/i915/intel_dp.c | 39 +++++++++++++++++++++++++++------------
 2 files changed, 35 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +8 -3
index 2d77b51..0e65717 100644
@@ -2083,9 +2083,14 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
-#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+/* VLV hot plug bits are different */
+#define   VLV_PORTD_HOTPLUG_LIVE_STATUS	(1 << 27)
+#define   VLV_PORTC_HOTPLUG_LIVE_STATUS	(1 << 28)
+#define   VLV_PORTB_HOTPLUG_LIVE_STATUS	(1 << 29)
+
+#define   PORTD_HOTPLUG_LIVE_STATUS		(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS		(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS		(1 << 27)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
drivers/gpu/drm/i915/intel_dp.c +27 -12
index 1386efb..1f080b2 100644
@@ -2946,18 +2946,33 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 		return status;
 	}
 
-	switch (intel_dig_port->port) {
-	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS;
-		break;
-	default:
-		return connector_status_unknown;
+	if (IS_VALLEYVIEW(dev)) {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = VLV_PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = VLV_PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = VLV_PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+	} else {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
 	}
 
 	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
Signature · 6 lines
1.8.3.2

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

Re: [PATCH v3] drm/i915: VLV2 - Fix hotplug detect bits

Quoted 4 lines · Jani Nikula
Quoted 3 lines · Todd Previte

Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones.

Quoted 8 lines
Quoted 6 lines

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions

Btw this might be a relevant bug report:
https://bugs.freedesktop.org/show_bug.cgi?id=73951

Yeah looks like it. I think this patch (well V4 below) should address the problem. I'll update the bug momentarily.

-T

Quoted 85 lines
Quoted 85 lines
---
  drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++---
  drivers/gpu/drm/i915/intel_dp.c | 39 +++++++++++++++++++++++++++------------
  2 files changed, 35 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +8 -3
index 2d77b51..0e65717 100644
@@ -2083,9 +2083,14 @@
   * Please check the detailed lore in the commit message for for experimental
   * evidence.
   */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
-#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+/* VLV hot plug bits are different */
+#define   VLV_PORTD_HOTPLUG_LIVE_STATUS	(1 << 27)
+#define   VLV_PORTC_HOTPLUG_LIVE_STATUS	(1 << 28)
+#define   VLV_PORTB_HOTPLUG_LIVE_STATUS	(1 << 29)
+
+#define   PORTD_HOTPLUG_LIVE_STATUS		(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS		(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS		(1 << 27)
  #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
  #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
  #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
drivers/gpu/drm/i915/intel_dp.c +27 -12
index 1386efb..1f080b2 100644
@@ -2946,18 +2946,33 @@ g4x_dp_detect(struct intel_dp *intel_dp)
  		return status;
  	}
 
-	switch (intel_dig_port->port) {
-	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS;
-		break;
-	default:
-		return connector_status_unknown;
+	if (IS_VALLEYVIEW(dev)) {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = VLV_PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = VLV_PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = VLV_PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+	} else {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
  	}
 
  	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
Signature · 6 lines
1.8.3.2

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

PATCH v4 1/1 drm/i915: VLV2 - Fix hotplug detect bits

Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions
- Replaced a lost trailing brace for the added switch()

---
 drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++---
 drivers/gpu/drm/i915/intel_dp.c | 40 ++++++++++++++++++++++++++++------------
 2 files changed, 36 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +8 -3
index 10ecf90..0e65717 100644
@@ -2083,9 +2083,14 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
-#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+/* VLV hot plug bits are different */
+#define   VLV_PORTD_HOTPLUG_LIVE_STATUS	(1 << 27)
+#define   VLV_PORTC_HOTPLUG_LIVE_STATUS	(1 << 28)
+#define   VLV_PORTB_HOTPLUG_LIVE_STATUS	(1 << 29)
+
+#define   PORTD_HOTPLUG_LIVE_STATUS		(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS		(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS		(1 << 27)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
drivers/gpu/drm/i915/intel_dp.c +28 -12
index 1386efb..51c6497 100644
@@ -2946,18 +2946,34 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 		return status;
 	}
 
-	switch (intel_dig_port->port) {
-	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS;
-		break;
-	default:
-		return connector_status_unknown;
+	if (IS_VALLEYVIEW(dev)) {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = VLV_PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = VLV_PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = VLV_PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
+	} else {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
 	}
 
 	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
Signature · 1 line
1.8.3.2
#13 lore raw

Re: [PATCH V4] drm/i915: VLV2 - Fix hotplug detect bits

Quoted 11 lines · Todd Previte

Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions
- Replaced a lost trailing brace for the added switch()

I've bikeshedded your patch a bit for more consistency. Wrt the patch changelog please don't smash it all into one but keep a separate changelog per revision. Otherwise it's not clear what e.g. changed from v3->v4 and so no too useful for reviewers when rechecking patches. -Daniel

Quoted 85 lines
---
 drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++---
 drivers/gpu/drm/i915/intel_dp.c | 40 ++++++++++++++++++++++++++++------------
 2 files changed, 36 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +8 -3
index 10ecf90..0e65717 100644
@@ -2083,9 +2083,14 @@
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
-#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+/* VLV hot plug bits are different */
+#define   VLV_PORTD_HOTPLUG_LIVE_STATUS	(1 << 27)
+#define   VLV_PORTC_HOTPLUG_LIVE_STATUS	(1 << 28)
+#define   VLV_PORTB_HOTPLUG_LIVE_STATUS	(1 << 29)
+
+#define   PORTD_HOTPLUG_LIVE_STATUS		(1 << 29)
+#define   PORTC_HOTPLUG_LIVE_STATUS		(1 << 28)
+#define   PORTB_HOTPLUG_LIVE_STATUS		(1 << 27)
 #define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
drivers/gpu/drm/i915/intel_dp.c +28 -12
index 1386efb..51c6497 100644
@@ -2946,18 +2946,34 @@ g4x_dp_detect(struct intel_dp *intel_dp)
 		return status;
 	}
 
-	switch (intel_dig_port->port) {
-	case PORT_B:
-		bit = PORTB_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_C:
-		bit = PORTC_HOTPLUG_LIVE_STATUS;
-		break;
-	case PORT_D:
-		bit = PORTD_HOTPLUG_LIVE_STATUS;
-		break;
-	default:
-		return connector_status_unknown;
+	if (IS_VALLEYVIEW(dev)) {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = VLV_PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = VLV_PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = VLV_PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
+	} else {
+		switch (intel_dig_port->port) {
+		case PORT_B:
+			bit = PORTB_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_C:
+			bit = PORTC_HOTPLUG_LIVE_STATUS;
+			break;
+		case PORT_D:
+			bit = PORTD_HOTPLUG_LIVE_STATUS;
+			break;
+		default:
+			return connector_status_unknown;
+		}
 	}
 
 	if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#14 lore raw

Re: [PATCH V4] drm/i915: VLV2 - Fix hotplug detect bits

Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Todd Previte

Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions
- Replaced a lost trailing brace for the added switch()

Quoted 6 lines
Quoted 1 line

I've bikeshedded your patch a bit for more consistency. Wrt the patch changelog please don't smash it all into one but keep a separate changelog per revision. Otherwise it's not clear what e.g. changed from v3->v4 and so no too useful for reviewers when rechecking patches.

Also please add bugzilla links and cc: stable for bugfixes like these into the sob section of the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch