--- /dev/null
+--- XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c.foo Thu Mar 1 10:30:43 2001
++++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c Thu Mar 1 10:36:48 2001
+@@ -280,6 +280,9 @@
+
+ #if defined(XFree86Server)
+ if (!drmAvailable()) {
++ if (!xf86LoadKernelModule("agpgart")) {
++ ErrorF("[drm] failed to load kernel module \"agpgart\"\n");
++ }
+ /* try to load the kernel module now */
+ if (!xf86LoadKernelModule(name)) {
+ ErrorF("[drm] failed to load kernel module \"%s\"\n",
--- /dev/null
+Index: mga_dri.c
+===================================================================
+RCS file: /home/x-cvs/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v
+retrieving revision 1.14
+diff -u -r1.14 mga_dri.c
+--- XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c 2000/12/11 22:34:55 1.14
++++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c 2001/03/02 20:13:06
+@@ -379,6 +379,7 @@
+ int init_offset;
+ int i;
+ unsigned long mode_mask;
++ CARD32 pciCommand;
+
+ switch(pMGA->Chipset) {
+ case PCI_CHIP_MGAG400:
+@@ -782,6 +783,11 @@
+ return FALSE;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configs initialized\n" );
++
++ /* Enable bus mastering in PCI config space */
++ pciCommand = pciReadLong(pMGA->PciTag, PCI_CMD_STAT_REG);
++ pciWriteLong(pMGA->PciTag, PCI_CMD_STAT_REG,
++ pciCommand | PCI_CMD_MASTER_ENABLE);
+
+ return TRUE;
+ }
--- /dev/null
+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 */