summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-04-19 10:45:13 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-04-19 10:45:13 -0700
commitd8f7dfac769d7b03f069306b1296bb2e1e08b009 (patch)
tree0098b26126cf7db6d496be44e2c6ae101ddc9096 /src/i830_driver.c
parenta371a04a57620b7128e3c4395bc7c2ac55effe19 (diff)
Start bringing in some SDVO code, mostly from airlied.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c61
1 files changed, 36 insertions, 25 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 8930db06..591605af 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1338,13 +1338,15 @@ static void
I830SetupOutputBusses(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
+ int i = 0;
+ Bool ret;
/* everyone has at least a single analog output */
- pI830->num_outputs = 1;
- pI830->output[0].type = I830_OUTPUT_ANALOG;
+ pI830->output[i].type = I830_OUTPUT_ANALOG;
/* setup the DDC bus for the analog output */
- I830I2CInit(pScrn, &pI830->output[0].pDDCBus, GPIOA, "CRTDDC_A");
+ I830I2CInit(pScrn, &pI830->output[i].pDDCBus, GPIOA, "CRTDDC_A");
+ i++;
/* need to add the output busses for each device
* - this function is very incomplete
@@ -1355,35 +1357,44 @@ I830SetupOutputBusses(ScrnInfoPtr pScrn)
case PCI_CHIP_845_G:
case PCI_CHIP_I855_GM:
case PCI_CHIP_I865_G:
- pI830->num_outputs = 2;
- pI830->output[1].type = I830_OUTPUT_DVO;
- I830I2CInit(pScrn, &pI830->output[1].pDDCBus, GPIOD, "DVODDC_D");
- I830I2CInit(pScrn, &pI830->output[1].pI2CBus, GPIOE, "DVOI2C_E");
+ pI830->output[i].type = I830_OUTPUT_DVO;
+ I830I2CInit(pScrn, &pI830->output[i].pDDCBus, GPIOD, "DVODDC_D");
+ I830I2CInit(pScrn, &pI830->output[i].pI2CBus, GPIOE, "DVOI2C_E");
+ i++;
break;
case PCI_CHIP_E7221_G:
/* ??? */
break;
- case PCI_CHIP_I915_G:
case PCI_CHIP_I915_GM:
- pI830->num_outputs = 2;
- pI830->output[1].type = I830_OUTPUT_LVDS;
- I830I2CInit(pScrn, &pI830->output[1].pDDCBus, GPIOC, "LVDSDDC_C");
+ case PCI_CHIP_I945_GM:
+ pI830->output[i].type = I830_OUTPUT_LVDS;
+ I830I2CInit(pScrn, &pI830->output[i].pDDCBus, GPIOC, "LVDSDDC_C");
+ i++;
break;
-#if 0
+ case PCI_CHIP_I915_G:
case PCI_CHIP_I945_G:
- case PCI_CHIP_I945_GM:
- /* SDVO ports have a single control bus */
- pI830->num_outputs = 2;
- pI830->output[1].type = I830_OUTPUT_SDVO;
- I830I2CInit(pScrn, &pI830->output[1].pI2CBus, GPIOE, "SDVOCTRL_E");
+ /* Set up SDVOB */
+ pI830->output[i].type = I830_OUTPUT_SDVO;
+ I830I2CInit(pScrn, &pI830->output[i].pI2CBus, GPIOE, "SDVOCTRL_E");
+
+ pI830->output[i].sdvo_drv = I830SDVOInit(pI830->output[i].pI2CBus);
+ ret = I830I2CDetectSDVOController(pScrn, i);
+ if (ret == TRUE)
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Found sDVOB\n");
+ i++;
+
+ /* Set up SDVOC */
+ pI830->output[i].type = I830_OUTPUT_SDVO;
+ I830I2CInit(pScrn, &pI830->output[i].pI2CBus, GPIOE, "SDVOCTRL_E");
- pI830->output[1].sdvo_drv = I830SDVOInit(pI830->output[1].pI2CBus);
- ret = I830I2CDetectSDVOController(pScrn, 1);
+ pI830->output[i].sdvo_drv = I830SDVOInit(pI830->output[i].pI2CBus);
+ ret = I830I2CDetectSDVOController(pScrn, i);
if (ret == TRUE)
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Found sDVO\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Found sDVOC\n");
+ i++;
break;
-#endif
}
+ pI830->num_outputs = i;
}
void
@@ -1442,8 +1453,8 @@ void I830DetectMonitors(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DDC DVO %d, %08lX\n", i,
pI830->output[i].pDDCBus->DriverPrivate.uval);
xf86PrintEDID(pI830->output[i].MonInfo);
-
-#if 0
+
+#if 0
/* if we are on an i2C bus > 0 and we see a monitor - try to
* find a controller chip
*/
@@ -1459,9 +1470,9 @@ void I830DetectMonitors(ScrnInfoPtr pScrn)
}
#endif
break;
-#if 0
case I830_OUTPUT_SDVO:
if (pI830->output[i].sdvo_drv->found) {
+#if 0
I830SDVOSetupDDC(pI830->output[i].sdvo_drv);
pI830->output[i].MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex,
@@ -1470,9 +1481,9 @@ void I830DetectMonitors(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DDC SDVO %d, %08X\n", i,
pI830->output[i].pI2CBus->DriverPrivate.uval);
xf86PrintEDID(pI830->output[i].MonInfo);
+#endif
}
break;
-#endif
case I830_OUTPUT_UNUSED:
break;
default: