Skip to contentSkip to conversation

drm/ast: Fixed system may hang in booting

PATCH New Y.C. Chen 1 participant 1 message Nov 30, 2016

Subsystems (3)
lore
Share & tools
lore

Y.C. Chen

author
#0 lore raw

PATCH 1/1 drm/ast: Fixed system may hang in booting

From: "Y.C. Chen" <[email protected]>

There is another thread still access standard VGA I/O while loading drm driver. Disable standard VGA access to avoid this issue.

---
 drivers/gpu/drm/ast/ast_main.c | 6 ++++++
 drivers/gpu/drm/ast/ast_post.c | 6 +-----
 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/ast/ast_main.c +6 -0
index 904beaa..05ea3e3 100644
@@ -124,6 +124,9 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
 	} else
 		*need_post = false;
 
+        /* disable standard VGA decode */
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
+
 	/* Check if we support wide screen */
 	switch (ast->chip) {
 	case AST1180:
@@ -480,6 +483,9 @@ int ast_driver_unload(struct drm_device *dev)
 {
 	struct ast_private *ast = dev->dev_private;
 
+        /* enable standard VGA decode */
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04);
+
 	kfree(ast->dp501_fw_addr);
 	ast_mode_fini(dev);
 	ast_fbdev_fini(dev);
drivers/gpu/drm/ast/ast_post.c +1 -5
index 810c51d..a71abd2 100644
@@ -58,11 +58,7 @@ bool ast_is_vga_enabled(struct drm_device *dev)
 		/* TODO 1180 */
 	} else {
 		ch = ast_io_read8(ast, AST_IO_VGA_ENABLE_PORT);
-		if (ch) {
-			ast_open_key(ast);
-			ch = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff);
-			return ch & 0x04;
-		}
+                return ch & 0x01;
 	}
 	return 0;
 }
Signature · 6 lines
1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel