diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index e1224ef4ad83d..6a2624dc04b4b 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -138,6 +138,11 @@ static int ast_drm_freeze(struct drm_device *dev) static int ast_drm_thaw(struct drm_device *dev) { + struct ast_device *ast = to_ast_device(dev); + + ast_enable_vga(dev); + ast_open_key(ast); + ast_enable_mmio(ast); ast_post_gpu(dev); return drm_mode_config_helper_resume(dev); diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index f7053f2972bb9..a3f37c25f7157 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -340,6 +340,11 @@ static inline void ast_set_index_reg_mask(struct ast_device *ast, u32 base, u8 i ast_set_index_reg(ast, base, index, tmp); } +static inline void ast_open_key(struct ast_device *ast) +{ + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x80, 0xA8); +} + #define AST_VIDMEM_SIZE_8M 0x00800000 #define AST_VIDMEM_SIZE_16M 0x01000000 #define AST_VIDMEM_SIZE_32M 0x02000000 @@ -518,6 +523,8 @@ int ast_mode_config_init(struct ast_device *ast); int ast_mm_init(struct ast_device *ast); /* ast post */ +void ast_enable_vga(struct drm_device *dev); +int ast_enable_mmio(struct ast_device *ast); void ast_post_gpu(struct drm_device *dev); u32 ast_mindwm(struct ast_device *ast, u32 r); void ast_moutdwm(struct ast_device *ast, u32 r, u32 v); diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index dae365ed39696..9fcd6f8b1bd36 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -45,7 +45,7 @@ static bool ast_is_vga_enabled(struct drm_device *dev) return !!(ch & 0x01); } -static void ast_enable_vga(struct drm_device *dev) +void ast_enable_vga(struct drm_device *dev) { struct ast_device *ast = to_ast_device(dev); @@ -65,7 +65,7 @@ static void ast_enable_mmio_release(void *data) ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04); } -static int ast_enable_mmio(struct ast_device *ast) +int ast_enable_mmio(struct ast_device *ast) { struct drm_device *dev = &ast->base; @@ -74,10 +74,6 @@ static int ast_enable_mmio(struct ast_device *ast) return devm_add_action_or_reset(dev->dev, ast_enable_mmio_release, ast); } -static void ast_open_key(struct ast_device *ast) -{ - ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x80, 0xA8); -} static int ast_device_config_init(struct ast_device *ast) {