From fc8bd5bde48424e47020eae179c8b331ff69595a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 18 Sep 2004 13:37:30 +0000 Subject: Re-add BIOS panel off code for dpms (Felix Kuehling) Fix weird mode problem on savage4 with dvi and some panels (Felix Kuehling) --- src/savage_driver.c | 32 ++++++++++++++++++-------------- src/savage_driver.h | 1 + src/savage_streams.h | 2 +- src/savage_vbe.c | 17 +++++++++++++++++ 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/savage_driver.c b/src/savage_driver.c index 226fbb6..afc890e 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -3823,20 +3823,24 @@ static void SavageDPMS(ScrnInfoPtr pScrn, int mode, int flags) } if ((!psav->CrtOnly) && psav->PanelX) { - switch (mode) { - case DPMSModeOn: - VGAOUT8(0x3c4, 0x31); /* SR31 bit 4 - FP enable */ - VGAOUT8(0x3c5, VGAIN8(0x3c5) | 0x10); - break; - case DPMSModeStandby: - case DPMSModeSuspend: - case DPMSModeOff: - VGAOUT8(0x3c4, 0x31); /* SR31 bit 4 - FP enable */ - VGAOUT8(0x3c5, VGAIN8(0x3c5) & ~0x10); - break; - default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS mode %d\n", mode); - break; + if (S3_MOBILE_TWISTER_SERIES(psav->Chipset)) { + SavageSetPanelEnabled(psav, (mode == DPMSModeOn)); + } else { + switch (mode) { + case DPMSModeOn: + VGAOUT8(0x3c4, 0x31); /* SR31 bit 4 - FP enable */ + VGAOUT8(0x3c5, VGAIN8(0x3c5) | 0x10); + break; + case DPMSModeStandby: + case DPMSModeSuspend: + case DPMSModeOff: + VGAOUT8(0x3c4, 0x31); /* SR31 bit 4 - FP enable */ + VGAOUT8(0x3c5, VGAIN8(0x3c5) & ~0x10); + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS mode %d\n", mode); + break; + } } } diff --git a/src/savage_driver.h b/src/savage_driver.h index ca7856e..330c896 100644 --- a/src/savage_driver.h +++ b/src/savage_driver.h @@ -452,6 +452,7 @@ void SavageRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SavageSetTextMode( SavagePtr psav ); void SavageSetVESAMode( SavagePtr psav, int n, int Refresh ); +void SavageSetPanelEnabled( SavagePtr psav, Bool active ); void SavageFreeBIOSModeTable( SavagePtr psav, SavageModeTablePtr* ppTable ); SavageModeTablePtr SavageGetBIOSModeTable( SavagePtr psav, int iDepth ); diff --git a/src/savage_streams.h b/src/savage_streams.h index 12fbd7d..2799ca5 100644 --- a/src/savage_streams.h +++ b/src/savage_streams.h @@ -71,7 +71,7 @@ #define SSTREAM_FBSIZE_REG 0x8304 #define SSTREAM_FBADDR2_REG 0x8308 -#define OS_XY(x,y) (((x+1)<<16)|(y+1)) +#define OS_XY(x,y) (((x)<<16)|(y+1)) /*(((x+1)<<16)|(y+1))*/ #define OS_WH(x,y) (((x-1)<<16)|(y)) /* Streams Processor macros */ diff --git a/src/savage_vbe.c b/src/savage_vbe.c index 25e64da..a796850 100644 --- a/src/savage_vbe.c +++ b/src/savage_vbe.c @@ -122,6 +122,23 @@ SavageSetVESAMode( SavagePtr psav, int n, int Refresh ) #endif } +void +SavageSetPanelEnabled( SavagePtr psav, Bool active ) +{ + int iDevInfo; + if( !psav->PanelX ) + return; /* no panel */ + iDevInfo = SavageGetDevice( psav ); + if( active ) + iDevInfo |= LCD_ACTIVE; + else + iDevInfo &= ~LCD_ACTIVE; + SavageClearVM86Regs( psav->pVbe->pInt10 ); + psav->pVbe->pInt10->ax = 0x4f14; /* S3 extensions */ + psav->pVbe->pInt10->bx = 0x0003; /* set active devices */ + psav->pVbe->pInt10->cx = iDevInfo; + xf86ExecX86int10( psav->pVbe->pInt10 ); +} /* Function to get supported device list. */ -- cgit v1.2.3