From bae20ae42a78604027b8ebdc549ff2347c5d12e8 Mon Sep 17 00:00:00 2001 From: Kevin Brace Date: Mon, 30 Nov 2015 03:59:14 -0800 Subject: [PATCH 07/10] Made improvements to VIARestore function inside via_vgahw.c. CRTCER (CRT Controller Extended Registers) 0x6a, 0x6b, and 0x6c are now being restored. The previous patch was not restoring these registers at all, so it is now being restored to the values saved by VIASave function. --- src/via_vgahw.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/via_vgahw.c b/src/via_vgahw.c index b6aaf25..fc3189b 100644 --- a/src/via_vgahw.c +++ b/src/via_vgahw.c @@ -165,7 +165,15 @@ void VIASave(ScrnInfoPtr pScrn) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Saving sequencer registers.\n")); /* Unlock and save extended registers. */ +/* hwp->writeSeq(hwp, 0x10, 0x01); +*/ +/* Sequencer Extended Registers */ +/* Extended Register Unlock (0x3c5.0x10[0]) */ +/* Set Extended Register Unlock register bit [0] to 1 in order to */ +/* enable access to VIA Technologies graphics extended graphics */ +/* features. */ + ViaSeqMask(hwp, 0x10, 0x01, 0x01); Regs->SR14 = hwp->readSeq(hwp, 0x14); Regs->SR15 = hwp->readSeq(hwp, 0x15); @@ -574,7 +582,15 @@ void VIARestore(ScrnInfoPtr pScrn) vgaHWProtect(pScrn, TRUE); /* Unlock extended registers. */ +/* hwp->writeSeq(hwp, 0x10, 0x01); +*/ +/* Sequencer Extended Registers */ +/* Extended Register Unlock (0x3c5.0x10[0]) */ +/* Set Extended Register Unlock register bit [0] to 1 in order to */ +/* enable access to VIA Technologies graphics extended graphics */ +/* features. */ + ViaSeqMask(hwp, 0x10, 0x01, 0x01); /*=* CR6A, CR6B, CR6C must be reset before restoring standard vga regs, or system will hang. *=*/ @@ -1039,6 +1055,16 @@ void VIARestore(ScrnInfoPtr pScrn) } +/* Restoring the secondary display if it is in use. */ + hwp->writeCrtc(hwp, 0x6c, Regs->EXCR[0x6c - 0x50]); + hwp->writeCrtc(hwp, 0x6b, Regs->EXCR[0x6b - 0x50]); + + hwp->writeCrtc(hwp, 0x6a, 0x00); + ViaCrtcMask(hwp, 0x6a, Regs->EXCR[0x6a - 0x50], 0xbf); + ViaCrtcMask(hwp, 0x6a, 0x40, 0x40); + + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Finished restoring extended CRTC registers.\n")); #ifdef DEBUG -- 1.7.9.5