summaryrefslogtreecommitdiff
path: root/src/nv_dac.c
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2004-12-10 03:56:42 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2004-12-10 03:56:42 +0000
commit67c89797f62ea53b37927c64e0403e7e7c42de56 (patch)
tree21a3996f2f9a7e928860eb771335c0ad8b57ecf5 /src/nv_dac.c
parent7c34d051168eba499beb20c40fd95703375f4c7b (diff)
Bugzilla #1985 <https://bugs.freedesktop.org/show_bug.cgi?id=1985> sync toxprint_packagertest_20041217_basexprint_packagertest_20041217
12/08/04 version of Nvidia driver from Mark Vojkovich, including these fixes since last sync: Fix some DAC/Graphics memory contention issues on newer NVIDIA chips (specifically, NV40). More PCI IDs. Also, I've had trouble getting some panels to work automagically so I expose an FPTweak option to let the user adjust a troublesome register.
Diffstat (limited to 'src/nv_dac.c')
-rw-r--r--src/nv_dac.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/nv_dac.c b/src/nv_dac.c
index 769179b..f62db58 100644
--- a/src/nv_dac.c
+++ b/src/nv_dac.c
@@ -37,10 +37,38 @@
|* *|
\***************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c,v 1.41 2004/10/05 21:23:03 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c,v 1.44 2004/12/09 00:21:04 mvojkovi Exp $ */
#include "nv_include.h"
+static int
+NVDACPanelTweaks(NVPtr pNv, NVRegPtr state)
+{
+ int tweak = 0;
+
+ if(pNv->usePanelTweak) {
+ tweak = pNv->PanelTweak;
+ } else {
+ /* begin flat panel hacks */
+ /* This is unfortunate, but some chips need this register
+ tweaked or else you get artifacts where adjacent pixels are
+ swapped. There are no hard rules for what to set here so all
+ we can do is experiment and apply hacks. */
+
+ if(((pNv->Chipset & 0xffff) == 0x0328) && (state->bpp == 32)) {
+ /* At least one NV34 laptop needs this workaround. */
+ tweak = -1;
+ }
+
+ if((pNv->Chipset & 0xfff0) == 0x0310) {
+ tweak = 1;
+ }
+ /* end flat panel hacks */
+ }
+
+ return tweak;
+}
+
Bool
NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
@@ -185,6 +213,8 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
nvReg->scale |= (1 << 8) ;
}
+ nvReg->crtcSync = pNv->PRAMDAC[0x0828/4];
+ nvReg->crtcSync += NVDACPanelTweaks(pNv, nvReg);
}
nvReg->vpll = nvReg->pll;
@@ -192,6 +222,9 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
nvReg->vpllB = nvReg->pllB;
nvReg->vpll2B = nvReg->pllB;
+ VGA_WR08(pNv->PCIO, 0x03D4, 0x1C);
+ nvReg->fifo = VGA_RD08(pNv->PCIO, 0x03D5) & ~(1<<5);
+
if(pNv->CRTCnumber) {
nvReg->head = pNv->PCRTC0[0x00000860/4] & ~0x00001000;
nvReg->head2 = pNv->PCRTC0[0x00002860/4] | 0x00001000;