Skip to contentSkip to conversation

drm/i915: fix lane bandwidth capping for DP 1.2 sinks

PATCH Superseded Imre Deak 3 participants 7 messages Jul 9, 2013

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/1 drm/i915: fix lane bandwidth capping for DP 1.2 sinks

DP 1.2 compatible displays may report a 5.4Gbps maximum bandwidth which the driver will treat as an invalid value and use 1.62Gbps instead. Fix this by capping to 2.7Gbps anything beyond the DP 1.1 bandwidth range.

---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +5 -0
index 11eb697..c6dd61f 100644
@@ -71,11 +71,16 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
 {
 	int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
 
+	if (max_link_bw > DP_LINK_BW_2_7)
+		return DP_LINK_BW_2_7;
+
 	switch (max_link_bw) {
 	case DP_LINK_BW_1_62:
 	case DP_LINK_BW_2_7:
 		break;
 	default:
+		WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
+		     max_link_bw);
 		max_link_bw = DP_LINK_BW_1_62;
 		break;
 	}
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 14 lines · Imre Deak

DP 1.2 compatible displays may report a 5.4Gbps maximum bandwidth which the driver will treat as an invalid value and use 1.62Gbps instead. Fix this by capping to 2.7Gbps anything beyond the DP 1.1 bandwidth range.

---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index 11eb697..c6dd61f 100644

drivers/gpu/drm/i915/intel_dp.c intel_dp_max_link_bw(struct intel_dp *intel_dp) · line 79

Quoted 9 lines
drivers/gpu/drm/i915/intel_dp.c +3 -0
@@ -71,11 +71,16 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
 {
        int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
 
+       if (max_link_bw > DP_LINK_BW_2_7)
+               return DP_LINK_BW_2_7;
+
        switch (max_link_bw) {
        case DP_LINK_BW_1_62:
        case DP_LINK_BW_2_7:

Shouldn't we just add a new case for 5.4 GHz and cap it appropriately. As is we'll eat any bogus value > BW_2_7 ...
-Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +2 -1
                break;
        default:
+               WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
+                    max_link_bw);
                max_link_bw = DP_LINK_BW_1_62;
                break;
        }
--

1.8.1.2

Quoted 4 lines

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

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

author
#2 lore raw
Quoted 18 lines · Daniel Vetter
Quoted 17 lines · Imre Deak

DP 1.2 compatible displays may report a 5.4Gbps maximum bandwidth which the driver will treat as an invalid value and use 1.62Gbps instead. Fix this by capping to 2.7Gbps anything beyond the DP 1.1 bandwidth range.

---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index 11eb697..c6dd61f 100644
@@ -71,11 +71,16 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
 {
        int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
 
Quoted 9 lines

drivers/gpu/drm/i915/intel_dp.c intel_dp_max_link_bw(struct intel_dp *intel_dp) · line 79

Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c +3 -0
+       if (max_link_bw > DP_LINK_BW_2_7)
+               return DP_LINK_BW_2_7;
+
        switch (max_link_bw) {
        case DP_LINK_BW_1_62:
        case DP_LINK_BW_2_7:

Shouldn't we just add a new case for 5.4 GHz and cap it appropriately. As is we'll eat any bogus value > BW_2_7 ...

I thought that this is more future proof. We would add proper 5.4 support as part of a bigger 1.2 enabling work, having there a similar capping to BW_5_4 for post DP 1.2 sinks.

Quoted 19 lines

-Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +2 -1
                break;
        default:
+               WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
+                    max_link_bw);
                max_link_bw = DP_LINK_BW_1_62;
                break;
        }
--

1.8.1.2

Quoted 4 lines

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

Quoted 4 lines

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

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

#3 lore raw
Quoted 29 lines · Imre Deak
Quoted 18 lines · Daniel Vetter
Quoted 17 lines · Imre Deak

DP 1.2 compatible displays may report a 5.4Gbps maximum bandwidth which the driver will treat as an invalid value and use 1.62Gbps instead. Fix this by capping to 2.7Gbps anything beyond the DP 1.1 bandwidth range.

