summaryrefslogtreecommitdiff
path: root/src/i830_sdvo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/i830_sdvo.c')
-rw-r--r--src/i830_sdvo.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index ac5ae48e..c10c4e60 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -277,7 +277,7 @@ i830_sdvo_get_trained_inputs(I830OutputPtr output, Bool *input_1, Bool *input_2)
i830_sdvo_write_cmd(output, SDVO_CMD_GET_TRAINED_INPUTS, NULL, 0);
- i830_sdvo_read_response(output, response, 2);
+ status = i830_sdvo_read_response(output, response, 2);
if (status != SDVO_CMD_STATUS_SUCCESS)
return FALSE;
@@ -508,6 +508,21 @@ i830_sdvo_pre_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
DisplayModePtr mode)
{
I830Ptr pI830 = I830PTR(pScrn);
+
+ OUTREG(SDVOC, INREG(SDVOC) & ~SDVO_ENABLE);
+ OUTREG(SDVOB, INREG(SDVOB) & ~SDVO_ENABLE);
+}
+
+static void
+i830_sdvo_post_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
+ DisplayModePtr mode)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+ Bool out1, out2, input1, input2;
+ CARD32 /*dpll, */ sdvob, sdvoc;
+/* int dpll_reg = (output->pipe == 0) ? DPLL_A : DPLL_B; */
+ int sdvo_pixel_multiply;
+ CARD8 status;
CARD16 width = mode->CrtcHDisplay;
CARD16 height = mode->CrtcVDisplay;
CARD16 h_blank_len, h_sync_len, v_blank_len, v_sync_len;
@@ -588,26 +603,11 @@ i830_sdvo_pre_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
break;
}
- OUTREG(SDVOC, INREG(SDVOC) & ~SDVO_ENABLE);
- OUTREG(SDVOB, INREG(SDVOB) & ~SDVO_ENABLE);
-}
-
-static void
-i830_sdvo_post_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
- DisplayModePtr mode)
-{
- I830Ptr pI830 = I830PTR(pScrn);
- Bool out1, out2, input1, input2;
- CARD32 dpll, sdvob, sdvoc;
- int dpll_reg = (output->pipe == 0) ? DPLL_A : DPLL_B;
- int sdvo_pixel_multiply;
- CARD8 status;
-
/* the BIOS writes out 6 commands post mode set */
/* two 03s, 04 05, 10, 1d */
/* these contain the height and mode clock / 10 by the looks of it */
- i830_sdvo_get_trained_inputs(output, &input1, &input2);
+ status = i830_sdvo_get_trained_inputs(output, &input1, &input2);
/* Warn if the device reported failure to sync. */
if (status == SDVO_CMD_STATUS_SUCCESS && !input1) {
@@ -627,15 +627,17 @@ i830_sdvo_post_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
if (output->pipe == 1)
sdvob |= SDVO_PIPE_B_SELECT;
- dpll = INREG(dpll_reg);
+/* dpll = INREG(dpll_reg); */
sdvo_pixel_multiply = i830_sdvo_get_pixel_multiplier(mode);
- if (IS_I945G(pI830) || IS_I945GM(pI830))
- dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES;
- else
+ if (IS_I945G(pI830) || IS_I945GM(pI830) || IS_I965G(pI830)) {
+ /* already done */
+ /* dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES; */
+ ;
+ } else
sdvob |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT;
- OUTREG(dpll_reg, dpll | DPLL_DVO_HIGH_SPEED);
+/* OUTREG(dpll_reg, dpll | DPLL_DVO_HIGH_SPEED); */
OUTREG(SDVOB, sdvob);
OUTREG(SDVOC, sdvoc);