Use pI830->availablePipes instead of MAX_DISPLAY_PIPES everywhere

(cherry picked from e4bcec796e commit)
This commit is contained in:
Keith Packard 2006-11-03 23:29:12 -08:00 committed by Eric Anholt
parent d0ef9e99ac
commit 0b2d36d4f0
5 changed files with 14 additions and 15 deletions

View File

@ -313,8 +313,6 @@ typedef struct _I830Rec {
*/
DisplayModePtr savedCurrentMode;
I830PipeRec pipes[MAX_DISPLAY_PIPES];
Bool Clone;
int CloneRefresh;
int CloneHDisplay;
@ -481,7 +479,8 @@ typedef struct _I830Rec {
/* [0] is Pipe A, [1] is Pipe B. */
int availablePipes;
/* [0] is display plane A, [1] is display plane B. */
I830PipeRec pipes[MAX_DISPLAY_PIPES];
/* Driver phase/state information */
Bool preinit;
Bool starting;

View File

@ -180,11 +180,11 @@ I830InitHWCursor(ScrnInfoPtr pScrn)
int i;
DPRINTF(PFX, "I830InitHWCursor\n");
for (i = 0; i < MAX_DISPLAY_PIPES; i++)
for (i = 0; i < pI830->availablePipes; i++)
pI830->pipes[i].cursorShown = FALSE;
/* Initialise the HW cursor registers, leaving the cursor hidden. */
if (IS_MOBILE(pI830) || IS_I9XX(pI830)) {
for (i = 0; i < MAX_DISPLAY_PIPES; i++)
for (i = 0; i < pI830->availablePipes; i++)
{
int cursor_control = i == 0 ? CURSOR_A_CONTROL : CURSOR_B_CONTROL;
temp = INREG(cursor_control);
@ -484,7 +484,7 @@ I830SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
x -= hotspotx;
y -= hotspoty;
for (pipe = 0; pipe < MAX_DISPLAY_PIPES; pipe++)
for (pipe = 0; pipe < pI830->availablePipes; pipe++)
{
I830PipePtr pI830Pipe = &pI830->pipes[pipe];
DisplayModePtr mode = &pI830Pipe->curMode;
@ -550,7 +550,7 @@ I830ShowCursor(ScrnInfoPtr pScrn)
pI830->CursorMemARGB->Physical, pI830->CursorMemARGB->Start);
pI830->cursorOn = TRUE;
for (pipe = 0; pipe < MAX_DISPLAY_PIPES; pipe++)
for (pipe = 0; pipe < pI830->availablePipes; pipe++)
I830SetPipeCursor (pScrn, pipe, TRUE);
}
@ -563,7 +563,7 @@ I830HideCursor(ScrnInfoPtr pScrn)
DPRINTF(PFX, "I830HideCursor\n");
pI830->cursorOn = FALSE;
for (pipe = 0; pipe < MAX_DISPLAY_PIPES; pipe++)
for (pipe = 0; pipe < pI830->availablePipes; pipe++)
I830SetPipeCursor (pScrn, pipe, TRUE);
}

View File

@ -666,7 +666,7 @@ i830DisableUnusedFunctions(ScrnInfoPtr pScrn)
* 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 < MAX_DISPLAY_PIPES; i++) {
for (i = 0; i < pI830->availablePipes; i++) {
I830PipePtr pI830Pipe = &pI830->pipes[i];
int dspcntr_reg = pipe == 0 ? DSPACNTR : DSPBCNTR;
int pipeconf_reg = pipe == 0 ? PIPEACONF : PIPEBCONF;
@ -732,7 +732,7 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
for (i = 0; i < pI830->num_outputs; i++)
pI830->output[i].pre_set_mode(pScrn, &pI830->output[i], pMode);
for (i = 0; i < MAX_DISPLAY_PIPES; i++)
for (i = 0; i < pI830->availablePipes; i++)
{
if (pI830->pipes[i].planeEnabled)
ok = i830PipeSetMode(pScrn, i830PipeFindClosestMode(pScrn, i,

View File

@ -3413,7 +3413,7 @@ I830EnterVT(int scrnIndex, int flags)
SetHWOperatingState(pScrn);
/* Mark that we'll need to re-set the mode for sure */
for (i = 0; i < MAX_DISPLAY_PIPES; i++)
for (i = 0; i < pI830->availablePipes; i++)
memset(&pI830->pipes[i].curMode, 0, sizeof(pI830->pipes[i].curMode));
if (!i830SetMode(pScrn, pScrn->currentMode))

View File

@ -682,7 +682,7 @@ I830RandRSetInfo12 (ScreenPtr pScreen)
ncrtc = 0;
pipe = -1;
crtc = NULL;
for (j = 0; j < MAX_DISPLAY_PIPES; j++)
for (j = 0; j < pI830->availablePipes; j++)
{
#if 0
/* Can't flip outputs among crtcs yet */
@ -782,7 +782,7 @@ I830RandRSetInfo12 (ScreenPtr pScreen)
if (!RROutputSetClones (randrp->outputs[i], clones, nclone))
return FALSE;
}
for (i = 0; i < MAX_DISPLAY_PIPES; i++)
for (i = 0; i < pI830->availablePipes; i++)
I830RandRCrtcNotify (randrp->crtcs[i]);
return TRUE;
}
@ -815,7 +815,7 @@ I830RandRCreateScreenResources12 (ScreenPtr pScreen)
/*
* Create RandR resources, then probe them
*/
for (i = 0; i < MAX_DISPLAY_PIPES; i++)
for (i = 0; i < pI830->availablePipes; i++)
{
randrp->crtcs[i] = RRCrtcCreate (pScreen, (void *) i);
RRCrtcGammaSetSize (randrp->crtcs[i], 256);
@ -851,7 +851,7 @@ I830RandRCreateScreenResources12 (ScreenPtr pScreen)
mmHeight);
}
for (i = 0; i < MAX_DISPLAY_PIPES; i++)
for (i = 0; i < pI830->availablePipes; i++)
i830PipeSetBase(pScrn, i, 0, 0);
return I830RandRSetInfo12 (pScreen);