[Intel-gfx] [PATCH] SDVO: check EDID info for DVI-I
Zhenyu Wang
zhenyu.z.wang at intel.com
Thu Feb 5 03:17:42 CET 2009
For SDVO DVI-I, check EDID info for digital output,
otherwise mark it to be disconnected as analog output
is driven by VGA then.
---
src/i830_sdvo.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 0546ab5..6f073d3 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1459,7 +1459,10 @@ i830_sdvo_dump(ScrnInfoPtr pScrn)
static xf86OutputStatus
i830_sdvo_detect(xf86OutputPtr output)
{
- uint8_t response[2];
+ I830OutputPrivatePtr intel_output = output->driver_private;
+ struct i830_sdvo_priv *dev_priv = intel_output->dev_priv;
+ xf86MonPtr edid_mon;
+ uint16_t response;
uint8_t status;
i830_sdvo_write_cmd(output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0);
@@ -1468,10 +1471,21 @@ i830_sdvo_detect(xf86OutputPtr output)
if (status != SDVO_CMD_STATUS_SUCCESS)
return XF86OutputStatusUnknown;
- if (response[0] != 0 || response[1] != 0)
- return XF86OutputStatusConnected;
- else
+ if (response == 0)
return XF86OutputStatusDisconnected;
+
+ if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
+ {
+ /* Check EDID in DVI-I case */
+ i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus);
+ edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
+ if (!edid_mon || !DIGITAL(edid_mon->features.input_type)) {
+ xfree(edid_mon);
+ return XF86OutputStatusDisconnected;
+ }
+ xfree(edid_mon);
+ }
+ return XF86OutputStatusConnected;
}
static DisplayModePtr
--
1.5.6.5
More information about the Intel-gfx
mailing list