diff options
author | Yusuf Khan <yusisamerican@gmail.com> | 2024-01-21 16:07:49 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-05-11 19:56:18 +0000 |
commit | 3d729d58bc85aa3ec53361f4f5fd220edd6a234e (patch) | |
tree | e351bba0a7040c9af1406badae6b6314f8587e8b /src | |
parent | 30c27a60bf9831e765382824c8ea315505c75bad (diff) |
g80/disp: preinit all heads we know in display
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/16>
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]; |