Skip to content

Commit 1119e1f

Browse files
Lyudealexdeucher
authored andcommitted
drm/amdgpu/display/mst: Fix mst_state->pbn_div and slot count assignments
Looks like I made a pretty big mistake here without noticing: it seems when I moved the assignments of mst_state->pbn_div I completely missed the fact that the reason for us calling drm_dp_mst_update_slots() earlier was to account for the fact that we need to call this function using info from the root MST connector, instead of just trying to do this from each MST encoder's atomic check function. Otherwise, we end up filling out all of DC's link information with zeroes. So, let's restore that and hopefully fix this DSC regression. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2171 Signed-off-by: Lyude Paul <[email protected]> Signed-off-by: Harry Wentland <[email protected]> Fixes: 4d07b0b ("drm/display/dp_mst: Move all payload info into the atomic state") Cc: [email protected] # 6.1 Reviewed-by: Harry Wentland <[email protected]> Tested-by: Didier Raboud <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f0f7743 commit 1119e1f

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9490,6 +9490,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
94909490
struct drm_connector_state *old_con_state, *new_con_state;
94919491
struct drm_crtc *crtc;
94929492
struct drm_crtc_state *old_crtc_state, *new_crtc_state;
9493+
struct drm_dp_mst_topology_mgr *mgr;
9494+
struct drm_dp_mst_topology_state *mst_state;
94939495
struct drm_plane *plane;
94949496
struct drm_plane_state *old_plane_state, *new_plane_state;
94959497
enum dc_status status;
@@ -9745,6 +9747,28 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
97459747
lock_and_validation_needed = true;
97469748
}
97479749

9750+
#if defined(CONFIG_DRM_AMD_DC_DCN)
9751+
/* set the slot info for each mst_state based on the link encoding format */
9752+
for_each_new_mst_mgr_in_state(state, mgr, mst_state, i) {
9753+
struct amdgpu_dm_connector *aconnector;
9754+
struct drm_connector *connector;
9755+
struct drm_connector_list_iter iter;
9756+
u8 link_coding_cap;
9757+
9758+
drm_connector_list_iter_begin(dev, &iter);
9759+
drm_for_each_connector_iter(connector, &iter) {
9760+
if (connector->index == mst_state->mgr->conn_base_id) {
9761+
aconnector = to_amdgpu_dm_connector(connector);
9762+
link_coding_cap = dc_link_dp_mst_decide_link_encoding_format(aconnector->dc_link);
9763+
drm_dp_mst_update_slots(mst_state, link_coding_cap);
9764+
9765+
break;
9766+
}
9767+
}
9768+
drm_connector_list_iter_end(&iter);
9769+
}
9770+
#endif
9771+
97489772
/**
97499773
* Streams and planes are reset when there are changes that affect
97509774
* bandwidth. Anything that affects bandwidth needs to go through

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -903,11 +903,6 @@ static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,
903903
if (IS_ERR(mst_state))
904904
return PTR_ERR(mst_state);
905905

906-
mst_state->pbn_div = dm_mst_get_pbn_divider(dc_link);
907-
#if defined(CONFIG_DRM_AMD_DC_DCN)
908-
drm_dp_mst_update_slots(mst_state, dc_link_dp_mst_decide_link_encoding_format(dc_link));
909-
#endif
910-
911906
/* Set up params */
912907
for (i = 0; i < dc_state->stream_count; i++) {
913908
struct dc_dsc_policy dsc_policy = {0};

0 commit comments

Comments
 (0)