Skip to contentSkip to conversation

drm/dp: Fix bogus DPCD version check in drm_dp_read_downstream_info()

PATCH In review Lyude Paul 2 participants 2 messages May 7, 2021 – May 10, 2021

Subsystems (2)
lore
Share & tools
lore

Lyude Paul

author
#0 lore raw

PATCH 1/1 drm/dp: Fix bogus DPCD version check in drm_dp_read_downstream_info()

Ville pointed this out to me when fixing some issues in drm_dp_read_downstream_info() - the DPCD version check here is bogus as there's no DisplayPort versions prior to 1.0. The original code from i915 that this was extracted from actually did:

dpcd[DP_DPCD_REV] == DP_DPCD_REV_10

Which is correct, and somehow got missed when extracting this function. So let's fix this. Note that as far as I'm aware, I don't think this fixes any actual issues users are hitting.

Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_dp_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_dp_helper.c +1 -1
index 0f84df8798ab..55b53df6ce34 100644
@@ -677,7 +677,7 @@ int drm_dp_read_downstream_info(struct drm_dp_aux *aux,
 	memset(downstream_ports, 0, DP_MAX_DOWNSTREAM_PORTS);
 
 	/* No downstream info to read */
-	if (!drm_dp_is_branch(dpcd) || dpcd[DP_DPCD_REV] < DP_DPCD_REV_10)
+	if (!drm_dp_is_branch(dpcd) || dpcd[DP_DPCD_REV] == DP_DPCD_REV_10)
 		return 0;
 
 	/* Some branches advertise having 0 downstream ports, despite also advertising they have a
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Lyude Paul

Ville pointed this out to me when fixing some issues in drm_dp_read_downstream_info() - the DPCD version check here is bogus as there's no DisplayPort versions prior to 1.0. The original code from i915 that this was extracted from actually did:

Quoted 8 lines

dpcd[DP_DPCD_REV] == DP_DPCD_REV_10

Which is correct, and somehow got missed when extracting this function. So let's fix this. Note that as far as I'm aware, I don't think this fixes any actual issues users are hitting.

Cc Ville Syrjälä <[email protected]>
Quoted 19 lines
---
 drivers/gpu/drm/drm_dp_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_dp_helper.c +1 -1
index 0f84df8798ab..55b53df6ce34 100644
@@ -677,7 +677,7 @@ int drm_dp_read_downstream_info(struct drm_dp_aux *aux,
 	memset(downstream_ports, 0, DP_MAX_DOWNSTREAM_PORTS);
 
 	/* No downstream info to read */
-	if (!drm_dp_is_branch(dpcd) || dpcd[DP_DPCD_REV] < DP_DPCD_REV_10)
+	if (!drm_dp_is_branch(dpcd) || dpcd[DP_DPCD_REV] == DP_DPCD_REV_10)
 		return 0;
 
 	/* Some branches advertise having 0 downstream ports, despite also advertising they have a
Signature · 1 line
2.30.2
Signature · 2 lines
Ville Syrjälä
Intel