drm/amd/display: Clean up code in dc
authorAlvin Lee <Alvin.Lee2@amd.com>
Mon, 2 May 2022 19:04:31 +0000 (15:04 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 May 2022 18:56:30 +0000 (14:56 -0400)
[Why & How]
Code clean up in dc.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@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/dcn20/dcn20_hwseq.c

index e41a48f..f144494 100644 (file)
@@ -2901,14 +2901,15 @@ static void commit_planes_for_stream(struct dc *dc,
                                                top_pipe_to_program->stream_res.tg);
                }
 
-       if (should_lock_all_pipes && dc->hwss.interdependent_update_lock)
+       if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) {
                dc->hwss.interdependent_update_lock(dc, context, true);
-       else
+       } else {
                /* Lock the top pipe while updating plane addrs, since freesync requires
                 *  plane addr update event triggers to be synchronized.
                 *  top_pipe_to_program is expected to never be NULL
                 */
                dc->hwss.pipe_control_lock(dc, top_pipe_to_program, true);
+       }
 
        // Stream updates
        if (stream_update)
@@ -2924,10 +2925,11 @@ static void commit_planes_for_stream(struct dc *dc,
                if (dc->hwss.program_front_end_for_ctx)
                        dc->hwss.program_front_end_for_ctx(dc, context);
 
-               if (should_lock_all_pipes && dc->hwss.interdependent_update_lock)
+               if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) {
                        dc->hwss.interdependent_update_lock(dc, context, false);
-               else
+               } else {
                        dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false);
+               }
                dc->hwss.post_unlock_program_front_end(dc, context);
                return;
        }
@@ -3052,10 +3054,11 @@ static void commit_planes_for_stream(struct dc *dc,
 
        }
 
-       if (should_lock_all_pipes && dc->hwss.interdependent_update_lock)
+       if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) {
                dc->hwss.interdependent_update_lock(dc, context, false);
-       else
+       } else {
                dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false);
+       }
 
        if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed)
                if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
index e1f87bd..0da0249 100644 (file)
@@ -1773,7 +1773,6 @@ void dcn20_post_unlock_program_front_end(
         */
        for (i = 0; i < dc->res_pool->pipe_count; i++) {
                struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
-
                if (pipe->plane_state && !pipe->top_pipe && pipe->update_flags.bits.enable) {
                        struct hubp *hubp = pipe->plane_res.hubp;
                        int j = 0;