summaryrefslogtreecommitdiff
path: root/src/i830_sdvo.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-04-24 17:23:06 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-04-24 17:23:06 -0700
commit7c5495d0903a50af7eb9908aec2af0ed6f83340a (patch)
treeed5966f02532907537937c8e0795be563336687e /src/i830_sdvo.c
parenta555e28e5afc81969ef7b28482e654cc26b3a446 (diff)
Try to choose the right SDVO clock rate multiplier for the mode, so we staymodesetting-sdvo-stuffing
within the appropriate bus limits. This currently causes me to fail to sync with my DVI output.
Diffstat (limited to 'src/i830_sdvo.c')
-rw-r--r--src/i830_sdvo.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 99cdc6ac..5f2d37e3 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -477,6 +477,7 @@ I830SDVOPreSetMode(I830SDVOPtr s, DisplayModePtr mode)
CARD8 c17a[8];
CARD16 out_timings[6];
CARD16 clock_min, clock_max;
+ int mult;
/* do some mode translations */
h_blank_len = mode->CrtcHBlankEnd - mode->CrtcHBlankStart;
@@ -536,10 +537,21 @@ I830SDVOPreSetMode(I830SDVOPtr s, DisplayModePtr mode)
I830SDVOSetInputTimingsPart2(s, curr_table[3], curr_table[4],
out_timings[5]);
- /*if (mode->PrivFlags & I830_MFLAG_DOUBLE)
- I830SDVOSetClockRateMult(s, 0x02);
- else */
- I830SDVOSetClockRateMult(s, 0x01);
+ for (mult = 1; mult <= 4; mult *= 2) {
+ if (mode->Clock * mult >= 100000 && mode->Clock * mult <= 200000)
+ break;
+ }
+ switch (mult) {
+ case 1:
+ I830SDVOSetClockRateMult(s, SDVO_CLOCK_RATE_MULT_1X);
+ break;
+ case 2:
+ I830SDVOSetClockRateMult(s, SDVO_CLOCK_RATE_MULT_2X);
+ break;
+ case 4:
+ I830SDVOSetClockRateMult(s, SDVO_CLOCK_RATE_MULT_4X);
+ break;
+ }
return TRUE;
}