Skip to content

Commit 4a9a918

Browse files
Wayne Linalexdeucher
authored andcommitted
drm/amd/display: Reduce accessing remote DPCD overhead
[Why] Observed frame rate get dropped by tool like glxgear. Even though the output to monitor is 60Hz, the rendered frame rate drops to 30Hz lower. It's due to code path in some cases will trigger dm_dp_mst_is_port_support_mode() to read out remote Link status to assess the available bandwidth for dsc maniplation. Overhead of keep reading remote DPCD is considerable. [How] Store the remote link BW in mst_local_bw and use end-to-end full_pbn as an indicator to decide whether update the remote link bw or not. Whenever we need the info to assess the BW, visit the stored one first. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3720 Fixes: fa57924 ("drm/amd/display: Refactor function dm_dp_mst_is_port_support_mode()") Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Jerry Zuo <[email protected]> Signed-off-by: Wayne Lin <[email protected]> Signed-off-by: Tom Chung <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent a04d953 commit 4a9a918

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ struct amdgpu_dm_connector {
699699
struct drm_dp_mst_port *mst_output_port;
700700
struct amdgpu_dm_connector *mst_root;
701701
struct drm_dp_aux *dsc_aux;
702+
uint32_t mst_local_bw;
703+
uint16_t vc_full_pbn;
702704
struct mutex handle_mst_msg_ready;
703705

704706
/* TODO see if we can merge with ddc_bus or make a dm_connector */

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

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ amdgpu_dm_mst_connector_late_register(struct drm_connector *connector)
155155
return 0;
156156
}
157157

158+
159+
static inline void
160+
amdgpu_dm_mst_reset_mst_connector_setting(struct amdgpu_dm_connector *aconnector)
161+
{
162+
aconnector->drm_edid = NULL;
163+
aconnector->dsc_aux = NULL;
164+
aconnector->mst_output_port->passthrough_aux = NULL;
165+
aconnector->mst_local_bw = 0;
166+
aconnector->vc_full_pbn = 0;
167+
}
168+
158169
static void
159170
amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector)
160171
{
@@ -182,9 +193,7 @@ amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector)
182193

183194
dc_sink_release(dc_sink);
184195
aconnector->dc_sink = NULL;
185-
aconnector->drm_edid = NULL;
186-
aconnector->dsc_aux = NULL;
187-
port->passthrough_aux = NULL;
196+
amdgpu_dm_mst_reset_mst_connector_setting(aconnector);
188197
}
189198

190199
aconnector->mst_status = MST_STATUS_DEFAULT;
@@ -504,9 +513,7 @@ dm_dp_mst_detect(struct drm_connector *connector,
504513

505514
dc_sink_release(aconnector->dc_sink);
506515
aconnector->dc_sink = NULL;
507-
aconnector->drm_edid = NULL;
508-
aconnector->dsc_aux = NULL;
509-
port->passthrough_aux = NULL;
516+
amdgpu_dm_mst_reset_mst_connector_setting(aconnector);
510517

511518
amdgpu_dm_set_mst_status(&aconnector->mst_status,
512519
MST_REMOTE_EDID | MST_ALLOCATE_NEW_PAYLOAD | MST_CLEAR_ALLOCATED_PAYLOAD,
@@ -1819,9 +1826,18 @@ enum dc_status dm_dp_mst_is_port_support_mode(
18191826
struct drm_dp_mst_port *immediate_upstream_port = NULL;
18201827
uint32_t end_link_bw = 0;
18211828

1822-
/*Get last DP link BW capability*/
1823-
if (dp_get_link_current_set_bw(&aconnector->mst_output_port->aux, &end_link_bw)) {
1824-
if (stream_kbps > end_link_bw) {
1829+
/*Get last DP link BW capability. Mode shall be supported by Legacy peer*/
1830+
if (aconnector->mst_output_port->pdt != DP_PEER_DEVICE_DP_LEGACY_CONV &&
1831+
aconnector->mst_output_port->pdt != DP_PEER_DEVICE_NONE) {
1832+
if (aconnector->vc_full_pbn != aconnector->mst_output_port->full_pbn) {
1833+
dp_get_link_current_set_bw(&aconnector->mst_output_port->aux, &end_link_bw);
1834+
aconnector->vc_full_pbn = aconnector->mst_output_port->full_pbn;
1835+
aconnector->mst_local_bw = end_link_bw;
1836+
} else {
1837+
end_link_bw = aconnector->mst_local_bw;
1838+
}
1839+
1840+
if (end_link_bw > 0 && stream_kbps > end_link_bw) {
18251841
DRM_DEBUG_DRIVER("MST_DSC dsc decode at last link."
18261842
"Mode required bw can't fit into last link\n");
18271843
return DC_FAIL_BANDWIDTH_VALIDATE;

0 commit comments

Comments
 (0)