diff options
author | Xavier Bachelot <xavier@bachelot.org> | 2007-10-10 10:14:07 +0000 |
---|---|---|
committer | Xavier Bachelot <xavier@bachelot.org> | 2007-10-10 10:14:07 +0000 |
commit | 079a0913be0ed3d66c6ca2820bfdc65b80da479c (patch) | |
tree | 17b3aba3f8d8ea734c2be2850597cb968a389561 /src/via_mode.c | |
parent | 4005c48c5944d2141854ce40899fcb4f744a6c94 (diff) |
sync with experimental branch (changeset 401-403,405-407)
Diffstat (limited to 'src/via_mode.c')
-rw-r--r-- | src/via_mode.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/src/via_mode.c b/src/via_mode.c index c1839570ff8e..3d234937180c 100644 --- a/src/via_mode.c +++ b/src/via_mode.c @@ -1774,6 +1774,42 @@ ViaModePrimary(ScrnInfoPtr pScrn, DisplayModePtr mode) hwp->disablePalette(hwp); } +void +ViaModeSecondaryVGAFetchCount(ScrnInfoPtr pScrn, int width) { + + vgaHWPtr hwp = VGAHWPTR(pScrn); + CARD16 temp; + + /* fetch count */ + temp = (width * (pScrn->bitsPerPixel >> 3)) >> 3; + /* Make sure that this is 32byte aligned */ + if (temp & 0x03) { + temp += 0x03; + temp &= ~0x03; + } + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Fetch Count: 0x%03X\n", temp)); + hwp->writeCrtc(hwp, 0x65, (temp >> 1) & 0xFF); + ViaCrtcMask(hwp, 0x67, temp >> 7, 0x0C); +} + +void +ViaModeSecondaryVGAOffset(ScrnInfoPtr pScrn) { + + vgaHWPtr hwp = VGAHWPTR(pScrn); + CARD16 temp; + + /* offset */ + temp = (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)) >> 3; + if (temp & 0x03) { /* Make sure that this is 32byte aligned */ + temp += 0x03; + temp &= ~0x03; + } + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Offset: 0x%03X\n", temp)); + hwp->writeCrtc(hwp, 0x66, temp & 0xFF); + ViaCrtcMask(hwp, 0x67, temp >> 8, 0x03); + +} + /* * */ @@ -1901,26 +1937,9 @@ ViaModeSecondaryVGA(ScrnInfoPtr pScrn, DisplayModePtr mode) temp = mode->CrtcVSyncEnd; ViaCrtcMask(hwp, 0x5F, temp, 0x1F); - /* offset */ - temp = (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)) >> 3; - if (temp & 0x03) { /* Make sure that this is 32byte aligned */ - temp += 0x03; - temp &= ~0x03; - } - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Offset: 0x%03X\n", temp)); - hwp->writeCrtc(hwp, 0x66, temp & 0xFF); - ViaCrtcMask(hwp, 0x67, temp >> 8, 0x03); + ViaModeSecondaryVGAOffset(pScrn); + ViaModeSecondaryVGAFetchCount(pScrn, mode->CrtcHDisplay); - /* fetch count */ - temp = (mode->CrtcHDisplay * (pScrn->bitsPerPixel >> 3)) >> 3; - /* Make sure that this is 32byte aligned */ - if (temp & 0x03) { - temp += 0x03; - temp &= ~0x03; - } - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Fetch Count: 0x%03X\n", temp)); - hwp->writeCrtc(hwp, 0x65, (temp >> 1) & 0xFF); - ViaCrtcMask(hwp, 0x67, temp >> 7, 0x0C); } /* |