diff options
author | Alex Deucher <agd5f@yahoo.com> | 2004-10-21 03:58:33 +0000 |
---|---|---|
committer | Alex Deucher <agd5f@yahoo.com> | 2004-10-21 03:58:33 +0000 |
commit | 421efa788e177d91cbe41dedd4f4201c902cbcd5 (patch) | |
tree | 01183d8b3854d8b1ca32e86672e9f21393d37287 | |
parent | 951ee8825f2efb34dc4350c26dacd458067b5954 (diff) |
when using the overlay for Xv, only enable it when displaying the video
otherwise the overlay breaks on mode changes.
-rw-r--r-- | src/savage_driver.c | 22 | ||||
-rw-r--r-- | src/savage_driver.h | 4 | ||||
-rw-r--r-- | src/savage_streams.c | 5 | ||||
-rw-r--r-- | src/savage_video.c | 38 |
4 files changed, 57 insertions, 12 deletions
diff --git a/src/savage_driver.c b/src/savage_driver.c index d794812..3c2d291 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -1912,6 +1912,7 @@ static Bool SavageEnterVT(int scrnIndex, int flags) SavageHideCursor( pScrn ); return TRUE; } + return FALSE; } @@ -1937,7 +1938,8 @@ static void SavageLeaveVT(int scrnIndex, int flags) psav->LockHeld = 1; } #endif - SavageStreamsOff(pScrn); + if (psav->FBStart2nd) + SavageStreamsOff(pScrn); SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr, FALSE); SavageResetStreams(pScrn); SavageDisableMMIO(pScrn); @@ -3058,6 +3060,7 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen, } #endif + SavagePanningCheck(pScrn); #ifdef XvExtension if( !psav->FBStart2nd && !psav->NoAccel /*&& !SavagePanningCheck(pScrn)*/ ) { if (psav->IsSecondary) @@ -3255,10 +3258,11 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) /* do it! */ SavageWriteMode(pScrn, vganew, new, TRUE); - SavageStreamsOn(pScrn); - if (psav->FBStart2nd) + if (psav->FBStart2nd) { + SavageStreamsOn(pScrn); SavageInitSecondaryStream(pScrn); + } SavageAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); return TRUE; @@ -3515,10 +3519,11 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) /* do it! */ SavageWriteMode(pScrn, vganew, new, TRUE); - SavageStreamsOn(pScrn); - if (psav->FBStart2nd) + if (psav->FBStart2nd) { + SavageStreamsOn(pScrn); SavageInitSecondaryStream(pScrn); + } SavageAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); @@ -3555,7 +3560,8 @@ static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen) } if (pScrn->vtSema) { - SavageStreamsOff(pScrn); + if (psav->FBStart2nd) + SavageStreamsOff(pScrn); SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr, FALSE); SavageResetStreams(pScrn); vgaHWLock(hwp); @@ -3677,7 +3683,8 @@ Bool SavageSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) TRACE(("SavageSwitchMode\n")); - SavageStreamsOff(xf86Screens[scrnIndex]); + if (psav->FBStart2nd) + SavageStreamsOff(xf86Screens[scrnIndex]); success = SavageModeInit(xf86Screens[scrnIndex], mode); @@ -3690,6 +3697,7 @@ Bool SavageSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) pSavEnt = pPriv->ptr; SavageModeInit(pSavEnt->pSecondaryScrn, pSavEnt->pSecondaryScrn->currentMode); } + SavagePanningCheck(pScrn); return success; } diff --git a/src/savage_driver.h b/src/savage_driver.h index 223d02b..61c5914 100644 --- a/src/savage_driver.h +++ b/src/savage_driver.h @@ -485,6 +485,10 @@ void SavageInitVideo( ScreenPtr pScreen ); void SavageStreamsOn(ScrnInfoPtr pScrn); void SavageStreamsOff(ScrnInfoPtr pScrn); void SavageInitSecondaryStream(ScrnInfoPtr pScrn); +void SavageInitStreamsOld(ScrnInfoPtr pScrn); +void SavageInitStreamsNew(ScrnInfoPtr pScrn); +void SavageInitStreams2000(ScrnInfoPtr pScrn); + #if (MODE_24 == 32) # define BYTES_PP24 4 diff --git a/src/savage_streams.c b/src/savage_streams.c index f29623a..aa7285a 100644 --- a/src/savage_streams.c +++ b/src/savage_streams.c @@ -9,6 +9,7 @@ static void SavageInitStreamsOld(ScrnInfoPtr pScrn); static void SavageInitStreamsNew(ScrnInfoPtr pScrn); +static void SavageInitStreams2000(ScrnInfoPtr pScrn); static void OverlayTwisterInit(ScrnInfoPtr pScrn); static void OverlayParamInit(ScrnInfoPtr pScrn); @@ -597,6 +598,8 @@ SavageStreamsOn(ScrnInfoPtr pScrn) /* SR70 |= 0x10 */ + psav->videoFlags |= VF_STREAMS_ON; + } void @@ -648,5 +651,7 @@ SavageStreamsOff(ScrnInfoPtr pScrn) VGAOUT8( vgaCRIndex, 0x92 ); VGAOUT8( vgaCRReg, VGAIN8(vgaCRReg) & 0x40 ); + psav->videoFlags &= ~VF_STREAMS_ON; + } diff --git a/src/savage_video.c b/src/savage_video.c index 43de050..677ebf8 100644 --- a/src/savage_video.c +++ b/src/savage_video.c @@ -46,6 +46,8 @@ static void SavageSetColorNew(ScrnInfoPtr pScrn ); static void SavageSetColor2000(ScrnInfoPtr pScrn ); static void (*SavageSetColor)(ScrnInfoPtr pScrn ) = NULL; +static void (*SavageInitStreams)(ScrnInfoPtr pScrn) = NULL; + static void SavageDisplayVideoOld( ScrnInfoPtr pScrn, int id, int offset, short width, short height, int pitch, @@ -239,6 +241,7 @@ void savageOUTREG( SavagePtr psav, unsigned long offset, unsigned long value ) ErrorF( " now %08lx\n", (CARD32)MMIO_IN32( psav->MapBase, offset ) ); } +#if 0 static void SavageClipVWindow(ScrnInfoPtr pScrn) { @@ -263,6 +266,7 @@ SavageClipVWindow(ScrnInfoPtr pScrn) OUTREG( SSTREAM_WINDOW_START_REG, 0x03ff03ff); } } +#endif void SavageInitVideo(ScreenPtr pScreen) { @@ -278,6 +282,7 @@ void SavageInitVideo(ScreenPtr pScreen) newAdaptor = SavageSetupImageVideo(pScreen); SavageInitOffscreenImages(pScreen); + SavageInitStreams = SavageInitStreamsNew; SavageSetColor = SavageSetColorNew; SavageSetColorKey = SavageSetColorKeyNew; SavageDisplayVideo = SavageDisplayVideoNew; @@ -287,6 +292,7 @@ void SavageInitVideo(ScreenPtr pScreen) newAdaptor = SavageSetupImageVideo(pScreen); SavageInitOffscreenImages(pScreen); + SavageInitStreams = SavageInitStreams2000; SavageSetColor = SavageSetColor2000; SavageSetColorKey = SavageSetColorKey2000; SavageDisplayVideo = SavageDisplayVideo2000; @@ -296,6 +302,7 @@ void SavageInitVideo(ScreenPtr pScreen) newAdaptor = SavageSetupImageVideo(pScreen); SavageInitOffscreenImages(pScreen); + SavageInitStreams = SavageInitStreamsOld; SavageSetColor = SavageSetColorOld; SavageSetColorKey = SavageSetColorKeyOld; SavageDisplayVideo = SavageDisplayVideoOld; @@ -924,8 +931,8 @@ SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) REGION_EMPTY(pScrn->pScreen, &pPriv->clip); if(shutdown) { - SavageClipVWindow(pScrn); -/* SavageStreamsOff( pScrn ); */ + /*SavageClipVWindow(pScrn);*/ + SavageStreamsOff( pScrn ); if(pPriv->area) { xf86FreeOffscreenArea(pPriv->area); pPriv->area = NULL; @@ -1277,11 +1284,21 @@ SavageDisplayVideoOld( vgaIOBase = hwp->IOBase; vgaCRIndex = vgaIOBase + 4; vgaCRReg = vgaIOBase + 5; - +#if 0 if ( psav->videoFourCC != id ) { SavageSetBlend(pScrn,id); SavageResetVideo(pScrn); } +#endif + if( psav->videoFourCC != id ) + SavageStreamsOff(pScrn); + + if( !psav->videoFlags & VF_STREAMS_ON ) + { + SavageSetBlend(pScrn,id); + SavageStreamsOn(pScrn); + SavageResetVideo(pScrn); + } if (S3_MOBILE_TWISTER_SERIES(psav->Chipset) && psav->FPExpansion) { @@ -1402,11 +1419,21 @@ SavageDisplayVideoNew( vgaIOBase = hwp->IOBase; vgaCRIndex = vgaIOBase + 4; vgaCRReg = vgaIOBase + 5; - +#if 0 if ( psav->videoFourCC != id ) { SavageSetBlend(pScrn,id); SavageResetVideo(pScrn); } +#endif + if( psav->videoFourCC != id ) + SavageStreamsOff(pScrn); + + if( !psav->videoFlags & VF_STREAMS_ON ) + { + SavageSetBlend(pScrn,id); + SavageStreamsOn(pScrn); + SavageResetVideo(pScrn); + } /* Calculate horizontal and vertical scale factors. */ @@ -1849,7 +1876,8 @@ SavageStopSurface( if(pPriv->isOn) { /*SavagePtr psav = SAVPTR(surface->pScrn);*/ - SavageClipVWindow(surface->pScrn); + /*SavageClipVWindow(surface->pScrn);*/ + SavageStreamsOff( surface->pScrn ); pPriv->isOn = FALSE; } |