[PATCH glint] Fix timing errors, as per documentation

Matt Turner mattst88 at gmail.com
Wed Sep 15 20:37:55 PDT 2010


pm2_dac.c:
-	VsEnd and VsStart should have 1 subtracted, say the docs. This also
	matches with the PM3 and PM4 docs, and is what the pm2fb Linux
	kernel driver does.
-	Move VsTotal subtract-1 to instantiation, since it doesn't need to
	be shifted before the subtraction, unlike horizontal timings
	(HTotal, for instance).
-	Remove subtract-1 from HsStart, as the docs don't say this is
	correct. This also matches with the PM3 and PM4 docs, and is what
	the pm2fb Linux kernel driver does.

pm3_dac.c:
-	Subtract 1 from HTotal after the Shiftbpp, as the docs say. This
	error has existed since xf86-video-glint was imported into git and
	has been propagated to the pm3fb Linux kernel driver.

Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
I know there isn't much interest in this hardware, but I'd really appreciate
a couple of people looking over this change to make sure I didn't totally
hose something. Acked-by's would be excellent.

(Is there any way I can actually tell that this change makes a difference?)

 src/pm2_dac.c |    8 +++-----
 src/pm3_dac.c |    2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/pm2_dac.c b/src/pm2_dac.c
index 8541582..3e5b53b 100644
--- a/src/pm2_dac.c
+++ b/src/pm2_dac.c
@@ -122,9 +122,9 @@ Permedia2Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
     pReg->glintRegs[PMScreenStride >> 3] = 
 			Shiftbpp(pScrn,pScrn->displayWidth>>1);
 
-    pReg->glintRegs[PMVTotal >> 3] = mode->CrtcVTotal;
-    pReg->glintRegs[PMVsEnd >> 3] = temp2 + temp4;
-    pReg->glintRegs[PMVsStart >> 3] = temp2;
+    pReg->glintRegs[PMVTotal >> 3] = mode->CrtcVTotal - 1;
+    pReg->glintRegs[PMVsEnd >> 3] = temp2 + temp4 - 1;
+    pReg->glintRegs[PMVsStart >> 3] = temp2 - 1;
     pReg->glintRegs[PMVbEnd >> 3] = mode->CrtcVTotal - mode->CrtcVDisplay;
 
     /* The hw cursor needs /VSYNC to recognize vert retrace. We'll stick
@@ -146,8 +146,6 @@ Permedia2Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
     pReg->glintRegs[VClkCtl >> 3] = (GLINT_READ_REG(VClkCtl) & 0xFFFFFFFC);
     pReg->glintRegs[PMScreenBase >> 3] = 0;
     pReg->glintRegs[PMHTotal >> 3] -= 1;
-    pReg->glintRegs[PMHsStart >> 3] -= 1;
-    pReg->glintRegs[PMVTotal >> 3] -= 1;
 
     pReg->glintRegs[ChipConfig >> 3] = GLINT_READ_REG(ChipConfig) & 0xFFFFFFDD;
     
diff --git a/src/pm3_dac.c b/src/pm3_dac.c
index 34c3a00..b99af0e 100644
--- a/src/pm3_dac.c
+++ b/src/pm3_dac.c
@@ -502,7 +502,7 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg)
     temp3 = mode->CrtcHSyncEnd - mode->CrtcHSyncStart;
     temp4 = mode->CrtcVSyncEnd - mode->CrtcVSyncStart;
 
-    STOREREG(PMHTotal,	Shiftbpp(pScrn, mode->CrtcHTotal - 1));
+    STOREREG(PMHTotal,	Shiftbpp(pScrn, mode->CrtcHTotal) - 1);
     STOREREG(PMHsEnd,	Shiftbpp(pScrn, temp1 + temp3));
     STOREREG(PMHsStart,	Shiftbpp(pScrn, temp1));
     STOREREG(PMHbEnd,	Shiftbpp(pScrn, mode->CrtcHTotal - mode->CrtcHDisplay));
-- 
1.7.1



More information about the xorg-devel mailing list