Files
Ertuğrul Erata cbf6a0eb6c move to pisi-2.0 main
not builded.
2015-07-15 19:28:56 +03:00

68 lines
2.2 KiB
Diff

--- xf86-video-i128-1.2.0/src/i128_driver.c.1600sw-hack 2006-04-07 15:10:18.000000000 -0400
+++ xf86-video-i128-1.2.0/src/i128_driver.c 2006-08-28 14:15:22.000000000 -0400
@@ -508,6 +508,45 @@ I128AvailableOptions(int chipid, int bus
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
*
@@ -1081,6 +1120,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);