Index: sis_dri.c =================================================================== RCS file: /home/ncvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v retrieving revision 1.23 diff -u -r1.23 sis_dri.c --- sis_dri.c 23 Oct 2003 02:23:31 -0000 1.23 +++ sis_dri.c 30 Oct 2003 23:43:29 -0000 @@ -45,7 +45,6 @@ while( (MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000){}; \ } - extern void GlxSetVisualConfigs( int nconfigs, __GLXvisualConfig *configs, @@ -64,6 +63,7 @@ static char SISKernelDriverName[] = "sis"; static char SISClientDriverName[] = "sis"; +static char SIS6326ClientDriverName[] = "sis6326"; static Bool SISInitVisualConfigs(ScreenPtr pScreen); static Bool SISCreateContext(ScreenPtr pScreen, VisualPtr visual, @@ -96,7 +96,7 @@ int i, db, z_stencil, accum; Bool useZ16 = FALSE; - if(getenv("SIS_FORCE_Z16")) { + if(getenv("SIS_FORCE_Z16") || (pSIS->Chipset == PCI_CHIP_SIS6326)) { useZ16 = TRUE; } @@ -246,7 +246,10 @@ pSIS->pDRIInfo = pDRIInfo; pDRIInfo->drmDriverName = SISKernelDriverName; - pDRIInfo->clientDriverName = SISClientDriverName; + if (pSIS->VGAEngine == SIS_300_VGA) + pDRIInfo->clientDriverName = SISClientDriverName; + else + pDRIInfo->clientDriverName = SIS6326ClientDriverName; if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) { pDRIInfo->busIdString = DRICreatePCIBusID(pSIS->PciInfo); } else { @@ -642,6 +645,8 @@ #ifdef SIS315DRI /* ? */ #endif + } else if (pSiS->Chipset == PCI_CHIP_SIS6326) { + *(pSiS->IOBase + 0x8aff) = 0xff; } else { *(pSiS->IOBase + 0x8B50) = 0xff; *(unsigned int *)(pSiS->IOBase + 0x8B60) = -1; @@ -660,7 +665,7 @@ SiS315Idle /* 315 series */ #endif } else { - SiSIdle /* 300 series */ + SiSIdle /* 300/6326 series */ } } @@ -677,7 +682,7 @@ SiS315Idle /* 315 series */ #endif } else { - SiSIdle /* 300 series */ + SiSIdle /* 300/6326 series */ } } Index: sis_driver.c =================================================================== RCS file: /home/ncvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v retrieving revision 1.12 diff -u -r1.12 sis_driver.c --- sis_driver.c 23 Oct 2003 02:23:31 -0000 1.12 +++ sis_driver.c 28 Oct 2003 20:08:07 -0000 @@ -6315,8 +6315,8 @@ } else #endif /* Force the initialization of the context */ - if(pSiS->VGAEngine != SIS_315_VGA) { - pSiS->directRenderingEnabled = SISDRIScreenInit(pScreen); + if(pSiS->VGAEngine == SIS_300_VGA || pSiS->Chipset == PCI_CHIP_SIS6326) { + pSiS->directRenderingEnabled = SISDRIScreenInit(pScreen); } else { xf86DrvMsg(pScrn->scrnIndex, X_NOT_IMPLEMENTED, "DRI not supported on this chipset\n"); Index: sis_vga.c =================================================================== RCS file: /home/ncvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c,v retrieving revision 1.4 diff -u -r1.4 sis_vga.c --- sis_vga.c 12 Sep 2003 14:24:16 -0000 1.4 +++ sis_vga.c 28 Oct 2003 20:07:16 -0000 @@ -630,13 +630,23 @@ */ pReg->sisRegs3C4[0x2C] = (pScrn->videoRam - 64) / 32; if(pSiS->Chipset != PCI_CHIP_SIS530) { /* 530/620: Reserved (don't touch) */ - pReg->sisRegs3C4[0x3C] &= 0xFC; /* 6326: Queue is all for 2D */ + if(pSiS->Chipset == PCI_CHIP_SIS6326 && pSiS->directRenderingEnabled) { + /* 6326 DRI: Queue is mostly for 3D */ + pReg->sisRegs3C4[0x3C] = (pReg->sisRegs3C4[0x3C] & 0xFC) | 0x3; + } else + pReg->sisRegs3C4[0x3C] &= 0xFC; /* Queue is all for 2D */ } /* 5597: Must be 0 */ } else { pReg->sisRegs3C4[0x27] &= 0x7F; } } + if(pSiS->Chipset == PCI_CHIP_SIS6326 && pSiS->directRenderingEnabled) { + /* Turn on 3d engine */ + pReg->sisRegs3C4[0x39] |= 0x4; + /* XXX: Turn on 3d pre-setup? */ + /*pReg->sisRegs3C4[0x3d] |= 0x1; */ + } if(!pSiS->UseVESA) {