summaryrefslogtreecommitdiff
path: root/src/i830_crt.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-11-04 00:46:18 -0800
committerKeith Packard <keithp@neko.keithp.com>2006-11-04 00:46:18 -0800
commit3ab7f9693217d8fe993bdc94c376b219b0082961 (patch)
tree2a4baa470194aacc276b099642d897fe2c8d15ec /src/i830_crt.c
parente4bcec796e80e9fd66ab0c36394f5946915531f1 (diff)
Eliminate operatingDevices member and PIPE_* values.
operatingDevices and MonType1/MonType2 duplicate information already stored in the device structures. Eliminate them and replace uses with direct references to the appropriate other data.
Diffstat (limited to 'src/i830_crt.c')
-rw-r--r--src/i830_crt.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/i830_crt.c b/src/i830_crt.c
index 0225727b..4c6c3ca5 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -169,12 +169,19 @@ static Bool
i830_crt_detect_load(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- CARD32 adpa, pipeconf;
+ CARD32 adpa, pipeconf, bclrpat;
CARD8 st00;
int pipeconf_reg, bclrpat_reg, dpll_reg;
int pipe;
- pipe = pI830->pipe;
+ for (pipe = 0; pipe < pI830->availablePipes; pipe++)
+ if (!pI830->pipes[pipe].planeEnabled)
+ break;
+
+ /* No available pipes for load detection */
+ if (pipe == pI830->availablePipes)
+ return FALSE;
+
if (pipe == 0) {
bclrpat_reg = BCLRPAT_A;
pipeconf_reg = PIPEACONF;
@@ -197,9 +204,10 @@ i830_crt_detect_load(ScrnInfoPtr pScrn)
((pipe == 1) ? ADPA_PIPE_B_SELECT : 0));
}
- /* Set the border color to red, green. Maybe we should save/restore this
+ /* Set the border color to purple. Maybe we should save/restore this
* reg.
*/
+ bclrpat = INREG(bclrpat_reg);
OUTREG(bclrpat_reg, 0x00500050);
/* Force the border color through the active region */
@@ -210,6 +218,7 @@ i830_crt_detect_load(ScrnInfoPtr pScrn)
st00 = pI830->readStandard(pI830, 0x3c2);
/* Restore previous settings */
+ OUTREG(bclrpat_reg, bclrpat);
OUTREG(pipeconf_reg, pipeconf);
OUTREG(ADPA, adpa);