diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/g80_display.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/g80_display.c b/src/g80_display.c index a79c1e1..e56fb78 100644 --- a/src/g80_display.c +++ b/src/g80_display.c @@ -293,18 +293,21 @@ Bool G80DispPreInit(ScrnInfoPtr pScrn) { G80Ptr pNv = G80PTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); /* nouveau guys dont know what this does */ pNv->reg[0x00610184/4] = pNv->reg[0x00614004/4]; /* CRTC capabilities */ - pNv->reg[0x00610190/4] = pNv->reg[0x00616100/4]; - pNv->reg[0x006101a0/4] = pNv->reg[0x00616900/4]; - pNv->reg[0x00610194/4] = pNv->reg[0x00616104/4]; - pNv->reg[0x006101a4/4] = pNv->reg[0x00616904/4]; - pNv->reg[0x00610198/4] = pNv->reg[0x00616108/4]; - pNv->reg[0x006101a8/4] = pNv->reg[0x00616908/4]; - pNv->reg[0x0061019C/4] = pNv->reg[0x0061610C/4]; - pNv->reg[0x006101ac/4] = pNv->reg[0x0061690c/4]; + for(int i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + const int headOff = 0x800 * G80CrtcGetHead(crtc); + + /* Some photos of G80 cards had more than two of these, I think this can be justified */ + pNv->reg[(0x00610190 + (G80CrtcGetHead(crtc) * 0x10))/4] = pNv->reg[(0x00616100 + headOff)/4]; + pNv->reg[(0x00610194 + (G80CrtcGetHead(crtc) * 0x10))/4] = pNv->reg[(0x00616104 + headOff)/4]; + pNv->reg[(0x00610198 + (G80CrtcGetHead(crtc) * 0x10))/4] = pNv->reg[(0x00616108 + headOff)/4]; + pNv->reg[(0x0061019C + (G80CrtcGetHead(crtc) * 0x10))/4] = pNv->reg[(0x0061610C + headOff)/4]; + } /* DAC capabilities */ pNv->reg[0x006101D0/4] = pNv->reg[0x0061A000/4]; pNv->reg[0x006101D4/4] = pNv->reg[0x0061A800/4]; |