drm/i915: fix lane bandwidth capping for DP 1.2 sinks
Subsystems (2)
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
@@ -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
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.
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/i915/intel_dp.c +0
-0
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
-1break ;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
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.
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/i915/intel_dp.c +0
-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 ];
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
-1break ;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
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.
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/i915/intel_dp.c +0
-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 ];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_4for 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
PATCH v2 1/1 drm/i915: fix lane bandwidth capping for DP 1.2 sinks
In reply to Imre DeakDP 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
@@ -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
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)Signed-off-by Imre Deak <[email protected]>
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
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
Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/i915/intel_dp.c +0
-0
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
-0case 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