diff options
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c')
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c index b5b16978a..58e49d1cf 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c,v 1.11 2000/12/01 14:29:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c,v 1.13 2000/12/15 15:19:35 dawes Exp $ */ #include "xf86.h" @@ -119,7 +119,7 @@ static void TDFXSyncFifo(ScrnInfoPtr pScrn) TDFXPtr pTDFX; int i, cnt; int stat; - long start_sec, end_sec, dummy, readptr; + long start_sec, end_sec, dummy; TDFXTRACEACCEL("TDFXSyncFifo start\n"); pTDFX=TDFXPTR(pScrn); @@ -128,7 +128,6 @@ static void TDFXSyncFifo(ScrnInfoPtr pScrn) cnt=0; start_sec=0; do { - readptr=TDFXReadLongMMIO(pTDFX, SST_FIFO_RDPTRL0); stat=TDFXReadLongMMIO(pTDFX, 0); if (stat&SST_BUSY) i=0; else i++; cnt++; @@ -138,9 +137,7 @@ static void TDFXSyncFifo(ScrnInfoPtr pScrn) } else { getsecs(&end_sec, &dummy); if (end_sec-start_sec>3) { - dummy=TDFXReadLongMMIO(pTDFX, SST_FIFO_RDPTRL0); - if (dummy=readptr) - TDFXResetFifo(pScrn); + TDFXResetFifo(pScrn); start_sec=0; } } @@ -240,6 +237,24 @@ void TDFXSwapContextFifo(ScreenPtr pScreen) pTDFX->fifoSlots = pTDFX->fifoEnd-pTDFX->fifoPtr-8; } +void TDFXLostContext(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn; + TDFXPtr pTDFX; + TDFXSAREAPriv *sPriv; + + pScrn = xf86Screens[pScreen->myNum]; + pTDFX=TDFXPTR(pScrn); + sPriv=(TDFXSAREAPriv*)DRIGetSAREAPrivate(pScreen); + if (!sPriv) return; + if (sPriv->fifoPtr!=(((unsigned char*)pTDFX->fifoPtr)-pTDFX->FbBase) || + sPriv->fifoRead!=(((unsigned char*)pTDFX->fifoRead)-pTDFX->FbBase)) { + sPriv->fifoPtr=(((unsigned char*)pTDFX->fifoPtr)-pTDFX->FbBase); + sPriv->fifoRead=(((unsigned char*)pTDFX->fifoRead)-pTDFX->FbBase); + sPriv->fifoOwner=DRIGetContext(pScreen); + /* ErrorF("Out FifoPtr=%d FifoRead=%d\n", sPriv->fifoPtr, sPriv->fifoRead); */ + } +} #endif static void |