Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jul 2021 11:25:31 GMT
From:      Adriaan de Groot <adridg@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: b6eed3fd3486 - main - x11-drivers/xf86-video-ast: restore functionality on 12
Message-ID:  <202107091125.169BPVdi003305@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b6eed3fd348662481b8180988860bb23cb171e41

commit b6eed3fd348662481b8180988860bb23cb171e41
Author:     Darius <darius@dons.net.au>
AuthorDate: 2021-07-09 11:19:00 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2021-07-09 11:24:23 +0000

    x11-drivers/xf86-video-ast: restore functionality on 12
    
    AST video which works on 11-, doesn't on 12-, restored by
    pulling in some Linux DRM patches and then massaging it to
    avoid device-tree madness, from darius@dons.net.au
    
    PR:             240294
    Approved by:    zeising (x11@)
---
 x11-drivers/xf86-video-ast/Makefile                |  2 +-
 .../xf86-video-ast/files/patch-ast_vgatool.c       | 33 ++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/x11-drivers/xf86-video-ast/Makefile b/x11-drivers/xf86-video-ast/Makefile
index ca2ca743870e..4e9e521e49c5 100644
--- a/x11-drivers/xf86-video-ast/Makefile
+++ b/x11-drivers/xf86-video-ast/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	xf86-video-ast
 PORTVERSION=	1.1.5
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	x11-drivers
 
 MAINTAINER=	x11@FreeBSD.org
diff --git a/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c b/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c
new file mode 100644
index 000000000000..72a69b1594b2
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/files/patch-ast_vgatool.c
@@ -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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107091125.169BPVdi003305>