aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ast/ast_post.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/ast/ast_post.c')
-rw-r--r--drivers/gpu/drm/ast/ast_post.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c
index 38d437f3a267..810c51d92b99 100644
--- a/drivers/gpu/drm/ast/ast_post.c
+++ b/drivers/gpu/drm/ast/ast_post.c
@@ -33,18 +33,23 @@
33 33
34static void ast_init_dram_2300(struct drm_device *dev); 34static void ast_init_dram_2300(struct drm_device *dev);
35 35
36static void 36void ast_enable_vga(struct drm_device *dev)
37ast_enable_vga(struct drm_device *dev) 37{
38 struct ast_private *ast = dev->dev_private;
39
40 ast_io_write8(ast, AST_IO_VGA_ENABLE_PORT, 0x01);
41 ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, 0x01);
42}
43
44void ast_enable_mmio(struct drm_device *dev)
38{ 45{
39 struct ast_private *ast = dev->dev_private; 46 struct ast_private *ast = dev->dev_private;
40 47
41 ast_io_write8(ast, 0x43, 0x01); 48 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
42 ast_io_write8(ast, 0x42, 0x01);
43} 49}
44 50
45#if 0 /* will use later */ 51
46static bool 52bool ast_is_vga_enabled(struct drm_device *dev)
47ast_is_vga_enabled(struct drm_device *dev)
48{ 53{
49 struct ast_private *ast = dev->dev_private; 54 struct ast_private *ast = dev->dev_private;
50 u8 ch; 55 u8 ch;
@@ -52,7 +57,7 @@ ast_is_vga_enabled(struct drm_device *dev)
52 if (ast->chip == AST1180) { 57 if (ast->chip == AST1180) {
53 /* TODO 1180 */ 58 /* TODO 1180 */
54 } else { 59 } else {
55 ch = ast_io_read8(ast, 0x43); 60 ch = ast_io_read8(ast, AST_IO_VGA_ENABLE_PORT);
56 if (ch) { 61 if (ch) {
57 ast_open_key(ast); 62 ast_open_key(ast);
58 ch = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff); 63 ch = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff);
@@ -61,7 +66,6 @@ ast_is_vga_enabled(struct drm_device *dev)
61 } 66 }
62 return 0; 67 return 0;
63} 68}
64#endif
65 69
66static const u8 extreginfo[] = { 0x0f, 0x04, 0x1c, 0xff }; 70static const u8 extreginfo[] = { 0x0f, 0x04, 0x1c, 0xff };
67static const u8 extreginfo_ast2300a0[] = { 0x0f, 0x04, 0x1c, 0xff }; 71static const u8 extreginfo_ast2300a0[] = { 0x0f, 0x04, 0x1c, 0xff };
@@ -371,6 +375,7 @@ void ast_post_gpu(struct drm_device *dev)
371 pci_write_config_dword(ast->dev->pdev, 0x04, reg); 375 pci_write_config_dword(ast->dev->pdev, 0x04, reg);
372 376
373 ast_enable_vga(dev); 377 ast_enable_vga(dev);
378 ast_enable_mmio(dev);
374 ast_open_key(ast); 379 ast_open_key(ast);
375 ast_set_def_ext_reg(dev); 380 ast_set_def_ext_reg(dev);
376 381