]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: build scaling params when a new plane is appended
authorWenjing Liu <wenjing.liu@amd.com>
Tue, 12 Mar 2024 18:21:07 +0000 (14:21 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Mar 2024 05:40:38 +0000 (01:40 -0400)
[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>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 8d042651b6fed7e5723518e66e0268ae7ce8a94f..af257b58ac45ee3cfdd2f37e22532bf4597631d2 100644 (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];
 
index fa6e6184c43724a7772f22e20b8d97218a7ece8e..2b01b4a3861d5407300d3492833f29dac84a4df3 100644 (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(