drm/amd/display: Only wait for blank completion if OTG active
authorAric Cyr <aric.cyr@amd.com>
Sat, 11 Feb 2023 15:03:22 +0000 (10:03 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Feb 2023 19:30:55 +0000 (14:30 -0500)
[why]
If OTG is not active, waiting for blank completion will always fail and
timeout resulting in unnecessary driver delays.

[how]
Check that OTG is enabled before waiting for blank.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@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

index d4a1670a54506ab611ac3764d9d32451688f03ea..f07cba121d010ede23366360f35ffe22425e2822 100644 (file)
@@ -1093,7 +1093,8 @@ static void phantom_pipe_blank(
                        otg_active_height,
                        0);
 
-       hws->funcs.wait_for_blank_complete(opp);
+       if (tg->funcs->is_tg_enabled(tg))
+               hws->funcs.wait_for_blank_complete(opp);
 }
 
 static void disable_dangling_plane(struct dc *dc, struct dc_state *context)
@@ -1156,6 +1157,7 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context)
                        if (old_stream->mall_stream_config.type == SUBVP_PHANTOM) {
                                if (tg->funcs->enable_crtc) {
                                        int main_pipe_width, main_pipe_height;
+
                                        main_pipe_width = old_stream->mall_stream_config.paired_stream->dst.width;
                                        main_pipe_height = old_stream->mall_stream_config.paired_stream->dst.height;
                                        phantom_pipe_blank(dc, tg, main_pipe_width, main_pipe_height);