summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-10-05 16:02:02 -0700
committerEric Anholt <eric@anholt.net>2006-10-05 16:16:45 -0700
commit9bb7736ab36f172db58703c4664bb1b0cd7f80c3 (patch)
treeff913af4d4370a70c45702d1f6e1eb22b9ce6abd /src
parentada8f62da263d1e93e22df4e0b1149bf1dbe24d4 (diff)
Remove checks for output privates in various bits of code.
Now, the output is only set up if it fully initializes, so it will never exist if the private it requires doesn't.
Diffstat (limited to 'src')
-rw-r--r--src/i830_display.c6
-rw-r--r--src/i830_driver.c20
-rw-r--r--src/i830_dvo.c11
-rw-r--r--src/i830_modes.c6
-rw-r--r--src/i830_sdvo.c9
5 files changed, 13 insertions, 39 deletions
diff --git a/src/i830_display.c b/src/i830_display.c
index 5a0fb9d8..e3c3062f 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -866,10 +866,10 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
for (i = 0; i < pI830->num_outputs; i++) {
I830OutputPtr output = &pI830->output[i];
- if (pI830->output[i].sdvo_drv != NULL)
+ if (pI830->output[i].type == I830_OUTPUT_SDVO)
pI830->output[i].dpms(pScrn, &pI830->output[i], DPMSModeOff);
- if (output->i2c_drv != NULL)
+ if (pI830->output[i].type == I830_OUTPUT_DVO)
output->i2c_drv->vid_rec->Mode(output->i2c_drv->dev_priv,
pMode);
}
@@ -885,7 +885,7 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
goto done;
}
for (i = 0; i < pI830->num_outputs; i++) {
- if (pI830->output[i].sdvo_drv)
+ if (pI830->output[i].type == I830_OUTPUT_SDVO)
I830SDVOPostSetMode(pI830->output[i].sdvo_drv, pMode);
}
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5da31a6f..4b558559 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -985,14 +985,12 @@ I830DetectMonitors(ScrnInfoPtr pScrn)
xf86PrintEDID(pI830->output[i].MonInfo);
break;
case I830_OUTPUT_SDVO:
- if (pI830->output[i].sdvo_drv != NULL) {
- pI830->output[i].MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex,
- pI830->output[i].pDDCBus);
+ pI830->output[i].MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex,
+ pI830->output[i].pDDCBus);
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DDC SDVO %d, %08lX\n", i,
- pI830->output[i].pDDCBus->DriverPrivate.uval);
- xf86PrintEDID(pI830->output[i].MonInfo);
- }
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DDC SDVO %d, %08lX\n", i,
+ pI830->output[i].pDDCBus->DriverPrivate.uval);
+ xf86PrintEDID(pI830->output[i].MonInfo);
break;
case I830_OUTPUT_UNUSED:
break;
@@ -1675,8 +1673,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
* treat different SDVO outputs differently.
*/
for (i = 0; i < MAX_OUTPUTS; i++) {
- if (pI830->output[i].type == I830_OUTPUT_SDVO &&
- pI830->output[i].sdvo_drv != NULL) {
+ if (pI830->output[i].type == I830_OUTPUT_SDVO) {
if (!I830DetectSDVODisplays(pScrn, i))
continue;
@@ -4339,11 +4336,8 @@ i830MonitorDetectDebugger(ScrnInfoPtr pScrn)
for (i = 0; i < MAX_OUTPUTS; i++) {
Bool found_sdvo = TRUE;
- if (pI830->output[i].type != I830_OUTPUT_SDVO ||
- pI830->output[i].sdvo_drv == NULL)
- {
+ if (pI830->output[i].type != I830_OUTPUT_SDVO)
continue;
- }
start = GetTimeInMillis();
found_sdvo = I830DetectSDVODisplays(pScrn, i);
finish = GetTimeInMillis();
diff --git a/src/i830_dvo.c b/src/i830_dvo.c
index 86d7d73b..27f1755f 100644
--- a/src/i830_dvo.c
+++ b/src/i830_dvo.c
@@ -57,9 +57,6 @@ struct _I830DVODriver i830_dvo_drivers[] =
static void
i830_dvo_dpms(ScrnInfoPtr pScrn, I830OutputPtr output, int mode)
{
- if (output->i2c_drv == NULL)
- return;
-
if (mode == DPMSModeOn)
output->i2c_drv->vid_rec->Power(output->i2c_drv->dev_priv, TRUE);
else
@@ -71,9 +68,6 @@ i830_dvo_save(ScrnInfoPtr pScrn, I830OutputPtr output)
{
I830Ptr pI830 = I830PTR(pScrn);
- if (output->i2c_drv == NULL)
- return;
-
/* Each output should probably just save the registers it touches, but for
* now, use more overkill.
*/
@@ -89,9 +83,6 @@ i830_dvo_restore(ScrnInfoPtr pScrn, I830OutputPtr output)
{
I830Ptr pI830 = I830PTR(pScrn);
- if (output->i2c_drv == NULL)
- return;
-
OUTREG(DVOA, pI830->saveDVOA);
OUTREG(DVOB, pI830->saveDVOB);
OUTREG(DVOC, pI830->saveDVOC);
@@ -99,7 +90,7 @@ i830_dvo_restore(ScrnInfoPtr pScrn, I830OutputPtr output)
output->i2c_drv->vid_rec->RestoreRegs(output->i2c_drv->dev_priv);
}
-Bool
+static Bool
I830I2CDetectDVOControllers(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus,
struct _I830DVODriver **retdrv)
{
diff --git a/src/i830_modes.c b/src/i830_modes.c
index da1ccde8..f7d46950 100644
--- a/src/i830_modes.c
+++ b/src/i830_modes.c
@@ -763,14 +763,12 @@ I830ReprobePipeModeList(ScrnInfoPtr pScrn, int pipe)
}
break;
case I830_OUTPUT_DVO:
- if (outputs & PIPE_DFP && pI830->output[i].i2c_drv != NULL) {
+ if (outputs & PIPE_DFP) {
output_index = i;
}
break;
case I830_OUTPUT_SDVO:
- if (outputs & PIPE_DFP &&
- pI830->output[i].sdvo_drv != NULL)
- {
+ if (outputs & PIPE_DFP) {
output_index = i;
}
break;
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 9792904d..dc17af0e 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -644,9 +644,6 @@ i830_sdvo_dpms(ScrnInfoPtr pScrn, I830OutputPtr output, int mode)
{
I830SDVOPtr sdvo = output->sdvo_drv;
- if (sdvo == NULL)
- return;
-
if (mode != DPMSModeOn)
I830SDVOSetActiveOutputs(sdvo, FALSE, FALSE);
else
@@ -659,9 +656,6 @@ i830_sdvo_save(ScrnInfoPtr pScrn, I830OutputPtr output)
I830Ptr pI830 = I830PTR(pScrn);
I830SDVOPtr sdvo = output->sdvo_drv;
- if (sdvo == NULL)
- return;
-
sdvo->save_sdvo_mult = I830SDVOGetClockRateMult(sdvo);
I830SDVOGetActiveOutputs(sdvo, &sdvo->save_sdvo_active_1,
&sdvo->save_sdvo_active_2);
@@ -699,9 +693,6 @@ i830_sdvo_restore(ScrnInfoPtr pScrn, I830OutputPtr output)
I830Ptr pI830 = I830PTR(pScrn);
I830SDVOPtr sdvo = output->sdvo_drv;
- if (sdvo == NULL)
- return;
-
if (sdvo->caps.caps & 0x1) {
I830SDVOSetTargetInput(sdvo, FALSE, FALSE);
I830SDVOSetTimings(sdvo, &sdvo->save_input_dtd_1,