From 3ab7f9693217d8fe993bdc94c376b219b0082961 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 4 Nov 2006 00:46:18 -0800 Subject: 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. --- src/i830_crt.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/i830_crt.c') 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); -- cgit v1.2.3