summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Airlie <airlied@asimov.stargames.com.au>2006-03-22 12:07:05 +1100
committerDave Airlie <airlied@linux.ie>2006-06-02 10:01:43 +1000
commit540cd6985301443011be51f2345caac72850e71f (patch)
tree99f87a279c1f6edd5728d04bd9db13594e7f1ca4
parent595084d955237f65ddbdc811083b44a328f53e5a (diff)
downloadxorg-driver-xf86-video-intel-540cd6985301443011be51f2345caac72850e71f.tar.gz
make 640x480 and 800x600 work
brute force method
-rw-r--r--src/i830.h3
-rw-r--r--src/i830_driver.c4
-rw-r--r--src/i830_raw.c43
-rw-r--r--src/i830_sdvo.c6
4 files changed, 43 insertions, 13 deletions
diff --git a/src/i830.h b/src/i830.h
index 82c9183a..e71f3544 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -631,4 +631,7 @@ extern Bool I830RawRestoreState(ScrnInfoPtr pScrn, I830RegPtr hw);
#define _845_DRAM_RW_CONTROL 0x90
#define DRAM_WRITE 0x33330000
+/* mode private flags */
+#define I830_MFLAG_DOUBLE 0x1
+
#endif /* _I830_H_ */
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 3defa90b..aca8c281 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3624,8 +3624,8 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags)
clockRanges = xnfcalloc(sizeof(ClockRange), 1);
clockRanges->next = NULL;
- /* 9.4MHz appears to be the smallest that works. */
- clockRanges->minClock = 9500;
+ /* 25MHz appears to be the smallest that works. */
+ clockRanges->minClock = 25000;
clockRanges->maxClock = pI830->MaxClock;
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = TRUE;
diff --git a/src/i830_raw.c b/src/i830_raw.c
index 7efdbdf6..f108a572 100644
--- a/src/i830_raw.c
+++ b/src/i830_raw.c
@@ -102,8 +102,20 @@ splitp(int index, unsigned int p, CARD32 *retp1, CARD32 *retp2)
/* deal with i9xx plls first - incomplete but mostly working */
if (index == PLLS_I9xx)
{
- p1 = (p / 10) + 1;
- p2 = 0;
+ switch (p) {
+ case 10:
+ p1 = 2;
+ p2 = 0;
+ break;
+ case 20:
+ p1 = 1;
+ p2 = 0;
+ break;
+ default:
+ p1 = (p / 10) + 1;
+ p2 = 0;
+ break;
+ }
*retp1 = (unsigned int)p1;
*retp2 = (unsigned int)p2;
@@ -132,7 +144,7 @@ int
i9xx_calc_pll_params(int index, int clock,
CARD32 *retm1, CARD32 *retm2,
CARD32 *retn, CARD32 *retp1, CARD32 *retp2,
- CARD32 *retclock)
+ CARD32 *retclock, int *flags)
{
CARD32 m1, m2, n, p1, p2, n1, testm;
CARD32 f_vco, p, p_best = 0, m, f_out;
@@ -160,7 +172,18 @@ i9xx_calc_pll_params(int index, int clock,
p_min = plls[index].min_p;
if (p_max > plls[index].max_p)
p_max = plls[index].max_p;
-
+
+ if (clock < PLL_REFCLK)
+ {
+ p_min = 10;
+ p_max = 20;
+ *flags |= I830_MFLAG_DOUBLE;
+ /* this makes 640x480 work it really shouldn't
+ - SOMEONE WITHOUT DOCS WOZ HERE */
+ if (clock < 30000)
+ clock *= 4;
+ }
+
DPRINTF(PFX, "p range is %d-%d (%d)\n", p_min, p_max, p_inc);
p = p_min;
@@ -426,7 +449,7 @@ I830RawSetHw(ScrnInfoPtr pScrn, DisplayModePtr pMode)
clock_target = pMode->Clock;
if (IS_I9XX(pI830))
- ret=i9xx_calc_pll_params(index, clock_target, &m1, &m2, &n, &p1, &p2, &clock);
+ ret=i9xx_calc_pll_params(index, clock_target, &m1, &m2, &n, &p1, &p2, &clock, &pMode->PrivFlags);
else
ret=calc_pll_params(index, clock_target, &m1, &m2, &n, &p1, &p2, &clock);
if (ret) {
@@ -459,8 +482,8 @@ I830RawSetHw(ScrnInfoPtr pScrn, DisplayModePtr pMode)
*fp0 = (n << FP_N_DIVISOR_SHIFT) |
(m1 << FP_M1_DIVISOR_SHIFT) |
(m2 << FP_M2_DIVISOR_SHIFT);
- *fp1 = *fp0;
-
+ // *fp1 = *fp0;
+
*dpll &= ~DPLL_2X_CLOCK_ENABLE;
for (i=0; i<pI830->num_outputs; i++)
{
@@ -473,8 +496,10 @@ I830RawSetHw(ScrnInfoPtr pScrn, DisplayModePtr pMode)
//hw->dvoc &= ~DVO_ENABLE;
// hw->dvoc |= 0x4084 | DVO_ENABLE;
//hw->dvob |= DVO_ENABLE;
- hw->dvoc = 0x80480080;
- // hw->dvoc |= ~DVO_ENABLE;
+ if (pMode->PrivFlags & I830_MFLAG_DOUBLE)
+ hw->dvoc = 0x81c80080;
+ else
+ hw->dvoc = 0x80480080;
/* Use display plane A. */
hw->disp_a_ctrl |= DISPLAY_PLANE_ENABLE;
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index e6ee342d..92550a18 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -561,8 +561,10 @@ I830SDVOPreSetMode(I830SDVOPtr s, DisplayModePtr mode)
I830SDVOWriteCommand15(s, curr_table[3], curr_table[4], out_timings[5]);
I830SDVOWriteCommand10(s);
- I830SDVOWriteCommand21(s, 0x01);
-
+ if (mode->PrivFlags & I830_MFLAG_DOUBLE)
+ I830SDVOWriteCommand21(s, 0x02);
+ else
+ I830SDVOWriteCommand21(s, 0x01);
}
Bool