diff -urN a/x11-drivers/xf86-video-ast/Makefile b/x11-drivers/xf86-video-ast/Makefile --- a/x11-drivers/xf86-video-ast/Makefile 2021-04-07 17:36:21.000000000 +0930 +++ b/x11-drivers/xf86-video-ast/Makefile 2021-07-08 13:42:37.564597796 +0930 @@ -1,6 +1,6 @@ PORTNAME= xf86-video-ast PORTVERSION= 1.1.5 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= x11-drivers MAINTAINER= x11@FreeBSD.org diff -urN a/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c b/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c --- a/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c 1970-01-01 09:30:00.000000000 +0930 +++ b/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c 2020-09-18 13:22:54.355081295 +0930 @@ -0,0 +1,33 @@ +--- src/ast_vgatool.c.orig 2015-08-19 01:24:48.000000000 +0000 ++++ src/ast_vgatool.c 2020-09-17 14:19:18.843298000 +0000 +@@ -432,11 +432,27 @@ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000; + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; + ++ /* Based on the Linux DRM driver we might not be able to access this ++ * If we can't just use some sane defaults. ++ * ++ * See drm/drivers/gpu/drm/ast/ast_main.c line 295. ++ */ ++ + *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000) = 0xFC600309; +- do { +- ; +- } while (*(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10000) != 0x01); ++ for (ulData = 10000; ulData > 0; ulData--) ++ if (*(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10000) == 0x01) ++ break; + ++ if (ulData == 0) { ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to read DRAM information, using defaults\n"); ++ pAST->ulDRAMBusWidth = 16; ++ pAST->jDRAMType = DRAMTYPE_1Gx16; ++ if (pAST->jChipType == AST2500) ++ pAST->ulMCLK = 800; ++ else ++ pAST->ulMCLK = 396; ++ return; ++ } + ulData = *(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10004); + + /* Get BusWidth */