[PATCH xf86-video-i128] Better dealing with 1600SW panel.

Matěj Cepl mcepl at redhat.com
Fri Aug 12 12:46:38 PDT 2011


From: Adam Jackson <ajax at redhat.com>

Attempt to force the sync ranges correctly when we detect a 1600SW panel
but don't get EDID info from it.

Also fill in maxPixClock and synthesize the appropriate modes when we
don't get DDC.

Signed-off-by: Matěj Cepl <mcepl at redhat.com>
---
 src/i128_driver.c |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/src/i128_driver.c b/src/i128_driver.c
index 903a3a8..fcb66e9 100644
--- a/src/i128_driver.c
+++ b/src/i128_driver.c
@@ -414,6 +414,45 @@ I128AvailableOptions(int chipid, int busid)
     return I128Options;
 }
 
+#define MODEPREFIX(name) NULL, NULL, name, 0, M_T_DRIVER
+#define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
+
+static DisplayModeRec sgi1600sw_modes[] = {
+    { MODEPREFIX("1600x1024"), 103125, 1600, 1600, 1656, 1664, 0,
+                                      1024, 1024, 1029, 1030, 0,
+      V_PHSYNC | V_PVSYNC, MODESUFFIX },
+    { MODEPREFIX("800x512"),    54375,  800,  800,  840,  848, 0,
+                                       512,  512,  514,  515, 0,
+      V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX }
+};
+
+static void
+add1600SWModes(ScrnInfoPtr pScrn)
+{
+    DisplayModePtr modes;
+    int hskew = 0;
+
+    modes = xnfcalloc(2, sizeof(*modes));
+
+    memcpy(modes, sgi1600sw_modes, 2 * sizeof(*modes));
+
+    switch (pScrn->bitsPerPixel) {
+       case 8:
+           hskew = 1; break;
+       case 16:
+           hskew = 5; break;
+       case 24: case 32:
+           hskew = 7; break;
+       default: break;
+    }
+
+    modes[0].HSkew = modes[1].HSkew = hskew;
+
+    modes[0].next = &modes[1];
+    modes[1].next = pScrn->monitor->Modes;
+
+    pScrn->monitor->Modes = modes;
+}
 
 /* Mandatory
  *
@@ -993,6 +1032,18 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
     	     xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
 			"Digital flat panel forced\n");
 
+         if (pI128->FlatPanel && !mon) {
+             /* Since DDC can be unreliable, jam in known 1600SW data */
+             pScrn->monitor->nHsync = 1;
+             pScrn->monitor->hsync[0].lo = 30.0;
+             pScrn->monitor->hsync[0].hi = 72.0;
+             pScrn->monitor->nVrefresh = 1;
+             pScrn->monitor->vrefresh[0].lo = 58;
+             pScrn->monitor->vrefresh[0].hi = 62;
+             pScrn->monitor->maxPixClock = 104 * 1000;
+             add1600SWModes(pScrn);
+         }
+
     	  xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
 			"Using SilverHammer programmable clock (MCLK %1.3f MHz)\n",
 			mclk / 1000.0);
-- 
1.7.6



More information about the xorg-devel mailing list