diff options
author | Luc Verhaegen <libv@skynet.be> | 2005-12-14 01:05:35 +0000 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2005-12-14 01:05:35 +0000 |
commit | 5f66c6c7bae2b890ec6af5f0be2eb1f9f8ff13e9 (patch) | |
tree | d3f627f2a050b376dd0e57854ddd3e493ac88ba1 | |
parent | f0720502ccd0b1f734bf89fcf25d068606e93b0c (diff) |
[devel-review_virtual_for_VT7205]
- Offset restricts the virtual resolution too.
- VT7205 does have bits 24 and 25 of Primary StartAddress.
- H values are all in 8 pixels. Why do VIA monkeys think it is 16?
-rw-r--r-- | src/via_driver.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/via_driver.c b/src/via_driver.c index 7aeaca0..68f384f 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -735,6 +735,7 @@ static Bool VIAPreInit(ScrnInfoPtr pScrn, int flags) #endif vgaHWPtr hwp; int i; + int MaxHVirtual, MaxVVirtual; VIAFUNC(pScrn->scrnIndex); @@ -1275,26 +1276,31 @@ static Bool VIAPreInit(ScrnInfoPtr pScrn, int flags) clockRanges->interlaceAllowed = TRUE; clockRanges->doubleScanAllowed = FALSE; - /* - * xf86ValidateModes will check that the mode HTotal and VTotal values - * don't exceed the chipset's limit if pScrn->maxHValue and - * pScrn->maxVValue are set. Since our VIAValidMode() already takes - * care of this, we don't worry about setting them here. + /* Virtual mode limitations: + * 1) Offset: or FB line stride. + * Primary: max 16kB - 8 (32bit: 4088 pixels per line) + * Secondary: max 8kB - 8 (32bit: 2040 pixels per line) * - * VT3122A: - * Max Line Pitch: 4080, (FB corruption when higher, driver problem?) - * Max Height: 4096 (and beyond) + * 2) StartAddress: + * Primary: Here we run into separate limits. + * VT3122A: 32MB - 2 or roughly 2048 lines. + * VT7205A: 128MB - 2 or twice the FB size :), so use 4096. + * Secondary: 128MB - 8, but this needs verification. * - * VT3122A: primary AdjustFrame only is able to use 24bits, so we are - * limited to 12x11bits; 4080x2048 (~2:1), 3344x2508 (4:3) or 2896x2896 - * (1:1). - * Test VT3122Cx, VT7205, VT7205A, VT3108, VT3118, VT3344, VT3157 please. + * xf86ValidateModes forces you to hand it pixel counts for both H and V. + * Max pitch and Max startAddress would've been far more effective and + * far more dynamic. * * We should be able to limit the memory available for a mode to 32MB, * yet xf86ValidateModes (or miScanLineWidth) fails to catch this properly * (apertureSize). */ - + MaxHVirtual = 4096 - 8; + if (pVia->Chipset == VT3122) + MaxVVirtual = 2048; + else + MaxVVirtual = 4096; + /* Select valid modes from those available */ i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, /* availModes */ @@ -1302,10 +1308,10 @@ static Bool VIAPreInit(ScrnInfoPtr pScrn, int flags) clockRanges, /* list of clock ranges */ NULL, /* list of line pitches */ 256, /* mini line pitch */ - 3344, /* max line pitch */ - 16 * pScrn->bitsPerPixel, /* pitch inc (bits) */ + MaxHVirtual, /* max line pitch */ + 8 * pScrn->bitsPerPixel, /* pitch inc (bits) */ 128, /* min height */ - 2508, /* max height */ + MaxVVirtual, /* max height */ pScrn->display->virtualX, /* virtual width */ pScrn->display->virtualY, /* virtual height */ pVia->videoRambytes, /* apertureSize */ @@ -1976,7 +1982,7 @@ VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (pVia->hwcursor && !ViaCursorInit(pScrn, pScreen)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Hardware cursor initialization failed\n"); + "Hardware cursor initialization failed\n"); if (pVia->shadowFB) ViaShadowFBInit(pScrn, pScreen); @@ -2227,10 +2233,9 @@ VIAAdjustFrame(int scrnIndex, int x, int y, int flags) hwp->writeCrtc(hwp, 0x0C, (Base & 0xFF00) >> 8); hwp->writeCrtc(hwp, 0x0D, Base & 0xFF); hwp->writeCrtc(hwp, 0x34, (Base & 0xFF0000) >> 16); -#if 0 - /* The VT3122A doesn't have this implemented, it seems. -- Luc */ + /* VT3122A doesn't implement this, but luckily it simply doesn't care. + * Value is properly limited in PreInit anyway. */ ViaCrtcMask(hwp, 0x48, Base >> 24, 0x03); -#endif } } |