for (j = 0; j < context->res_ctx.pool->pipe_count; j++) {
                        struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
+                       struct pipe_ctx *cur_pipe_ctx;
+                       bool is_new_pipe_surface = true;
+
                        if (pipe_ctx->surface != surface)
                                continue;
                        /*lock all the MCPP if blnd is enable for DRR*/
                                                        surface_count != context->res_ctx.pool->pipe_count)) &&
                                        !pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
                                lock_mask = PIPE_LOCK_CONTROL_MPCC_ADDR;
-                               core_dc->hwss.pipe_control_lock(
-                                               core_dc,
-                                               pipe_ctx,
-                                               lock_mask,
-                                               true);
-                               }
                        }
-               for (j = 0; j < context->res_ctx.pool->pipe_count; j++) {
-                       struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
-                       struct pipe_ctx *cur_pipe_ctx;
-                       bool is_new_pipe_surface = true;
 
-                       if (pipe_ctx->surface != surface)
-                               continue;
                        if (update_type != UPDATE_TYPE_FAST &&
                                !pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
                                lock_mask = PIPE_LOCK_CONTROL_GRAPHICS |
                                                PIPE_LOCK_CONTROL_SCL |
                                                PIPE_LOCK_CONTROL_BLENDER |
                                                PIPE_LOCK_CONTROL_MODE;
+                       }
+                       if (lock_mask != 0) {
                                core_dc->hwss.pipe_control_lock(
                                                core_dc,
                                                pipe_ctx,
                }
        }
 
-       if (update_type == UPDATE_TYPE_FAST && (lock_mask == 0))
+       if ((update_type == UPDATE_TYPE_FAST) && lock_mask == 0)
                return;
 
        for (i = context->res_ctx.pool->pipe_count - 1; i >= 0; i--) {