View | Details | Raw Unified | Return to bug 240294 | Differences between
and this patch

Collapse All | Expand All

(-)b/x11-drivers/xf86-video-ast/Makefile (-1 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	xf86-video-ast
1
PORTNAME=	xf86-video-ast
2
PORTVERSION=	1.1.5
2
PORTVERSION=	1.1.5
3
PORTREVISION=	3
3
PORTREVISION=	4
4
CATEGORIES=	x11-drivers
4
CATEGORIES=	x11-drivers
5
5
6
MAINTAINER=	x11@FreeBSD.org
6
MAINTAINER=	x11@FreeBSD.org
(-)b/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c (+33 lines)
Line 0 Link Here
1
--- src/ast_vgatool.c.orig	2015-08-19 01:24:48.000000000 +0000
2
+++ src/ast_vgatool.c		2020-09-17 14:19:18.843298000 +0000
3
@@ -432,11 +432,27 @@
4
     *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000;
5
     *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1;
6
 
7
+    /* Based on the Linux DRM driver we might not be able to access this
8
+     * If we can't just use some sane defaults.
9
+     *
10
+     * See drm/drivers/gpu/drm/ast/ast_main.c line 295.
11
+     */
12
+
13
     *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000) = 0xFC600309;
14
-    do {
15
-       ;
16
-    } while (*(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10000) != 0x01);
17
+    for (ulData = 10000; ulData > 0; ulData--)
18
+	if (*(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10000) == 0x01)
19
+	    break;
20
 
21
+    if (ulData == 0) {
22
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to read DRAM information, using defaults\n");
23
+	pAST->ulDRAMBusWidth = 16;
24
+	pAST->jDRAMType = DRAMTYPE_1Gx16;
25
+	if (pAST->jChipType == AST2500)
26
+	    pAST->ulMCLK = 800;
27
+	else
28
+	    pAST->ulMCLK = 396;
29
+	return;
30
+    }
31
     ulData = *(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10004);
32
 
33
     /* Get BusWidth */

Return to bug 240294