summaryrefslogtreecommitdiff
path: root/src/nv_dac.c
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-12-16 01:42:35 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-12-16 01:42:35 +0000
commit9ec40b5af9d910fabb047906fcfd768777b74ffe (patch)
tree9e97fea0ecc3dbadc0ed3c038d8ef504a65de5bf /src/nv_dac.c
parent2b3cb71eb2cdd71bda3e3e0072fc3df9f111e0a4 (diff)
xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c //bugs.freedesktop.org/show_bug.cgi?id=1985) attachment #1504 (https://bugs.freedesktop.org/attachment.cgi?id=1504) sync to 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;