1600sw-range-hack.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --- xf86-video-i128-1.2.0/src/i128_driver.c.1600sw-hack 2006-04-07 15:10:18.000000000 -0400
  2. +++ xf86-video-i128-1.2.0/src/i128_driver.c 2006-08-28 14:15:22.000000000 -0400
  3. @@ -508,6 +508,45 @@ I128AvailableOptions(int chipid, int bus
  4. return I128Options;
  5. }
  6. +#define MODEPREFIX(name) NULL, NULL, name, 0, M_T_DRIVER
  7. +#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
  8. +
  9. +static DisplayModeRec sgi1600sw_modes[] = {
  10. + { MODEPREFIX("1600x1024"), 103125, 1600, 1600, 1656, 1664, 0,
  11. + 1024, 1024, 1029, 1030, 0,
  12. + V_PHSYNC | V_PVSYNC, MODESUFFIX },
  13. + { MODEPREFIX("800x512"), 54375, 800, 800, 840, 848, 0,
  14. + 512, 512, 514, 515, 0,
  15. + V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX }
  16. +};
  17. +
  18. +static void
  19. +add1600SWModes(ScrnInfoPtr pScrn)
  20. +{
  21. + DisplayModePtr modes;
  22. + int hskew = 0;
  23. +
  24. + modes = xnfcalloc(2, sizeof(*modes));
  25. +
  26. + memcpy(modes, sgi1600sw_modes, 2 * sizeof(*modes));
  27. +
  28. + switch (pScrn->bitsPerPixel) {
  29. + case 8:
  30. + hskew = 1; break;
  31. + case 16:
  32. + hskew = 5; break;
  33. + case 24: case 32:
  34. + hskew = 7; break;
  35. + default: break;
  36. + }
  37. +
  38. + modes[0].HSkew = modes[1].HSkew = hskew;
  39. +
  40. + modes[0].next = &modes[1];
  41. + modes[1].next = pScrn->monitor->Modes;
  42. +
  43. + pScrn->monitor->Modes = modes;
  44. +}
  45. /* Mandatory
  46. *
  47. @@ -1081,6 +1120,18 @@ I128PreInit(ScrnInfoPtr pScrn, int flags
  48. xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
  49. "Digital flat panel forced\n");
  50. + if (pI128->FlatPanel && !mon) {
  51. + /* Since DDC can be unreliable, jam in known 1600SW data */
  52. + pScrn->monitor->nHsync = 1;
  53. + pScrn->monitor->hsync[0].lo = 30.0;
  54. + pScrn->monitor->hsync[0].hi = 72.0;
  55. + pScrn->monitor->nVrefresh = 1;
  56. + pScrn->monitor->vrefresh[0].lo = 58;
  57. + pScrn->monitor->vrefresh[0].hi = 62;
  58. + pScrn->monitor->maxPixClock = 104 * 1000;
  59. + add1600SWModes(pScrn);
  60. + }
  61. +
  62. xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
  63. "Using SilverHammer programmable clock (MCLK %1.3f MHz)\n",
  64. mclk / 1000.0);