summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:06:25 +1000
committerDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:06:25 +1000
commit3804dc729e58cffa9e40e6a66ea58a1527738821 (patch)
tree7aff42ebf4a5521c31d418a37b0717594cabca93
parent3751c9d1b1c07e504e1f74ecfbaf3dc0ea770b38 (diff)
intel-2.2.1-hdmi-2.patch
-rw-r--r--src/common.h1
-rw-r--r--src/i830_driver.c22
-rw-r--r--src/i830_sdvo.c20
-rw-r--r--src/i830_sdvo.h2
4 files changed, 27 insertions, 18 deletions
diff --git a/src/common.h b/src/common.h
index b0484df0..405349ad 100644
--- a/src/common.h
+++ b/src/common.h
@@ -468,6 +468,7 @@ extern int I810_DEBUG;
#define HWS_NEED_GFX(pI810) (IS_G33CLASS(pI810) || IS_GM45(pI810) || IS_G4X(pI810))
/* chipsets require status page in non stolen memory */
#define HWS_NEED_NONSTOLEN(pI810) (IS_GM45(pI810) || IS_G4X(pI810))
+#define SUPPORTS_INTEGRATED_HDMI(pI810) (IS_GM45(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 3190da90..6b6eafcb 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -916,17 +916,23 @@ 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(SDVOC) & 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);
}
- if (IS_I9XX(pI830) && !IS_I915G(pI830))
+ if (IS_I9XX(pI830) && IS_MOBILE(pI830))
i830_tv_init(pScrn);
for (o = 0; o < config->num_output; o++)
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index b9435df3..6dbf7ea8 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1158,7 +1158,7 @@ static const xf86OutputFuncsRec i830_sdvo_output_funcs = {
.destroy = i830_sdvo_destroy
};
-void
+Bool
i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
{
xf86OutputPtr output;
@@ -1173,13 +1173,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;
@@ -1201,7 +1201,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
if (i2cbus == NULL)
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
if (output_device == SDVOB) {
@@ -1223,7 +1223,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;
@@ -1236,7 +1236,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;
}
}
@@ -1249,7 +1249,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";
@@ -1266,7 +1266,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
if (!xf86I2CBusInit(ddcbus))
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
intel_output->pI2CBus = i2cbus;
@@ -1316,7 +1316,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
if (!xf86OutputRename (output, name))
{
xf86OutputDestroy (output);
- return;
+ return FALSE;
}
@@ -1340,4 +1340,6 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
(dev_priv->caps.sdvo_inputs_mask & 0x2) ? 'Y' : 'N',
dev_priv->caps.output_flags & (SDVO_OUTPUT_RGB0 | SDVO_OUTPUT_TMDS0) ? 'Y' : 'N',
dev_priv->caps.output_flags & (SDVO_OUTPUT_RGB1 | SDVO_OUTPUT_TMDS1) ? 'Y' : 'N');
+
+ 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