Skip to content

Commit 16f2e14

Browse files
Fangzhi Zuoalexdeucher
authored andcommitted
drm/amd/display: Skip Check Runtime Link Setting for Specific Branch Device
[why] Read link setting inside mode validation is not always the final downlink setting. It is found true in Synaptics branch device. At bootup, the preferred mode being set right after 1080p is set. It occurred before graphic load. That modeset switch in a short period of time makes the branch device switch back and forth from lower and higher link rate, observed at Synaptics branch device. DP2 RTK hub on the other hand, sticks to highest available downlink rate after bootup. Existing check of runtime downlink setting in mode validation shows asynchronous at branch device link switch, i.e., downlink switch to higher link rate not yet complete when the mode validation tries to probe the downlink setting. That makes mode validation checking downlink setting making wrong decision by pruning modes that should pass the validation after the downlink setting switch is complete. [how] If Synaptics is found at the last branch, skip checking downlink setting at mode validation. Reviewed-by: Wayne Lin <wayne.lin@amd.com> Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 645f74f commit 16f2e14

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,9 @@ struct amdgpu_dm_connector {
768768
uint16_t vc_full_pbn;
769769
struct mutex handle_mst_msg_ready;
770770

771+
/* branch device specific data */
772+
uint32_t branch_ieee_oui;
773+
771774
/* TODO see if we can merge with ddc_bus or make a dm_connector */
772775
struct amdgpu_i2c_adapter *i2c;
773776

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,34 @@ static bool retrieve_downstream_port_device(struct amdgpu_dm_connector *aconnect
330330
return true;
331331
}
332332

333+
static bool retrieve_branch_specific_data(struct amdgpu_dm_connector *aconnector)
334+
{
335+
struct drm_connector *connector = &aconnector->base;
336+
struct drm_dp_mst_port *port = aconnector->mst_output_port;
337+
struct drm_dp_mst_port *port_parent;
338+
struct drm_dp_aux *immediate_upstream_aux;
339+
struct drm_dp_desc branch_desc;
340+
341+
if (!port->parent)
342+
return false;
343+
344+
port_parent = port->parent->port_parent;
345+
346+
immediate_upstream_aux = port_parent ? &port_parent->aux : port->mgr->aux;
347+
348+
if (drm_dp_read_desc(immediate_upstream_aux, &branch_desc, true))
349+
return false;
350+
351+
aconnector->branch_ieee_oui = (branch_desc.ident.oui[0] << 16) +
352+
(branch_desc.ident.oui[1] << 8) +
353+
(branch_desc.ident.oui[2]);
354+
355+
drm_dbg_dp(port->aux.drm_dev, "MST branch oui 0x%x detected at %s\n",
356+
aconnector->branch_ieee_oui, connector->name);
357+
358+
return true;
359+
}
360+
333361
static int dm_dp_mst_get_modes(struct drm_connector *connector)
334362
{
335363
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
@@ -669,6 +697,9 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
669697

670698
drm_connector_set_path_property(connector, pathprop);
671699

700+
if (!retrieve_branch_specific_data(aconnector))
701+
aconnector->branch_ieee_oui = 0;
702+
672703
/*
673704
* Initialize connector state before adding the connectror to drm and
674705
* framebuffer lists
@@ -1774,6 +1805,9 @@ static bool dp_get_link_current_set_bw(struct drm_dp_aux *aux, uint32_t *cur_lin
17741805
link_bw_set = data[DP_LINK_BW_SET - DP_LINK_BW_SET];
17751806
lane_count.raw = data[DP_LANE_COUNT_SET - DP_LINK_BW_SET];
17761807

1808+
drm_dbg_dp(aux->drm_dev, "MST_DSC downlink setting: %d, 0x%x x %d\n",
1809+
dp_link_encoding, link_bw_set, lane_count.bits.LANE_COUNT_SET);
1810+
17771811
switch (dp_link_encoding) {
17781812
case DP_8b_10b_ENCODING:
17791813
link_rate = link_bw_set;
@@ -1870,8 +1904,10 @@ enum dc_status dm_dp_mst_is_port_support_mode(
18701904
end_link_bw = aconnector->mst_local_bw;
18711905
}
18721906

1873-
if (end_link_bw > 0 && stream_kbps > end_link_bw) {
1874-
DRM_DEBUG_DRIVER("MST_DSC dsc decode at last link."
1907+
if (end_link_bw > 0 &&
1908+
stream_kbps > end_link_bw &&
1909+
aconnector->branch_ieee_oui != DP_BRANCH_DEVICE_ID_90CC24) {
1910+
DRM_DEBUG_DRIVER("MST_DSC dsc decode at last link. "
18751911
"Mode required bw can't fit into last link\n");
18761912
return DC_FAIL_BANDWIDTH_VALIDATE;
18771913
}

0 commit comments

Comments
 (0)