Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions drivers/gpu/drm/ast/ast_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions drivers/gpu/drm/ast/ast_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 2 additions & 6 deletions drivers/gpu/drm/ast/ast_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;

Expand All @@ -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)
{
Expand Down
Loading