From 5dff1a1e20e1d428a48cec03e872df2b1b4ea530 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 5 Jul 2006 16:26:44 +1000 Subject: raw modesetting callouts for i2c Add callouts for DVO code for raw modesetting --- src/i830_raw.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/i830_raw.c b/src/i830_raw.c index bd88004d..f4af7f6a 100644 --- a/src/i830_raw.c +++ b/src/i830_raw.c @@ -423,16 +423,18 @@ I830RawSetHw(ScrnInfoPtr pScrn, DisplayModePtr pMode) *dpll &= ~DPLL_2X_CLOCK_ENABLE; for (i=0; inum_outputs; i++) { - if (pI830->output[i].sdvo_drv) + if (pI830->output[i].sdvo_drv || pI830->output[i].i2c_drv) *dpll |= DPLL_2X_CLOCK_ENABLE; } - /* leave these alone for now */ - if (pMode->PrivFlags & I830_MFLAG_DOUBLE) - new_dvo = 0x81c80080; - else - new_dvo = 0x80480080; if (IS_I9XX(pI830)) { + /* leave these alone for now */ + if (pMode->PrivFlags & I830_MFLAG_DOUBLE) + new_dvo = 0x81c80080; + else + new_dvo = 0x80480080; + + for (i = 0; i < pI830->num_outputs; i++) { if (pI830->output[i].sdvo_drv) @@ -448,8 +450,10 @@ I830RawSetHw(ScrnInfoPtr pScrn, DisplayModePtr pMode) } } } - else + else { + new_dvo = 0x8000408c; hw->dvoc = new_dvo; + } // hw->dvob &= ~DVO_ENABLE; //hw->dvoc &= ~DVO_ENABLE; // hw->dvoc |= 0x4084 | DVO_ENABLE; @@ -793,6 +797,12 @@ I830RawSaveState(ScrnInfoPtr pScrn, I830RegPtr hw) hw->swf1x[count++] = INREG(i); for (i = 0; i < pI830->num_outputs; i++) { + if (pI830->output[i].type == I830_OUTPUT_DVO && + pI830->output[i].i2c_drv != NULL) + { + pI830->output[i].i2c_drv->vid_rec->SaveRegs(pI830->output[i].i2c_drv->devpriv); + } + if (pI830->output[i].type == I830_OUTPUT_SDVO && pI830->output[i].sdvo_drv != NULL) { @@ -821,6 +831,12 @@ I830RawRestoreState(ScrnInfoPtr pScrn, I830RegPtr hw) vgaHWLock(hwp); for (i = 0; i < pI830->num_outputs; i++) { + if (pI830->output[i].type == I830_OUTPUT_DVO && + pI830->output[i].i2c_drv != NULL) + { + pI830->output[i].i2c_drv->vid_rec->RestoreRegs(pI830->output[i].i2c_drv->devpriv); + } + if (pI830->output[i].type == I830_OUTPUT_SDVO && pI830->output[i].sdvo_drv != NULL) { @@ -988,6 +1004,11 @@ I830RawSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) else ret = TRUE; } + + if (pI830->output[i].i2c_drv) + { + pI830->output[i].i2c_drv->vid_rec->Mode(pI830->output[i].i2c_drv->devpriv, mode); + } } if (didLock) I830DRIUnlock(pScrn); -- cgit v1.2.3