diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2022-10-13 14:29:23 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2022-10-16 12:17:04 +0300 |
commit | 202fb33be38c98f7bc9f0fa370cd13d189b4f9d8 (patch) | |
tree | 9242ff0238559f90b792cfa3834a3159d196b855 /drivers/gpu/drm/ast | |
parent | f2fa5a99ca81ce1056539e83c705f3d6bec62e31 (diff) | |
download | linux-202fb33be38c98f7bc9f0fa370cd13d189b4f9d8.tar.xz |
drm/ast: Avoid reprogramming primary-plane scanout address
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.
v2:
* only update offset if it changed (Jocelyn)
Reported-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221013112923.769-9-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r-- | drivers/gpu/drm/ast/ast_mode.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 1b991658290b..4355754d69b5 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -671,10 +671,19 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane, ast_handle_damage(ast_plane, shadow_plane_state->data, fb, &damage); } - 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 offset or scanout address. This stalls display + * output for several seconds and makes the display unusable. + * Therefore only update the offset if it changes and reprogram the + * address after enabling the plane. + */ + if (!old_fb || old_fb->pitches[0] != fb->pitches[0]) + ast_set_offset_reg(ast, fb); + if (!old_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, |