[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#226973: xserver-xfree86: [glint] second card at wrong resolution



> > barely usable, so I would include it for now.  If I manage to come up
> > with anything that fixes the problem completely, it will no doubt depend
> > on that patch.
> 
> Okay.  I just added a TODO item for this.

The following patch helps immensely.  In fact, I could be hallucinating,
but it seems like the secondary head is now better than the primary one.
This includes the previous patch upon which I claimed this would depend;
I can separate it out if necessary.

I assume this won't negatively affect any other cards, but I have no way
of testing that.  Also, I don't know that all of these writes are
necessary.  If I recall correctly, the ones with the most impact are the
TextureColorMode, ChipConfig, FIFOControl, and the bitmasks.

Let me know how to proceed.

--- xfree86-4.3.0/build-tree/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h	2003-01-11 22:55:47.000000000 -0500
+++ xfree86-lessfucked/build-tree/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h	2004-04-08 12:09:02.000000000 -0400
@@ -75,6 +75,10 @@
 			 ((pGlint->PciInfo->subsysCard == 0x0100) ||  \
 			  (pGlint->PciInfo->subsysCard == 0x0002)))
 
+/* Tech-Source Raptor GFX 8P (Permedia 2V) */
+#define IS_TSGFX8P	((pGlint->PciInfo->subsysVendor == 0x1227) && \
+                         (pGlint->PciInfo->subsysCard   == 0x0006))
+
 /**********************************************
 *  GLINT 500TX Configuration Region Registers *
 ***********************************************/
@@ -294,6 +298,14 @@
 #define PMFifoControl							0x3078
 
 /* Permedia 2 RAMDAC Registers */
+#define PM2DACFIFOControl						0x3078
+#define PM2DACFilterMode						0x8c00
+#define PM2DACFBSourceOffset						0x8a88
+#define PM2DACFBReadPixel						0x8ad0
+#define PM2DACAreaStippleMode						0x81a0
+#define PM2DACLogicalOpMode						0x8828
+#define PM2DACTextureColorMode						0x8680
+
 #define PM2DACWriteAddress						0x4000
 #define PM2DACIndexReg							0x4000
 #define PM2DACData							0x4008
--- xfree86-4.3.0/build-tree/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c	2002-05-07 19:15:59.000000000 -0400
+++ xfree86-lessfucked/build-tree/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c	2004-04-08 12:08:14.000000000 -0400
@@ -79,6 +79,36 @@
 {
     GLINTPtr pGlint = GLINTPTR(pScrn);
 
+    /* fun stuff */
+    Permedia2vOutIndReg(pScrn, PM2VDACRDMiscControl, 0x00, 0);
+    GLINT_SLOW_WRITE_REG(0xffffffff,PMBypassWriteMask);
+    GLINT_SLOW_WRITE_REG(GLINT_READ_REG(ChipConfig)&~0x06,ChipConfig);
+    GLINT_SLOW_WRITE_REG(0x01,Aperture1);
+    GLINT_SLOW_WRITE_REG(0xd2,PMHTotal);
+    GLINT_SLOW_WRITE_REG(0x33,PMHbEnd);
+    GLINT_SLOW_WRITE_REG(0x33,PMHgEnd);
+    GLINT_SLOW_WRITE_REG(0xa0,PMScreenStride);
+    GLINT_SLOW_WRITE_REG(0x06,PMHsStart);
+    GLINT_SLOW_WRITE_REG(0x14,PMHsEnd);
+    GLINT_SLOW_WRITE_REG(0x0429,PMVTotal);
+    GLINT_SLOW_WRITE_REG(0x2a,PMVbEnd);
+    GLINT_SLOW_WRITE_REG(0x00,PMVsStart);
+    GLINT_SLOW_WRITE_REG(0x03,PMVsEnd);
+    GLINT_SLOW_WRITE_REG(0x00,PMScreenBase);
+    GLINT_SLOW_WRITE_REG(0x00,PMVideoControl);
+    Permedia2vOutIndReg(pScrn, PM2VDACRDOverlayKey, 0x00, 0);
+    Permedia2vOutIndReg(pScrn, PM2VDACRDColorFormat, 0x00, 0x0e);
+    Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0PreScale, 0x00, 0x0c);
+    Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0FeedbackScale, 0x00, 0xb5);
+    Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0PostScale, 0x00, 0x01);
+    GLINT_SLOW_WRITE_REG(0x00,PM2DACFIFOControl);
+    GLINT_SLOW_WRITE_REG(0x0400,PM2DACFilterMode);
+    GLINT_SLOW_WRITE_REG(0x00,PM2DACFBSourceOffset);
+    GLINT_SLOW_WRITE_REG(0x00,PM2DACFBReadPixel);
+    GLINT_SLOW_WRITE_REG(0x00,PM2DACAreaStippleMode);
+    GLINT_SLOW_WRITE_REG(0x00,PM2DACLogicalOpMode);
+    GLINT_SLOW_WRITE_REG(0x00,PM2DACTextureColorMode);
+
     /* disable MCLK */
     Permedia2vOutIndReg(pScrn, PM2VDACRDMClkControl, 0x00, 0); 
 
@@ -96,6 +126,9 @@
     /* Now re-boot the SGRAM's */
     GLINT_SLOW_WRITE_REG(0xe6002021,PMMemConfig);
     GLINT_SLOW_WRITE_REG(0x00000020,PMBootAddress);
+
+    /* more fun stuff */
+    GLINT_SLOW_WRITE_REG(0xffffffff,PMFramebufferWriteMask);
 }
 
 void
@@ -113,21 +146,21 @@
 	Permedia2VPreInitSecondary(pScrn);
     }
 
-#if defined(__alpha__)
+#if defined(__alpha__) || defined(__sparc__)
     /*
      * On Alpha, we have to init secondary PM2V cards, since
      * int10 cannot be run on the OEMed cards with VGA disable
      * jumpers.
      */
     if (!xf86IsPrimaryPci(pGlint->PciInfo)) {
-	if ( IS_QPM2V ) {
+	if ( (IS_QPM2V) || (IS_TSGFX8P) ) {
 
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		       "PM2V secondary: initializing\n");
 	    Permedia2VPreInitSecondary(pScrn);
 	}
     }
-#endif /* __alpha__ */
+#endif /* __alpha__ || __sparc__ */
 }
 
 Bool



Reply to: