Hi Xavier,

Try this third version of the patch.
I changed the FP power on / off code to use software controlled method already 
proven with CX700 / VX700 and VX800 chipsets.

Regards,

Kevin Brace
The OpenChrome Project maintainer / developer
diff --git a/src/via_fp.c b/src/via_fp.c
index dea6ec9..6e7d63a 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -179,6 +179,57 @@ viaLVDS1SetFormat(ScrnInfoPtr pScrn, CARD8 format)
 }
 
 /*
+ * Turns LVDS1 output color dithering on or off. (18-bit color display vs.
+ * 24-bit color display)
+ */
+static void
+viaLVDS1SetDithering(ScrnInfoPtr pScrn, CARD8 ditheringStatus)
+{
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered viaLVDS1SetDithering.\n"));
+
+    /* Set LVDS1 output color dithering bit. */
+    /* 3X5.88[0] - LVDS Channel 1 Output Bits
+     *             0: 24 bits (dithering off)
+     *             1: 18 bits (dithering on) */
+    ViaCrtcMask(hwp, 0x88, ditheringStatus ? 0x01 : 0x00, 0x01);
+
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "LVDS1 Output Color Dithering: %s\n",
+                ditheringStatus ? "On (18 bit)" : "Off (24 bit)");
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting viaLVDS1SetDithering.\n"));
+}
+
+/*
+ * Sets output format of LVDS1 to rotation or sequential mode.
+ */
+static void
+viaLVDS1SetOutputFormat(ScrnInfoPtr pScrn, CARD8 outputFormat)
+{
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered viaLVDS1SetOutputFormat.\n"));
+
+    /* Set LVDS1 output format. */
+    /* 3X5.88[6] - LVDS Channel 1 Output Format
+     *             0: Rotation
+     *             1: Sequential */
+    ViaCrtcMask(hwp, 0x88, outputFormat ? 0x40 : 0x00, 0x40);
+
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "LVDS1 Output Format: %s\n",
+                outputFormat ? "Sequential" : "Rotation");
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting viaLVDS1SetOutputFormat.\n"));
+}
+
+/*
  * Sets CX700 or later single chipset's LVDS2 I/O pad state.
  */
 static void
@@ -733,20 +784,9 @@ ViaLVDSPower(ScrnInfoPtr pScrn, Bool Power_On)
 
         ViaLVDSSoftwarePowerSecondSequence(pScrn, Power_On);
         break;
-
     case VIA_VX855:
     case VIA_VX900:
-        /* Is the integrated TMDS transmitter (DVI) not in use? */
-        crd2 = hwp->readCrtc(hwp, 0xD2);
-        if (((pVia->Chipset == VIA_CX700)
-                || (pVia->Chipset == VIA_VX800)
-                || (pVia->Chipset == VIA_VX855)
-                || (pVia->Chipset == VIA_VX900))
-            && (!(crd2 & 0x10))) {
-            ViaLVDSHardwarePowerFirstSequence(pScrn, Power_On);
-        }
-
-        ViaLVDSHardwarePowerSecondSequence(pScrn, Power_On);
+        ViaLVDSSoftwarePowerFirstSequence(pScrn, Power_On);
         break;
     default:
         ViaLVDSHardwarePowerFirstSequence(pScrn, Power_On);
@@ -1281,8 +1321,6 @@ via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
             break;
         case VIA_CX700:
         case VIA_VX800:
-        case VIA_VX855:
-        case VIA_VX900:
             viaLVDS2SetDisplaySource(pScrn, iga->index ? 0x01 : 0x00);
 
             /* Set LVDS2 output color dithering. */
@@ -1294,6 +1332,19 @@ via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
             /* Set LVDS2 output to OPENLDI mode. */
             viaLVDS2SetFormat(pScrn, 0x01);
             break;
+        case VIA_VX855:
+        case VIA_VX900:
+            viaLVDS1SetDisplaySource(pScrn, iga->index ? 0x01 : 0x00);
+
+            /* Set LVDS1 output color dithering. */
+            viaLVDS1SetDithering(pScrn, Panel->useDithering ? TRUE : FALSE);
+
+            /* Set LVDS1 output format to sequential mode. */
+            viaLVDS1SetOutputFormat(pScrn, 0x01);
+
+            /* Set LVDS1 output to OPENLDI mode. */
+            viaLVDS1SetFormat(pScrn, 0x01);
+            break;
         default:
             break;
         }
_______________________________________________
Openchrome-devel mailing list
Openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel

Reply via email to