summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/i830.h9
-rw-r--r--src/i830_crt.c51
-rw-r--r--src/i830_cursor.c8
-rw-r--r--src/i830_display.c187
-rw-r--r--src/i830_display.h6
-rw-r--r--src/i830_dri.c2
-rw-r--r--src/i830_driver.c35
-rw-r--r--src/i830_randr.c8
-rw-r--r--src/i830_xf86Modes.c2
9 files changed, 216 insertions, 92 deletions
diff --git a/src/i830.h b/src/i830.h
index 333b595d..ef46979f 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -184,7 +184,12 @@ enum detect_status {
struct _I830OutputRec {
int type;
int pipe;
- Bool disabled;
+ Bool enabled;
+ /**
+ * Marks that the output and associated pipe is temporarily enabled for
+ * load detection.
+ */
+ Bool load_detect_temp;
/**
* Turns the output on/off, or sets intermediate power levels if available.
@@ -268,12 +273,12 @@ struct _I830OutputRec {
};
typedef struct _I830PipeRec {
+ Bool enabled;
Bool gammaEnabled;
int x;
int y;
Bool cursorInRange;
Bool cursorShown;
- Bool planeEnabled;
DisplayModeRec curMode;
} I830PipeRec, *I830PipePtr;
diff --git a/src/i830_crt.c b/src/i830_crt.c
index a7b04937..46eb788f 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -32,6 +32,7 @@
#include "xf86.h"
#include "i830.h"
#include "i830_xf86Modes.h"
+#include "i830_display.h"
static void
i830_crt_dpms(ScrnInfoPtr pScrn, I830OutputPtr output, int mode)
@@ -172,22 +173,15 @@ i830_crt_detect_hotplug(ScrnInfoPtr pScrn)
* \return FALSE if CRT is disconnected.
*/
static Bool
-i830_crt_detect_load(ScrnInfoPtr pScrn)
+i830_crt_detect_load(ScrnInfoPtr pScrn, I830OutputPtr output)
{
I830Ptr pI830 = I830PTR(pScrn);
- CARD32 adpa, pipeconf, bclrpat;
+ CARD32 save_adpa, adpa, pipeconf, bclrpat;
CARD8 st00;
int pipeconf_reg, bclrpat_reg, dpll_reg;
int pipe;
- for (pipe = 0; pipe < pI830->num_pipes; pipe++)
- if (!pI830->pipes[pipe].planeEnabled)
- break;
-
- /* No available pipes for load detection */
- if (pipe == pI830->num_pipes)
- return FALSE;
-
+ pipe = output->pipe;
if (pipe == 0) {
bclrpat_reg = BCLRPAT_A;
pipeconf_reg = PIPEACONF;
@@ -198,17 +192,17 @@ i830_crt_detect_load(ScrnInfoPtr pScrn)
dpll_reg = DPLL_B;
}
- /* Don't try this if the DPLL isn't running. */
- if (!(INREG(dpll_reg) & DPLL_VCO_ENABLE))
- return FALSE;
-
adpa = INREG(ADPA);
+ save_adpa = adpa;
- /* Enable CRT output if disabled. */
- if (!(adpa & ADPA_DAC_ENABLE)) {
- OUTREG(ADPA, adpa | ADPA_DAC_ENABLE |
- ((pipe == 1) ? ADPA_PIPE_B_SELECT : 0));
- }
+ /* Enable CRT output. */
+ adpa |= ADPA_DAC_ENABLE;
+ if (pipe == 1)
+ adpa |= ADPA_PIPE_B_SELECT;
+ else
+ adpa &= ~ADPA_PIPE_B_SELECT;
+ adpa |= ADPA_VSYNC_CNTL_ENABLE | ADPA_HSYNC_CNTL_ENABLE;
+ OUTREG(ADPA, adpa);
/* Set the border color to purple. Maybe we should save/restore this
* reg.
@@ -216,6 +210,8 @@ i830_crt_detect_load(ScrnInfoPtr pScrn)
bclrpat = INREG(bclrpat_reg);
OUTREG(bclrpat_reg, 0x00500050);
+ i830WaitForVblank(pScrn);
+
/* Force the border color through the active region */
pipeconf = INREG(pipeconf_reg);
OUTREG(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER);
@@ -226,7 +222,7 @@ i830_crt_detect_load(ScrnInfoPtr pScrn)
/* Restore previous settings */
OUTREG(bclrpat_reg, bclrpat);
OUTREG(pipeconf_reg, pipeconf);
- OUTREG(ADPA, adpa);
+ OUTREG(ADPA, save_adpa);
if (st00 & (1 << 4))
return TRUE;
@@ -278,15 +274,12 @@ i830_crt_detect(ScrnInfoPtr pScrn, I830OutputPtr output)
if (i830_crt_detect_ddc(pScrn))
return OUTPUT_STATUS_CONNECTED;
- /* Use the load-detect method if we're not currently outputting to the CRT,
- * or we don't care.
- *
- * Actually, the method is unreliable currently. We need to not share a
- * pipe, as it seems having other outputs on that pipe will result in a
- * false positive.
- */
- if (0) {
- if (i830_crt_detect_load(pScrn))
+ /* Use the load-detect method if we have no other way of telling. */
+ if (i830GetLoadDetectPipe(pScrn, output) != -1) {
+ Bool connected = i830_crt_detect_load(pScrn, output);
+
+ i830ReleaseLoadDetectPipe(pScrn, output);
+ if (connected)
return OUTPUT_STATUS_CONNECTED;
else
return OUTPUT_STATUS_DISCONNECTED;
diff --git a/src/i830_cursor.c b/src/i830_cursor.c
index 05e93faf..517bd3e0 100644
--- a/src/i830_cursor.c
+++ b/src/i830_cursor.c
@@ -109,7 +109,7 @@ I830SetPipeCursor (ScrnInfoPtr pScrn, int pipe, Bool force)
CARD32 temp;
Bool show;
- if (!pI830Pipe->planeEnabled)
+ if (!pI830Pipe->enabled)
return;
show = pI830->cursorOn && pI830Pipe->cursorInRange;
@@ -491,7 +491,7 @@ I830SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
int thisx = x - pI830Pipe->x;
int thisy = y - pI830Pipe->y;
- if (!pI830Pipe->planeEnabled)
+ if (!pI830Pipe->enabled)
continue;
/*
@@ -580,14 +580,14 @@ I830SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
DPRINTF(PFX, "I830SetCursorColors\n");
- if (pI830->pipes[0].planeEnabled)
+ if (pI830->pipes[0].enabled)
{
OUTREG(CURSOR_A_PALETTE0, bg & 0x00ffffff);
OUTREG(CURSOR_A_PALETTE1, fg & 0x00ffffff);
OUTREG(CURSOR_A_PALETTE2, fg & 0x00ffffff);
OUTREG(CURSOR_A_PALETTE3, bg & 0x00ffffff);
}
- if (pI830->pipes[1].planeEnabled)
+ if (pI830->pipes[1].enabled)
{
OUTREG(CURSOR_B_PALETTE0, bg & 0x00ffffff);
OUTREG(CURSOR_B_PALETTE1, fg & 0x00ffffff);
diff --git a/src/i830_display.c b/src/i830_display.c
index 6804a4d8..36036603 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -70,7 +70,7 @@ i830PipeHasType (ScrnInfoPtr pScrn, int pipe, int type)
int i;
for (i = 0; i < pI830->num_outputs; i++)
- if (!pI830->output[i].disabled && pI830->output[i].pipe == pipe)
+ if (pI830->output[i].enabled && pI830->output[i].pipe == pipe)
{
if (pI830->output[i].type == type)
return TRUE;
@@ -297,7 +297,7 @@ i830PipeFindClosestMode(ScrnInfoPtr pScrn, int pipe, DisplayModePtr pMode)
/* Assume that there's only one output connected to the given CRTC. */
for (i = 0; i < pI830->num_outputs; i++) {
if (pI830->output[i].pipe == pipe &&
- !pI830->output[i].disabled &&
+ pI830->output[i].enabled &&
pI830->output[i].probed_modes != NULL)
{
pScan = pI830->output[i].probed_modes;
@@ -378,24 +378,29 @@ i830PipeFindClosestMode(ScrnInfoPtr pScrn, int pipe, DisplayModePtr pMode)
* Return whether any outputs are connected to the specified pipe
*/
-static Bool
+Bool
i830PipeInUse (ScrnInfoPtr pScrn, int pipe)
{
I830Ptr pI830 = I830PTR(pScrn);
int i;
for (i = 0; i < pI830->num_outputs; i++)
- if (!pI830->output[i].disabled && pI830->output[i].pipe == pipe)
+ if (pI830->output[i].enabled && pI830->output[i].pipe == pipe)
return TRUE;
return FALSE;
}
/**
- * Sets the given video mode on the given pipe. Assumes that plane A feeds
- * pipe A, and plane B feeds pipe B. Should not affect the other planes/pipes.
+ * Sets the given video mode on the given pipe.
+ *
+ * Plane A is always output to pipe A, and plane B to pipe B. The plane
+ * will not be enabled if plane_enable is FALSE, which is used for
+ * load detection, when something else will be output to the pipe other than
+ * display data.
*/
Bool
-i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe)
+i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe,
+ Bool plane_enable)
{
I830Ptr pI830 = I830PTR(pScrn);
I830PipePtr pI830Pipe = &pI830->pipes[pipe];
@@ -432,9 +437,9 @@ i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Requested pix clock: %d\n",
pMode->Clock);
- pI830->pipes[pipe].planeEnabled = i830PipeInUse (pScrn, pipe);
+ pI830->pipes[pipe].enabled = i830PipeInUse (pScrn, pipe);
- if (!pI830->pipes[pipe].planeEnabled)
+ if (!pI830->pipes[pipe].enabled)
return TRUE;
#ifdef XF86DRI
@@ -442,7 +447,7 @@ i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe)
#endif
for (i = 0; i < pI830->num_outputs; i++) {
- if (pI830->output[i].pipe != pipe || pI830->output[i].disabled)
+ if (pI830->output[i].pipe != pipe || !pI830->output[i].enabled)
continue;
pI830->output[i].pre_set_mode(pScrn, &pI830->output[i], pMode);
@@ -650,26 +655,20 @@ i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe)
OUTREG(fp_reg, fp);
OUTREG(dpll_reg, dpll);
+ /*
+ * If the panel fitter is stuck on our pipe, turn it off.
+ * The LVDS output will set it as necessary in post_set_mode.
+ */
+ if (!IS_I830(pI830)) {
+ if (((INREG(PFIT_CONTROL) >> 29) & 0x3) == pipe)
+ OUTREG(PFIT_CONTROL, 0);
+ }
+
for (i = 0; i < pI830->num_outputs; i++) {
if (pI830->output[i].pipe == pipe)
pI830->output[i].post_set_mode(pScrn, &pI830->output[i], pMode);
}
- /*
- * If the panel fitter is stuck on our pipe, turn it off
- * the LVDS output will whack it correctly if it needs it
- */
- if (((INREG(PFIT_CONTROL) >> 29) & 0x3) == pipe)
- OUTREG(PFIT_CONTROL, 0);
-
- /*
- * Docs say to not mess with this register. I think we will
- * need to eventually though
- */
-#if 0
- OUTREG(DSPARB, (47 << 0) | (95 << 7));
-#endif
-
OUTREG(htot_reg, htot);
OUTREG(hblank_reg, hblank);
OUTREG(hsync_reg, hsync);
@@ -686,8 +685,10 @@ i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe)
temp = INREG(pipeconf_reg);
OUTREG(pipeconf_reg, temp | PIPEACONF_ENABLE);
- /* And then turn the plane on */
- OUTREG(dspcntr_reg, dspcntr);
+ if (plane_enable) {
+ /* And then turn the plane on */
+ OUTREG(dspcntr_reg, dspcntr);
+ }
pI830Pipe->curMode = *pMode;
@@ -704,28 +705,28 @@ void
i830DisableUnusedFunctions(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- int i;
+ int output, pipe;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling unused functions\n");
- for (i = 0; i < pI830->num_outputs; i++) {
- if (pI830->output[i].disabled)
- pI830->output[i].dpms(pScrn, &pI830->output[i], DPMSModeOff);
+ for (output = 0; output < pI830->num_outputs; output++) {
+ if (!pI830->output[output].enabled)
+ pI830->output[output].dpms(pScrn, &pI830->output[output], DPMSModeOff);
}
/* Now, any unused plane, pipe, and DPLL (FIXME: except for DVO, i915
* internal TV) should have no outputs trying to pull data out of it, so
* we're ready to turn those off.
*/
- for (i = 0; i < pI830->num_pipes; i++) {
- I830PipePtr pI830Pipe = &pI830->pipes[i];
+ for (pipe = 0; pipe < pI830->num_pipes; pipe++) {
+ I830PipePtr pI830Pipe = &pI830->pipes[pipe];
int dspcntr_reg = pipe == 0 ? DSPACNTR : DSPBCNTR;
int pipeconf_reg = pipe == 0 ? PIPEACONF : PIPEBCONF;
int dpll_reg = pipe == 0 ? DPLL_A : DPLL_B;
CARD32 dspcntr, pipeconf, dpll;
char *pipe_name = pipe == 0 ? "A" : "B";
- if (pI830Pipe->planeEnabled)
+ if (pI830Pipe->enabled)
continue;
dspcntr = INREG(dspcntr_reg);
@@ -772,7 +773,9 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
for (i = 0; i < pI830->num_pipes; i++)
{
- ok = i830PipeSetMode(pScrn, i830PipeFindClosestMode(pScrn, i, pMode), i);
+ ok = i830PipeSetMode(pScrn,
+ i830PipeFindClosestMode(pScrn, i, pMode),
+ i, TRUE);
if (!ok)
goto done;
}
@@ -792,7 +795,7 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
/* If we might have enabled/disabled some pipes, we need to reset
* cloning mode support.
*/
- if (pI830->pipes[0].planeEnabled && pI830->pipes[1].planeEnabled)
+ if (pI830->pipes[0].enabled && pI830->pipes[1].enabled)
pI830->Clone = TRUE;
else
pI830->Clone = FALSE;
@@ -825,12 +828,32 @@ i830DescribeOutputConfiguration(ScrnInfoPtr pScrn)
for (i = 0; i < pI830->num_pipes; i++) {
CARD32 dspcntr = INREG(DSPACNTR + (DSPBCNTR - DSPACNTR) * i);
+ CARD32 pipeconf = INREG(PIPEACONF + (PIPEBCONF - PIPEACONF) * i);
+ Bool hw_plane_enable = (dspcntr & DISPLAY_PLANE_ENABLE) != 0;
+ Bool hw_pipe_enable = (pipeconf & PIPEACONF_ENABLE) != 0;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ " Pipe %c is %s\n",
+ 'A' + i, pI830->pipes[i].enabled ? "on" : "off");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" Display plane %c is now %s and connected to pipe %c.\n",
'A' + i,
- pI830->pipes[i].planeEnabled ? "enabled" : "disabled",
+ pI830->pipes[i].enabled ? "enabled" : "disabled",
dspcntr & DISPPLANE_SEL_PIPE_MASK ? 'B' : 'A');
+ if (hw_pipe_enable != pI830->pipes[i].enabled) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ " Hardware claims pipe %c is %s while software "
+ "believes it is %s\n",
+ 'A' + i, hw_pipe_enable ? "on" : "off",
+ pI830->pipes[i].enabled ? "on" : "off");
+ }
+ if (hw_plane_enable != pI830->pipes[i].enabled) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ " Hardware claims plane %c is %s while software "
+ "believes it is %s\n",
+ 'A' + i, hw_plane_enable ? "on" : "off",
+ pI830->pipes[i].enabled ? "on" : "off");
+ }
}
for (i = 0; i < pI830->num_outputs; i++) {
@@ -856,7 +879,95 @@ i830DescribeOutputConfiguration(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" Output %s is %sabled and connected to pipe %c\n",
- name, pI830->output[i].disabled ? "dis" : "en",
+ name, pI830->output[i].enabled ? "en" : "dis",
pI830->output[i].pipe == 0 ? 'A' : 'B');
}
}
+
+/**
+ * Get a pipe with a simple mode set on it for doing load-based monitor
+ * detection.
+ *
+ * It will be up to the load-detect code to adjust the pipe as appropriate for
+ * its requirements. The pipe will be connected to no other outputs.
+ *
+ * Currently this code will only succeed if there is a pipe with no outputs
+ * configured for it. In the future, it could choose to temporarily disable
+ * some outputs to free up a pipe for its use.
+ *
+ * \return monitor number, or -1 if no pipes are available.
+ */
+int
+i830GetLoadDetectPipe(ScrnInfoPtr pScrn, I830OutputPtr output)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+ Bool pipe_available[MAX_DISPLAY_PIPES];
+ int i;
+ /* VESA 640x480x72Hz mode to set on the pipe */
+ DisplayModeRec mode = {
+ NULL, NULL, "640x480", MODE_OK, M_T_DEFAULT,
+ 31500,
+ 640, 664, 704, 832, 0,
+ 480, 489, 491, 520, 0,
+ V_NHSYNC | V_NVSYNC,
+ 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ FALSE, FALSE, 0, NULL, 0, 0.0, 0.0
+ };
+
+ /* If the output is not marked disabled, check if it's already assigned
+ * to an active pipe, and is alone on that pipe. If so, we're done.
+ */
+ if (output->enabled) {
+ int pipeconf_reg = (output->pipe == 0) ? PIPEACONF : PIPEBCONF;
+
+ if (INREG(pipeconf_reg) & PIPEACONF_ENABLE) {
+ /* Actually, maybe we don't need to be all alone on the pipe.
+ * The worst that should happen is false positives. Need to test,
+ * but actually fixing this during server startup is messy.
+ */
+#if 0
+ for (i = 0; i < pI830->num_outputs; i++) {
+ if (&pI830->output[i] != output &&
+ pI830->output[i].pipe == output->pipe)
+ {
+ return -1;
+ }
+ }
+#endif
+ return output->pipe;
+ }
+ }
+
+ for (i = 0; i < pI830->num_pipes; i++)
+ pipe_available[i] = i830PipeInUse(pScrn, i);
+
+ for (i = 0; i < pI830->num_pipes; i++) {
+ if (pipe_available[i])
+ break;
+ }
+
+ if (i == pI830->num_pipes) {
+ return -1;
+ }
+ output->load_detect_temp = TRUE;
+ output->pipe = i;
+ output->enabled = TRUE;
+
+ I830xf86SetModeCrtc(&mode, INTERLACE_HALVE_V);
+
+ i830PipeSetMode(pScrn, &mode, i, FALSE);
+
+ return i;
+}
+
+void
+i830ReleaseLoadDetectPipe(ScrnInfoPtr pScrn, I830OutputPtr output)
+{
+ if (output->load_detect_temp) {
+ output->enabled = FALSE;
+ i830DisableUnusedFunctions(pScrn);
+ output->load_detect_temp = FALSE;
+ }
+}
diff --git a/src/i830_display.h b/src/i830_display.h
index 8a6e9e90..67f3c7b8 100644
--- a/src/i830_display.h
+++ b/src/i830_display.h
@@ -26,9 +26,13 @@
*/
/* i830_display.c */
-Bool i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe);
+Bool i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe,
+ Bool plane_enable);
void i830DisableUnusedFunctions(ScrnInfoPtr pScrn);
Bool i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode);
void i830PipeSetBase(ScrnInfoPtr pScrn, int pipe, int x, int y);
void i830WaitForVblank(ScrnInfoPtr pScrn);
void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn);
+int i830GetLoadDetectPipe(ScrnInfoPtr pScrn, I830OutputPtr output);
+void i830ReleaseLoadDetectPipe(ScrnInfoPtr pScrn, I830OutputPtr output);
+Bool i830PipeInUse(ScrnInfoPtr pScrn, int pipe);
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 41ea21ca..9e4ead0b 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1485,7 +1485,7 @@ I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on)
if (pI830->directRenderingEnabled && pI830->drmMinor >= 5) {
if (on) {
- if (pI830->pipes[1].planeEnabled)
+ if (pI830->pipes[1].enabled)
pipe.pipe = DRM_I830_VBLANK_PIPE_B;
else
pipe.pipe = DRM_I830_VBLANK_PIPE_A;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b6320730..63c1fd2e 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -557,7 +557,7 @@ I830LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
dspsurf = DSPBSURF;
}
- if (pI830Pipe->planeEnabled == 0)
+ if (pI830Pipe->enabled == 0)
continue;
pI830Pipe->gammaEnabled = 1;
@@ -1337,7 +1337,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
* we have better configuration support in the generic RandR code
*/
for (i = 0; i < pI830->num_outputs; i++) {
- pI830->output[i].disabled = FALSE;
+ pI830->output[i].enabled = FALSE;
switch (pI830->output[i].type) {
case I830_OUTPUT_LVDS:
@@ -1345,11 +1345,18 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
pI830->output[i].pipe = pI830->num_pipes - 1;
break;
case I830_OUTPUT_ANALOG:
- pI830->output[i].pipe = 0;
- break;
case I830_OUTPUT_DVO:
case I830_OUTPUT_SDVO:
- pI830->output[i].pipe = 1;
+ if (pI830->output[i].detect(pScrn, &pI830->output[i]) !=
+ OUTPUT_STATUS_DISCONNECTED) {
+ if (!i830PipeInUse(pScrn, 0)) {
+ pI830->output[i].pipe = 0;
+ pI830->output[i].enabled = TRUE;
+ } else if (!i830PipeInUse(pScrn, 1)) {
+ pI830->output[i].pipe = 1;
+ pI830->output[i].enabled = TRUE;
+ }
+ }
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unhandled output type\n");
@@ -1357,6 +1364,10 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
}
}
+ for (i = 0; i < pI830->num_pipes; i++) {
+ pI830->pipes[i].enabled = i830PipeInUse(pScrn, i);
+ }
+
#if 0
pI830->CloneRefresh = 60; /* default to 60Hz */
if (xf86GetOptValInteger(pI830->Options, OPTION_CLONE_REFRESH,
@@ -2264,13 +2275,15 @@ RestoreHWState(ScrnInfoPtr pScrn)
}
}
+ OUTREG(PFIT_CONTROL, pI830->savePFIT_CONTROL);
+
for (i = 0; i < pI830->num_outputs; i++) {
pI830->output[i].restore(pScrn, &pI830->output[i]);
}
if (IS_I965G(pI830)) {
- OUTREG(DSPASURF, pI830->saveDSPABASE);
- OUTREG(DSPBSURF, pI830->saveDSPBBASE);
+ OUTREG(DSPASURF, pI830->saveDSPASURF);
+ OUTREG(DSPBSURF, pI830->saveDSPBSURF);
}
OUTREG(VCLK_DIVISOR_VGA0, pI830->saveVCLK_DIVISOR_VGA0);
@@ -2293,8 +2306,6 @@ RestoreHWState(ScrnInfoPtr pScrn)
OUTREG(SWF31, pI830->saveSWF[15]);
OUTREG(SWF32, pI830->saveSWF[16]);
- OUTREG(PFIT_CONTROL, pI830->savePFIT_CONTROL);
-
i830CompareRegsToSnapshot(pScrn);
return TRUE;
@@ -3180,7 +3191,7 @@ i830AdjustFrame(int scrnIndex, int x, int y, int flags)
}
for (i = 0; i < pI830->num_pipes; i++)
- if (pI830->pipes[i].planeEnabled)
+ if (pI830->pipes[i].enabled)
i830PipeSetBase(pScrn, i, x, y);
}
@@ -3441,7 +3452,7 @@ I830SaveScreen(ScreenPtr pScreen, int mode)
base = DSPBADDR;
surf = DSPBSURF;
}
- if (pI830->pipes[i].planeEnabled) {
+ if (pI830->pipes[i].enabled) {
temp = INREG(ctrl);
if (on)
temp |= DISPLAY_PLANE_ENABLE;
@@ -3490,7 +3501,7 @@ I830DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
ctrl = DSPBCNTR;
base = DSPBADDR;
}
- if (pI830->pipes[i].planeEnabled) {
+ if (pI830->pipes[i].enabled) {
temp = INREG(ctrl);
if (PowerManagementMode == DPMSModeOn)
temp |= DISPLAY_PLANE_ENABLE;
diff --git a/src/i830_randr.c b/src/i830_randr.c
index 84727a61..32cc8773 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -501,7 +501,7 @@ I830RandRCrtcNotify (RRCrtcPtr crtc)
for (i = 0; i < pI830->num_outputs; i++)
{
output = &pI830->output[i];
- if (!output->disabled && output->pipe == pipe)
+ if (output->enabled && output->pipe == pipe)
{
rrout = randrp->outputs[i];
outputs[numOutputs++] = rrout;
@@ -548,10 +548,10 @@ I830RandRCrtcSet (ScreenPtr pScreen,
if (display_mode != randrp->modes[pipe])
{
- pI830Pipe->planeEnabled = mode != NULL;
+ pI830Pipe->enabled = mode != NULL;
if (display_mode)
{
- if (!i830PipeSetMode (pScrn, display_mode, pipe))
+ if (!i830PipeSetMode (pScrn, display_mode, pipe, TRUE))
return FALSE;
/* XXX need I830SDVOPostSetMode here */
}
@@ -652,7 +652,7 @@ I830RandRSetInfo12 (ScreenPtr pScreen)
subpixel = SubPixelUnknown;
break;
}
- if (!output->disabled)
+ if (output->enabled)
{
/* Can't flip outputs among crtcs yet */
ncrtc = 1;
diff --git a/src/i830_xf86Modes.c b/src/i830_xf86Modes.c
index 166f41af..ca92e4d0 100644
--- a/src/i830_xf86Modes.c
+++ b/src/i830_xf86Modes.c
@@ -317,7 +317,7 @@ PrintModeline(int scrnIndex,DisplayModePtr mode)
#if 0
if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2");
#endif
- xf86DrvMsg(scrnIndex, X_ERROR,
+ xf86DrvMsg(scrnIndex, X_INFO,
"Modeline \"%s\"x%.01f %6.2f %i %i %i %i %i %i %i %i%s "
"(%.01f kHz)\n",
mode->name, mode->VRefresh, mode->Clock/1000., mode->HDisplay,