drm/amd/display: Use |= when assigning wm_optimized_required
authorAlvin Lee <Alvin.Lee2@amd.com>
Wed, 11 Jan 2023 15:33:44 +0000 (10:33 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Jan 2023 18:26:25 +0000 (13:26 -0500)
[Description]
Use |= when assigning to wm_optimized required because
we don't want to overwrite the flag in case the optimize
did not happen yet

Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@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/dcn20/dcn20_hwseq.c

index 6bfa16d..e5919ad 100644 (file)
@@ -2023,8 +2023,11 @@ void dcn20_prepare_bandwidth(
                }
        }
 
-       /* program dchubbub watermarks */
-       dc->wm_optimized_required = hubbub->funcs->program_watermarks(hubbub,
+       /* program dchubbub watermarks:
+        * For assigning wm_optimized_required, use |= operator since we don't want
+        * to clear the value if the optimize has not happened yet
+        */
+       dc->wm_optimized_required |= hubbub->funcs->program_watermarks(hubbub,
                                        &context->bw_ctx.bw.dcn.watermarks,
                                        dc->res_pool->ref_clocks.dchub_ref_clock_inKhz / 1000,
                                        false);