xf86-video-intel: Branch 'modesetting' - 2 commits - src/i830_debug.c src/i830_display.c src/i830_sdvo.c
Keith Packard
keithp at kemper.freedesktop.org
Thu Dec 7 00:47:09 EET 2006
src/i830_debug.c | 2 +-
src/i830_display.c | 16 +++++++++++++---
src/i830_sdvo.c | 15 ++-------------
3 files changed, 16 insertions(+), 17 deletions(-)
New commits:
diff-tree d5ec9d2160f47f21a6015c1cc05b57274cbb0471 (from 5d345c13a949caef384a63769d7185885de6d26d)
Author: Keith Packard <keithp at bouzouki.jf.intel.com>
Date: Wed Dec 6 14:44:40 2006 -0800
Cannot modify DPLL register in output mode_set function.
DPLL register contains clock setup, so it cannot be written
from the output mode_set function or 'bad things' happen.
diff --git a/src/i830_display.c b/src/i830_display.c
index 3d0c3af..0e5a09a 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -624,15 +624,22 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, Dis
fp = clock.n << 16 | clock.m1 << 8 | clock.m2;
- i830PrintPll("chosen", &clock);
- ErrorF("clock regs: 0x%08x, 0x%08x\n", (int)dpll, (int)fp);
-
dpll = DPLL_VGA_MODE_DIS;
if (IS_I9XX(pI830)) {
if (is_lvds)
dpll |= DPLLB_MODE_LVDS;
else
dpll |= DPLLB_MODE_DAC_SERIAL;
+ if (is_sdvo)
+ {
+ dpll |= DPLL_DVO_HIGH_SPEED;
+ if (IS_I945G(pI830) || IS_I945GM(pI830))
+ {
+ int sdvo_pixel_multiply = adjusted_mode->Clock / mode->Clock;
+ dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES;
+ }
+ }
+
/* compute bitmask from p1 value */
dpll |= (1 << (clock.p1 - 1)) << 16;
switch (clock.p2) {
@@ -719,6 +726,9 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, Dis
pipeconf &= ~PIPEACONF_DOUBLE_WIDE;
}
+ i830PrintPll("chosen", &clock);
+ ErrorF("clock regs: 0x%08x, 0x%08x\n", (int)dpll, (int)fp);
+
OUTREG(fp_reg, fp);
OUTREG(dpll_reg, dpll);
if (IS_I965G(pI830)) {
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 331a519..87dc9d9 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -557,8 +557,7 @@ i830_sdvo_mode_set(xf86OutputPtr output,
xf86CrtcPtr crtc = output->crtc;
I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
Bool input1, input2;
- CARD32 dpll, sdvox;
- int dpll_reg = (intel_crtc->pipe == 0) ? DPLL_A : DPLL_B;
+ CARD32 sdvox;
int dpll_md_reg = (intel_crtc->pipe == 0) ? DPLL_A_MD : DPLL_B_MD;
int sdvo_pixel_multiply;
int i;
@@ -614,9 +613,6 @@ i830_sdvo_mode_set(xf86OutputPtr output,
output_dtd.part2.v_sync_off_high = v_sync_offset & 0xc0;
output_dtd.part2.reserved = 0;
- /* Turn off the screens before adjusting timings */
- i830_sdvo_set_active_outputs(output, 0);
-
/* Set the output timing to the screen */
i830_sdvo_set_target_output(output, dev_priv->active_outputs);
i830_sdvo_set_output_timing(output, &output_dtd);
@@ -668,20 +664,16 @@ i830_sdvo_mode_set(xf86OutputPtr output,
if (intel_crtc->pipe == 1)
sdvox |= SDVO_PIPE_B_SELECT;
- dpll = INREG(dpll_reg);
-
sdvo_pixel_multiply = i830_sdvo_get_pixel_multiplier(mode);
if (IS_I965G(pI830)) {
OUTREG(dpll_md_reg, (0 << DPLL_MD_UDI_DIVIDER_SHIFT) |
((sdvo_pixel_multiply - 1) << DPLL_MD_UDI_MULTIPLIER_SHIFT));
} else if (IS_I945G(pI830) || IS_I945GM(pI830)) {
- dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES;
+ /* done in crtc_mode_set as it lives inside the dpll register */
} else {
sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT;
}
- OUTREG(dpll_reg, dpll | DPLL_DVO_HIGH_SPEED);
-
OUTREG(dev_priv->output_device, sdvox);
for (i = 0; i < 2; i++)
@@ -695,9 +687,6 @@ i830_sdvo_mode_set(xf86OutputPtr output,
"First %s output reported failure to sync\n",
SDVO_NAME(dev_priv));
}
-
- i830_sdvo_set_active_outputs(output, dev_priv->active_outputs);
- i830_sdvo_set_target_input(output, TRUE, FALSE);
}
static void
diff-tree 5d345c13a949caef384a63769d7185885de6d26d (from 6ee63364f5fabbc5578bcc9ded38c778595f5a6d)
Author: Keith Packard <keithp at bouzouki.jf.intel.com>
Date: Wed Dec 6 13:19:58 2006 -0800
Clean up SDVO multiplier debug output
diff --git a/src/i830_debug.c b/src/i830_debug.c
index 9f4dd29..8c8b95e 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -159,7 +159,7 @@ DEBUGSTRING(i830_debug_dpll)
break;
}
if (IS_I945G(pI830) || IS_I945GM(pI830)) {
- sprintf(sdvoextra, "SDVO mult %d",
+ sprintf(sdvoextra, ", SDVO mult %d",
(int)(val & SDVO_MULTIPLIER_MASK) >>
SDVO_MULTIPLIER_SHIFT_HIRES);
} else {
More information about the xorg-commit
mailing list