Skip to content

Commit fecbaa0

Browse files
Wenjing Liualexdeucher
authored andcommitted
drm/amd/display: save and restore mall state when applying minimal transition
[why] There is a case when we are switching from ODM combine to Subvp where minimal transition based off subvp state is required. In thise case, we need to save and restore mall state when applying minimal transition. Reviewed-by: Dillon Varone <dillon.varone@amd.com> Acked-by: Hersen Wu <hersenxs.wu@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 62893e9 commit fecbaa0

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • drivers/gpu/drm/amd/display/dc/core

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4116,8 +4116,17 @@ static bool commit_minimal_transition_state_for_windowed_mpo_odm(struct dc *dc,
41164116
bool success = false;
41174117
struct dc_state *minimal_transition_context;
41184118
struct pipe_split_policy_backup policy;
4119+
struct mall_temp_config mall_temp_config;
41194120

41204121
/* commit based on new context */
4122+
/* Since all phantom pipes are removed in full validation,
4123+
* we have to save and restore the subvp/mall config when
4124+
* we do a minimal transition since the flags marking the
4125+
* pipe as subvp/phantom will be cleared (dc copy constructor
4126+
* creates a shallow copy).
4127+
*/
4128+
if (dc->res_pool->funcs->save_mall_state)
4129+
dc->res_pool->funcs->save_mall_state(dc, context, &mall_temp_config);
41214130
minimal_transition_context = create_minimal_transition_state(dc,
41224131
context, &policy);
41234132
if (minimal_transition_context) {
@@ -4126,9 +4135,20 @@ static bool commit_minimal_transition_state_for_windowed_mpo_odm(struct dc *dc,
41264135
dc->hwss.is_pipe_topology_transition_seamless(
41274136
dc, minimal_transition_context, context)) {
41284137
DC_LOG_DC("%s base = new state\n", __func__);
4138+
41294139
success = dc_commit_state_no_check(dc, minimal_transition_context) == DC_OK;
41304140
}
41314141
release_minimal_transition_state(dc, minimal_transition_context, &policy);
4142+
if (dc->res_pool->funcs->restore_mall_state)
4143+
dc->res_pool->funcs->restore_mall_state(dc, context, &mall_temp_config);
4144+
/* If we do a minimal transition with plane removal and the context
4145+
* has subvp we also have to retain back the phantom stream / planes
4146+
* since the refcount is decremented as part of the min transition
4147+
* (we commit a state with no subvp, so the phantom streams / planes
4148+
* had to be removed).
4149+
*/
4150+
if (dc->res_pool->funcs->retain_phantom_pipes)
4151+
dc->res_pool->funcs->retain_phantom_pipes(dc, context);
41324152
}
41334153

41344154
if (!success) {

0 commit comments

Comments
 (0)