Some AST-based BMCs stop display output for up to 5 seconds after
reprogramming the scanout address. As the address is fixed, avoid
re-setting the address' value.

Reported-by: Jocelyn Falempe <jfale...@redhat.com>
Signed-off-by: Thomas Zimmermann <tzimmerm...@suse.de>
---
 drivers/gpu/drm/ast/ast_mode.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 1b991658290b..54a9643d86ce 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -672,9 +672,17 @@ static void ast_primary_plane_helper_atomic_update(struct 
drm_plane *plane,
        }
 
        ast_set_offset_reg(ast, fb);
-       ast_set_start_address_crt1(ast, (u32)ast_plane->offset);
 
-       ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x00);
+       /*
+        * Some BMCs stop scanning out the video signal after the driver
+        * reprogrammed the scanout address. This stalls display output
+        * for several seconds and makes the display unusable. Therefore
+        * only reprogram the address after enabling the plane.
+        */
+       if (!old_fb && fb) {
+               ast_set_start_address_crt1(ast, (u32)ast_plane->offset);
+               ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x00);
+       }
 }
 
 static void ast_primary_plane_helper_atomic_disable(struct drm_plane *plane,
-- 
2.37.3

Reply via email to