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 */