forked from pld-linux/XFree86
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXFree86-r128-busmstr2.patch
55 lines (50 loc) · 2.02 KB
/
XFree86-r128-busmstr2.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
Index: r128.h
===================================================================
RCS file: /home/x-cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v
retrieving revision 1.8
diff -u -r1.8 r128.h
--- XFree86-4.0.3/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h 2000/12/08 19:15:33 1.8
+++ XFree86-4.0.3/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h 2001/03/02 20:16:38
@@ -280,6 +280,8 @@
unsigned char *AGP; /* Map */
int agpMode;
+ CARD32 pciCommand;
+
Bool CCEInUse; /* CCE is currently active */
int CCEMode; /* CCE mode that server/clients use */
int CCEFifoSize; /* Size of the CCE command FIFO */
Index: r128_dri.c
===================================================================
RCS file: /home/x-cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v
retrieving revision 1.7
diff -u -r1.7 r128_dri.c
--- XFree86-4.0.3/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c 2000/12/12 17:17:12 1.7
+++ XFree86-4.0.3/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c 2001/03/02 20:16:38
@@ -403,6 +403,9 @@
int s, l;
int flags;
+ /* Save the old PCI command reg */
+ info->pciCommand = pciReadLong(info->PciTag, PCI_CMD_STAT_REG);
+
if (drmAgpAcquire(info->drmFD) < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] AGP not available\n");
return FALSE;
@@ -576,6 +579,11 @@
OUTREG(R128_AGP_BASE, info->ringHandle); /* Ring buf is at AGP offset 0 */
OUTREG(R128_AGP_CNTL, cntl);
+ /* Enable bus mastering in PCI config
+ space */
+ pciWriteLong(info->PciTag, PCI_CMD_STAT_REG,
+ info->pciCommand | PCI_CMD_MASTER_ENABLE);
+
return TRUE;
}
@@ -1020,6 +1028,9 @@
drmAgpFree(info->drmFD, info->agpMemHandle);
info->agpMemHandle = 0;
drmAgpRelease(info->drmFD);
+
+ /* Restore PCI command register */
+ pciWriteLong(info->PciTag, PCI_CMD_STAT_REG, info->pciCommand);
}
/* De-allocate all DRI resources */