forked from pld-linux/XFree86
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXFree86-fix-07-s3trio64v2gx+netfinity.patch
130 lines (111 loc) · 3.74 KB
/
XFree86-fix-07-s3trio64v2gx+netfinity.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
--- XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h.fix Mon Jul 2 19:46:04 2001
+++ XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h Mon Jan 21 08:18:14 2002
@@ -251,7 +251,7 @@
#define WaitQueue(v) \
if(!(pS3->PCIRetry)) { \
mem_barrier(); \
- while(inb(GP_STAT) & (0x0100 >> (v))); \
+ while(mmio_INB_GP_STAT() & (0x0100 >> (v))); \
}
#define CMD_REG_WIDTH 0x200 /* select 32bit command register */
--- XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_accel.c.fix Sun Oct 28 12:33:44 2001
+++ XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_accel.c Mon Jan 21 08:22:08 2002
@@ -46,6 +46,7 @@
static void S3Sync(ScrnInfoPtr pScrn)
{
+ S3Ptr pS3 = S3PTR(pScrn);
WaitIdle();
}
@@ -64,9 +65,7 @@
static void S3SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y,
int w, int h)
{
-#ifdef S3_NEWMMIO
S3Ptr pS3 = S3PTR(pScrn);
-#endif
WaitQueue(5);
SET_CURPT((short)x, (short)y);
@@ -303,9 +302,8 @@
int major, int minor,
int err, int len, int octant)
{
-#ifdef S3_NEWMMIO
S3Ptr pS3 = S3PTR(pScrn);
-#endif
+
unsigned short cmd;
int error, e1, e2;
--- XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_dga.c.fix Mon Jul 2 19:46:04 2001
+++ XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_dga.c Mon Jan 21 08:18:14 2002
@@ -314,5 +314,6 @@
static void S3_Sync(ScrnInfoPtr pScrn)
{
+ S3Ptr pS3 = S3PTR(pScrn);
WaitIdle();
}
--- XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c.fix Thu Dec 27 07:24:19 2001
+++ XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c Mon Jan 21 08:18:14 2002
@@ -1569,7 +1569,20 @@
outb(0x3c6, 0x00);
- outw(SUBSYS_CNTL, 0x8000 | 0x1000);
+/*
+* XXX: resetting the Trio64V2/GX causes trouble with the SGRAM memory bus
+* (gets out of sync? same as setting CR88_6) which I don't know to fix,
+* so better not reset that chip and cross fingers...
+* This happens at least for some IBM Netfinity boxes (e.g. 7000M10) with 1MB SGRAM.
+*/
+ if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) {
+ outb(vgaCRIndex, 0x36);
+ tmp = inb(vgaCRReg);
+ if ((tmp & 0x0c) != 0x04) /* no SGRAM */
+ outw(SUBSYS_CNTL, 0x8000 | 0x1000);
+ }
+ else /* do normal reset for S3 chip... */
+ outw(SUBSYS_CNTL, 0x8000 | 0x1000);
outw(SUBSYS_CNTL, 0x4000 | 0x1000);
inw(SUBSYS_STAT);
@@ -1603,6 +1616,12 @@
WaitQueue(5);
SET_SCISSORS(0, 0, pS3->s3ScissR, pS3->s3ScissB);
+ if(pS3->s3Bpp > 2) {
+ if(pS3->S3NewMMIO)
+ SET_MULT_MISC(0x200);
+ else
+ SET_MULT_MISC(0);
+ }
outb(vgaCRIndex, 0x6f);
--- XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_reg.h.fix Mon Jul 2 19:46:04 2001
+++ XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_reg.h Mon Jan 21 08:18:14 2002
@@ -148,10 +148,23 @@
outw(p, (n) >> 16); \
} else outw(p, n)
+/*
+ * mmio reads from GP_STAT
+ */
+#if !defined(__alpha__)
+#define mmio_INB_GP_STAT() (*(((volatile unsigned char*)pS3->MMIOBase)+GP_STAT) & 0xff)
+#define mmio_INW_GP_STAT() (*(((volatile unsigned short*)pS3->MMIOBase)+GP_STAT/2))
+#else
+#define mmio_INB_GP_STAT() inb(GP_STAT)
+#define mmio_INW_GP_STAT() inw(GP_STAT)
+#endif
#define WaitIdle() do { \
mem_barrier(); \
- while(inw(GP_STAT) & GPBUSY); \
+ if (pS3->S3NewMMIO) \
+ while(mmio_INW_GP_STAT() & GPBUSY); \
+ else \
+ while(inw(GP_STAT) & GPBUSY); \
} while(0)
@@ -184,9 +197,12 @@
#define CMD_REG_WIDTH 0x0000
-#define WaitQueue(n) do { \
+#define WaitQueue(n) do { \
mem_barrier(); \
- while(inb(GP_STAT) & (0x0100 >> (n))); \
+ if (pS3->S3NewMMIO) \
+ while(mmio_INB_GP_STAT() & (0x0100 >> (n))); \
+ else \
+ while(inb(GP_STAT) & (0x0100 >> (n))); \
} while (0)
#define WaitQueue16_32(n16,n32) \