--- a/open-src/driver/xf86-video-ast/Makefile Fri Mar 15 17:33:30 2013 -0700
+++ b/open-src/driver/xf86-video-ast/Makefile Mon Mar 18 14:18:39 2013 -0700
@@ -39,7 +39,9 @@
# Patches to apply to source after unpacking, in order
SOURCE_PATCHES += sparc-ast.patch,-p1 \
- 16027951.patch,-p1
+ 16027951.patch,-p1 \
+ ast.patch,-p1 \
+ ast_vgatool.patch,-p1
# Link in additional source files from sun-src directory
ADDITIONAL_SOURCE_DIR=sun-src
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/driver/xf86-video-ast/ast.patch Mon Mar 18 14:18:39 2013 -0700
@@ -0,0 +1,22 @@
++++ a/src/ast.h Fri Mar 15 10:45:43 2013
+--- /net/overthere/export/home/x-s12-clone/open-src/driver/xf86-video-ast/ast.h Fri Mar 15 13:49:13 2013
+@@ -341,9 +341,19 @@
+ #define VIS_SETIOREG (VIOC | 17)
+ #define VIS_GETIOREG (VIOC | 18)
+
++#ifdef __sparc
++#define ASTIOC ('Y' << 8)
++#define AST_GET_INDEX (ASTIOC | 14)
++#define AST_SET_INDEX (ASTIOC | 15)
++#endif
++
+ typedef struct vis_io_reg {
+ uchar_t offset;
+ uchar_t value;
++#ifdef __sparc
++ uchar_t offset1;
++ uchar_t value1;
++#endif
+ } vis_io_reg_t;
+ #endif
+ extern struct pci_device *ASTGetPciInfo(ASTRecPtr);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/driver/xf86-video-ast/ast_vgatool.patch Mon Mar 18 14:18:39 2013 -0700
@@ -0,0 +1,72 @@
++++ a/src/ast_vgatool.h Fri Mar 15 10:45:43 2013
+--- /net/overthere/export/home/x-s12-clone/open-src/driver/xf86-video-ast/ast_vgatool.h Fri Mar 15 10:44:35 2013
+@@ -86,11 +86,10 @@
+ #define GetIndexReg(off, index, val) do { \
+ struct vis_io_reg io_reg = { \
+ .offset = off, \
+- .value = index \
++ .value = index, \
++ .offset1 = off+1 \
+ }; \
+- ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
+- io_reg.offset = off+1; \
+- ioctl(pAST->fd, VIS_GETIOREG, &io_reg); \
++ ioctl(pAST->fd, AST_GET_INDEX, &io_reg); \
+ val = io_reg.value; \
+ } while (0)
+
+@@ -97,22 +96,20 @@
+ #define SetIndexReg(off, index, val) do { \
+ struct vis_io_reg io_reg = { \
+ .offset = off, \
+- .value = index \
++ .value = index, \
++ .offset1 = off+1, \
++ .value1 = val \
+ }; \
+- ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
+- io_reg.offset = off+1; \
+- io_reg.value = val; \
+- ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
++ ioctl(pAST->fd, AST_SET_INDEX, &io_reg); \
+ } while (0)
+
+ #define GetIndexRegMask(off, index, and, val) do { \
+ struct vis_io_reg io_reg = { \
+ .offset = off, \
+- .value = index \
++ .value = index, \
++ .offset1 = off+1 \
+ }; \
+- ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
+- io_reg.offset = off+1; \
+- ioctl(pAST->fd, VIS_GETIOREG, &io_reg); \
++ ioctl(pAST->fd, AST_GET_INDEX, &io_reg); \
+ val = io_reg.value & and; \
+ } while (0)
+
+@@ -120,18 +117,16 @@
+ UCHAR __Temp; \
+ struct vis_io_reg io_reg = { \
+ .offset = off, \
+- .value = index \
++ .value = index, \
++ .offset1 = off+1 \
+ }; \
+- ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
+- io_reg.offset = off + 1; \
+- ioctl(pAST->fd, VIS_GETIOREG, &io_reg); \
++ ioctl(pAST->fd, AST_GET_INDEX, &io_reg); \
+ __Temp = (io_reg.value & and) | val; \
+ io_reg.offset = off; \
+ io_reg.value = index; \
+- ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
+- io_reg.offset = off+1; \
+- io_reg.value = __Temp; \
+- ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
++ io_reg.offset1 = off+1; \
++ io_reg.value1 = __Temp; \
++ ioctl(pAST->fd, AST_SET_INDEX, &io_reg); \
+ } while (0)
+
+ #else /* !__sparc__ */