summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-11-03 23:29:12 -0800
committerEric Anholt <eric@anholt.net>2006-11-07 15:13:23 -0800
commit0b2d36d4f038c4e8fa08632b6f1368627f010392 (patch)
tree90dcdd1a330d674d90132e19cd3557db3792a0d7
parentd0ef9e99acb9e999e1b6d3eb76edc6355555043b (diff)
Use pI830->availablePipes instead of MAX_DISPLAY_PIPES everywhere
(cherry picked from e4bcec796e80e9fd66ab0c36394f5946915531f1 commit)
-rw-r--r--src/i830.h5
-rw-r--r--src/i830_cursor.c10
-rw-r--r--src/i830_display.c4
-rw-r--r--src/i830_driver.c2
-rw-r--r--src/i830_randr.c8
5 files changed, 14 insertions, 15 deletions
diff --git a/src/i830.h b/src/i830.h
index b93ab3c9..84c0dbea 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -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;
diff --git a/src/i830_cursor.c b/src/i830_cursor.c
index 0b7e772b..6b0e58c4 100644
--- a/src/i830_cursor.c
+++ b/src/i830_cursor.c
@@ -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);
}
diff --git a/src/i830_display.c b/src/i830_display.c
index 672bc533..2f9b3fd9 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -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,
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 8dcda421..78f83d76 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -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))
diff --git a/src/i830_randr.c b/src/i830_randr.c
index 8b6ad493..4f3cbee4 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -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);