Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ast: Fix black screen when getting out of suspend

With an AST2600, the screen is garbage when going out of suspend.
This is because color settings are lost, and not restored on resume.
Force the color settings on DPMS_ON, to make sure the settings are correct.

I didn't write this code, it comes from the out-of-tree aspeed driver v1.13
https://www.aspeedtech.com/support_driver/

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Venkat Tadikonda <venkateswara.rao@intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220622124815.356035-1-jfalempe@redhat.com

+13
+13
drivers/gpu/drm/ast/ast_mode.c
··· 990 990 { 991 991 struct ast_private *ast = to_ast_private(crtc->dev); 992 992 u8 ch = AST_DPMS_VSYNC_OFF | AST_DPMS_HSYNC_OFF; 993 + struct ast_crtc_state *ast_state; 994 + const struct drm_format_info *format; 995 + struct ast_vbios_mode_info *vbios_mode_info; 993 996 994 997 /* TODO: Maybe control display signal generation with 995 998 * Sync Enable (bit CR17.7). ··· 1008 1005 ast_dp_power_on_off(crtc->dev, AST_DP_POWER_ON); 1009 1006 ast_wait_for_vretrace(ast); 1010 1007 ast_dp_set_on_off(crtc->dev, 1); 1008 + } 1009 + 1010 + ast_state = to_ast_crtc_state(crtc->state); 1011 + format = ast_state->format; 1012 + 1013 + if (format) { 1014 + vbios_mode_info = &ast_state->vbios_mode_info; 1015 + 1016 + ast_set_color_reg(ast, format); 1017 + ast_set_vbios_color_reg(ast, format, vbios_mode_info); 1011 1018 } 1012 1019 1013 1020 ast_crtc_load_lut(ast, crtc);