Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: skip commit minimal transition state

[WHY]
Now dynamic ODM will now be disabled when MPO is required safe
transitions to avoid underflow, but we are triggering the way of minimal
transition too often. Commit state of dc with no check will do pipeline
setup which may re-initialize the component with no need such as audio.

[HOW]
Just do the minimal transition when all of pipes are in use, otherwise
return true to skip.

Tested-by: Mark Broadworth <mark.broadworth@amd.com>
Reviewed-by: Dillon Varone <Dillon.Varone@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: zhikzhai <zhikai.zhai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

zhikzhai and committed by
Alex Deucher
1e8fd864 203ccaf5

+22
+22
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 3738 3738 bool temp_subvp_policy; 3739 3739 enum dc_status ret = DC_ERROR_UNEXPECTED; 3740 3740 unsigned int i, j; 3741 + unsigned int pipe_in_use = 0; 3741 3742 3742 3743 if (!transition_context) 3743 3744 return false; 3745 + 3746 + /* check current pipes in use*/ 3747 + for (i = 0; i < dc->res_pool->pipe_count; i++) { 3748 + struct pipe_ctx *pipe = &transition_base_context->res_ctx.pipe_ctx[i]; 3749 + 3750 + if (pipe->plane_state) 3751 + pipe_in_use++; 3752 + } 3753 + 3754 + /* When the OS add a new surface if we have been used all of pipes with odm combine 3755 + * and mpc split feature, it need use commit_minimal_transition_state to transition safely. 3756 + * After OS exit MPO, it will back to use odm and mpc split with all of pipes, we need 3757 + * call it again. Otherwise return true to skip. 3758 + * 3759 + * Reduce the scenarios to use dc_commit_state_no_check in the stage of flip. Especially 3760 + * enter/exit MPO when DCN still have enough resources. 3761 + */ 3762 + if (pipe_in_use != dc->res_pool->pipe_count) { 3763 + dc_release_state(transition_context); 3764 + return true; 3765 + } 3744 3766 3745 3767 if (!dc->config.is_vmin_only_asic) { 3746 3768 tmp_mpc_policy = dc->debug.pipe_split_policy;