drm/amd/display: build scaling params when a new plane is appended

[why & how]
We are boundling changes in plane state and build scaling params
together. This is to simplify DML code so DML doesn't need to build
scaling params. We are also avoiding rebuilding scaling params for
planes without scaling changes.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@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>
This commit is contained in:
Wenjing Liu
2024-03-12 14:21:07 -04:00
committed by Alex Deucher
parent 57b1ce8384
commit 506d32ee9f
2 changed files with 12 additions and 3 deletions

View File

@@ -3236,7 +3236,10 @@ static bool update_planes_and_stream_state(struct dc *dc,
for (i = 0; i < surface_count; i++) {
struct dc_plane_state *surface = srf_updates[i].surface;
if (update_type >= UPDATE_TYPE_MED) {
if (update_type != UPDATE_TYPE_MED)
continue;
if (surface->update_flags.bits.clip_size_change ||
surface->update_flags.bits.position_change) {
for (j = 0; j < dc->res_pool->pipe_count; j++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];

View File

@@ -2649,13 +2649,19 @@ bool resource_append_dpp_pipes_for_plane_composition(
struct pipe_ctx *otg_master_pipe,
struct dc_plane_state *plane_state)
{
bool success;
if (otg_master_pipe->plane_state == NULL)
return add_plane_to_opp_head_pipes(otg_master_pipe,
success = add_plane_to_opp_head_pipes(otg_master_pipe,
plane_state, new_ctx);
else
return acquire_secondary_dpp_pipes_and_add_plane(
success = acquire_secondary_dpp_pipes_and_add_plane(
otg_master_pipe, plane_state, new_ctx,
cur_ctx, pool);
if (success)
/* when appending a plane mpc slice count changes from 0 to 1 */
success = update_pipe_params_after_mpc_slice_count_change(
plane_state, new_ctx, pool);
return success;
}
void resource_remove_dpp_pipes_for_plane_composition(