summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-06-19 14:27:30 -0700
committerEric Anholt <eric@anholt.net>2008-06-19 15:02:06 -0700
commit65ad29d78793c7804f133a58de80ffaa0404ca28 (patch)
tree87fbbb759048fa92a96222304099a32385c3fa20
parentea0d21006ec71bc56acde7291e5f8d28e54b83fe (diff)
Automatically detect the presence of HDMI.
Now, SDVO is only probed if the SDVO detected bit is set. If the SDVO probe fails, but the detect bit is set, assume that it's an HDMI output.
-rw-r--r--src/common.h1
-rw-r--r--src/i830_driver.c20
-rw-r--r--src/i830_sdvo.c19
-rw-r--r--src/i830_sdvo.h2
4 files changed, 25 insertions, 17 deletions
diff --git a/src/common.h b/src/common.h
index 5efdc0c0..1765bb51 100644
--- a/src/common.h
+++ b/src/common.h
@@ -372,6 +372,7 @@ extern int I810_DEBUG;
#define HWS_NEED_GFX(pI810) (IS_G33CLASS(pI810) || IS_IGD_GM(pI810) || IS_G4X(pI810))
/* chipsets require status page in non stolen memory */
#define HWS_NEED_NONSTOLEN(pI810) (IS_IGD_GM(pI810) || IS_G4X(pI810))
+#define SUPPORTS_INTEGRATED_HDMI(pI810) (IS_IGD_GM(pI810) || IS_G4X(pI810))
#define GTT_PAGE_SIZE KB(4)
#define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y))
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5782d487..28505c83 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -924,13 +924,19 @@ I830SetupOutputs(ScrnInfoPtr pScrn)
i830_lvds_init(pScrn);
if (IS_I9XX(pI830)) {
-#if 1
- i830_sdvo_init(pScrn, SDVOB);
- i830_sdvo_init(pScrn, SDVOC);
-#else
- i830_hdmi_init(pScrn, SDVOB);
- i830_hdmi_init(pScrn, SDVOC);
-#endif
+ if (INREG(SDVOB) & SDVO_DETECTED) {
+ Bool found = i830_sdvo_init(pScrn, SDVOB);
+
+ if (!found && SUPPORTS_INTEGRATED_HDMI(pI830))
+ i830_hdmi_init(pScrn, SDVOB);
+ }
+
+ if (INREG(SDVOB) & SDVO_DETECTED) {
+ Bool found = i830_sdvo_init(pScrn, SDVOC);
+
+ if (!found && SUPPORTS_INTEGRATED_HDMI(pI830))
+ i830_hdmi_init(pScrn, SDVOC);
+ }
} else {
i830_dvo_init(pScrn);
}
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 331059bf..8914e1b0 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1503,7 +1503,7 @@ i830_sdvo_select_ddc_bus(struct i830_sdvo_priv *dev_priv)
dev_priv->ddc_bus = 1 << num_bits;
}
-void
+Bool
i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
{
xf86OutputPtr output;
@@ -1518,13 +1518,13 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
output = xf86OutputCreate (pScrn, &i830_sdvo_output_funcs,NULL);
if (!output)
- return;
+ return FALSE;
intel_output = xnfcalloc (sizeof (I830OutputPrivateRec) +
sizeof (struct i830_sdvo_priv), 1);
if (!intel_output)
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
output->driver_private = intel_output;
output->interlaceAllowed = FALSE;
@@ -1546,7 +1546,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
if (i2cbus == NULL)
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
if (output_device == SDVOB) {
@@ -1568,7 +1568,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
"Failed to initialize %s I2C device\n",
SDVO_NAME(dev_priv));
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
intel_output->pI2CBus = i2cbus;
@@ -1581,7 +1581,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
"No SDVO device found on SDVO%c\n",
output_device == SDVOB ? 'B' : 'C');
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
}
@@ -1594,7 +1594,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
if (ddcbus == NULL)
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
if (output_device == SDVOB)
ddcbus->BusName = "SDVOB DDC Bus";
@@ -1611,7 +1611,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
if (!xf86I2CBusInit(ddcbus))
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
intel_output->pI2CBus = i2cbus;
@@ -1670,7 +1670,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
if (!xf86OutputRename (output, name))
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
i830_sdvo_select_ddc_bus(dev_priv);
@@ -1718,4 +1718,5 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
REPORT_OUTPUT_FLAG(SDVO_OUTPUT_SCART1, "SCART1");
REPORT_OUTPUT_FLAG(SDVO_OUTPUT_LVDS1, "LVDS1");
+ return TRUE;
}
diff --git a/src/i830_sdvo.h b/src/i830_sdvo.h
index 1368e43b..798a88df 100644
--- a/src/i830_sdvo.h
+++ b/src/i830_sdvo.h
@@ -25,7 +25,7 @@
*
*/
-void
+Bool
i830_sdvo_init(ScrnInfoPtr pScrn, int output_device);
int