---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index 11eb697..c6dd61f 100644
@@ -71,11 +71,16 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
 {
        int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
 
Quoted 9 lines

drivers/gpu/drm/i915/intel_dp.c intel_dp_max_link_bw(struct intel_dp *intel_dp) · line 79

Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c +3 -0
+       if (max_link_bw > DP_LINK_BW_2_7)
+               return DP_LINK_BW_2_7;
+
        switch (max_link_bw) {
        case DP_LINK_BW_1_62:
        case DP_LINK_BW_2_7:

Shouldn't we just add a new case for 5.4 GHz and cap it appropriately. As is we'll eat any bogus value > BW_2_7 ...

Quoted 3 lines

I thought that this is more future proof. We would add proper 5.4 support as part of a bigger 1.2 enabling work, having there a similar capping to BW_5_4 for post DP 1.2 sinks.

Presuming of course that they don't introduce a new low power low frequency update using a randomly high dpcd value of, for example, 0xf. Hence warning and going with the lowest supported value. -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
author
#4 lore raw

PATCH v2 1/1 drm/i915: fix lane bandwidth capping for DP 1.2 sinks

In reply to Imre Deak

DP 1.2 compatible displays may report a 5.4Gbps maximum bandwidth which the driver will treat as an invalid value and use 1.62Gbps instead. Fix this by capping to 2.7Gbps for sinks reporting a 5.4Gbps max bw.

Also add a warning for reserved values.

v2:
- allow only bw values explicitly listed in the DP standard (Daniel, Chris)

---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +5 -0
index 11eb697..7db2cd7 100644
@@ -75,7 +75,12 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
 	case DP_LINK_BW_1_62:
 	case DP_LINK_BW_2_7:
 		break;
+	case DP_LINK_BW_5_4: /* 1.2 capable displays may advertise higher bw */
+		max_link_bw = DP_LINK_BW_2_7;
+		break;
 	default:
+		WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
+		     max_link_bw);
 		max_link_bw = DP_LINK_BW_1_62;
 		break;
 	}
Signature · 1 line
1.8.1.2
#5 lore raw
Quoted 11 lines · Imre Deak

DP 1.2 compatible displays may report a 5.4Gbps maximum bandwidth which the driver will treat as an invalid value and use 1.62Gbps instead. Fix this by capping to 2.7Gbps for sinks reporting a 5.4Gbps max bw.

Also add a warning for reserved values.

v2:
- allow only bw values explicitly listed in the DP standard (Daniel, Chris)

lgtm. Picked up for -fixes, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#6 lore raw
In reply to Imre Deak
Quoted 3 lines · Imre Deak

DP 1.2 compatible displays may report a 5.4Gbps maximum bandwidth which the driver will treat as an invalid value and use 1.62Gbps instead. Fix this by capping to 2.7Gbps anything beyond the DP 1.1 bandwidth range.

Comments inline.

Quoted 10 lines
---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index 11eb697..c6dd61f 100644

drivers/gpu/drm/i915/intel_dp.c intel_dp_max_link_bw(struct intel_dp *intel_dp) · line 77

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c +3 -0
@@ -71,11 +71,16 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
 {
 	int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
 
+	if (max_link_bw > DP_LINK_BW_2_7)
+		return DP_LINK_BW_2_7;
+
 	switch (max_link_bw) {

I think putting it here is preferrable:
case DP_LINK_BW_5_4: /* 1.2 capable displays may advertise higher bw */

       max_link_bw = DP_LINK_BW_2_7;
       break;

Then we still get the WARN for unknown values greater than 0xa.

Quoted 8 lines
drivers/gpu/drm/i915/intel_dp.c +2 -0
 	case DP_LINK_BW_1_62:
 	case DP_LINK_BW_2_7:
 		break;
 	default:
+		WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
+		     max_link_bw);
 		max_link_bw = DP_LINK_BW_1_62;
 		break;
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre