summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast
diff options
context:
space:
mode:
authorJocelyn Falempe <jfalempe@redhat.com>2022-06-22 15:48:15 +0300
committerJocelyn Falempe <jfalempe@redhat.com>2022-06-27 11:15:02 +0300
commit5171660cbb14f3359e8a8bf7523afb0789fe1bcd (patch)
tree34f823e6f846e95efb97d35b52d83108520ea56a /drivers/gpu/drm/ast
parent3a149169e4a2f9127022fec6ef5d71b4e804b3b9 (diff)
downloadlinux-5171660cbb14f3359e8a8bf7523afb0789fe1bcd.tar.xz
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
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r--drivers/gpu/drm/ast/ast_mode.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 3eb9afecd9d4..4a91605b4654 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -990,6 +990,9 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
{
struct ast_private *ast = to_ast_private(crtc->dev);
u8 ch = AST_DPMS_VSYNC_OFF | AST_DPMS_HSYNC_OFF;
+ struct ast_crtc_state *ast_state;
+ const struct drm_format_info *format;
+ struct ast_vbios_mode_info *vbios_mode_info;
/* TODO: Maybe control display signal generation with
* Sync Enable (bit CR17.7).
@@ -1007,6 +1010,16 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
ast_dp_set_on_off(crtc->dev, 1);
}
+ ast_state = to_ast_crtc_state(crtc->state);
+ format = ast_state->format;
+
+ if (format) {
+ vbios_mode_info = &ast_state->vbios_mode_info;
+
+ ast_set_color_reg(ast, format);
+ ast_set_vbios_color_reg(ast, format, vbios_mode_info);
+ }
+
ast_crtc_load_lut(ast, crtc);
break;
case DRM_MODE_DPMS_STANDBY: