i810: use vgahw functions instead of roll-your-own

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2011-10-30 16:34:05 +01:00
parent 4aeea489ed
commit e8b8adeab3
2 changed files with 19 additions and 13 deletions

View File

@ -239,26 +239,29 @@ I810SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
{
int tmp;
I810Ptr pI810 = I810PTR(pScrn);
vgaHWPtr hwp;
#ifdef ARGB_CURSOR
if (pI810->CursorIsARGB)
return;
#endif
hwp = VGAHWPTR(pScrn);
tmp = INREG8(PIXPIPE_CONFIG_0);
tmp |= EXTENDED_PALETTE;
OUTREG8(PIXPIPE_CONFIG_0, tmp);
pI810->writeStandard(pI810, DACMASK, 0xFF);
pI810->writeStandard(pI810, DACWX, 0x04);
hwp->writeDacMask(hwp, 0xFF);
hwp->writeDacWriteAddr(hwp, 0x04);
pI810->writeStandard(pI810, DACDATA, (bg & 0x00FF0000) >> 16);
pI810->writeStandard(pI810, DACDATA, (bg & 0x0000FF00) >> 8);
pI810->writeStandard(pI810, DACDATA, (bg & 0x000000FF));
hwp->writeDacData(hwp, (bg & 0x00FF0000) >> 16);
hwp->writeDacData(hwp, (bg & 0x0000FF00) >> 8);
hwp->writeDacData(hwp, (bg & 0x000000FF));
pI810->writeStandard(pI810, DACDATA, (fg & 0x00FF0000) >> 16);
pI810->writeStandard(pI810, DACDATA, (fg & 0x0000FF00) >> 8);
pI810->writeStandard(pI810, DACDATA, (fg & 0x000000FF));
hwp->writeDacData(hwp, (fg & 0x00FF0000) >> 16);
hwp->writeDacData(hwp, (fg & 0x0000FF00) >> 8);
hwp->writeDacData(hwp, (fg & 0x000000FF));
tmp = INREG8(PIXPIPE_CONFIG_0);
tmp &= ~EXTENDED_PALETTE;

View File

@ -790,7 +790,7 @@ DoSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
* into the fields of the vgaI810Rec structure goes here.
*/
i810Reg->IOControl = hwp->readCrtc(hwp, IO_CTNL);
i810Reg->AddressMapping = pI810->readControl(pI810, GRX, ADDRESS_MAPPING);
i810Reg->AddressMapping = hwp->readGr(hwp, ADDRESS_MAPPING);
i810Reg->BitBLTControl = INREG8(BITBLT_CNTL);
i810Reg->VideoClk2_M = INREG16(VCLK2_VCO_M);
i810Reg->VideoClk2_N = INREG16(VCLK2_VCO_N);
@ -985,10 +985,10 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
temp |= i810Reg->InterlaceControl;
hwp->writeCrtc(hwp, INTERLACE_CNTL, temp);
temp = pI810->readControl(pI810, GRX, ADDRESS_MAPPING);
temp = hwp->readGr(hwp, ADDRESS_MAPPING);
temp &= 0xE0; /* Save reserved bits 7:5 */
temp |= i810Reg->AddressMapping;
pI810->writeControl(pI810, GRX, ADDRESS_MAPPING, temp);
hwp->writeGr(hwp, ADDRESS_MAPPING, temp);
/* Setting the OVRACT Register for video overlay */
{
@ -2061,6 +2061,7 @@ I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
I810Ptr pI810;
unsigned char SEQ01 = 0;
int DPMSSyncSelect = 0;
vgaHWPtr hwp;
pI810 = I810PTR(pScrn);
switch (PowerManagementMode) {
@ -2086,9 +2087,11 @@ I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
break;
}
hwp = VGAHWPTR(pScrn);
/* Turn the screen on/off */
SEQ01 |= pI810->readControl(pI810, SRX, 0x01) & ~0x20;
pI810->writeControl(pI810, SRX, 0x01, SEQ01);
SEQ01 |= hwp->readSeq(hwp, 0x01) & ~0x20;
hwp->writeSeq(hwp, 0x01, SEQ01);
/* Set the DPMS mode */
OUTREG8(DPMS_SYNC_SELECT, DPMSSyncSelect);