From 76bd085d52517fdd24139acd17c0b3fff497a829 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Wed, 26 Nov 2008 11:33:56 +0800 Subject: [PATCH] SDVO: use EDID digital info for detect in TMDS output This trys to take the detect change for DVI-I from i830_hdmi.c. So if output has digital type, we use EDID's digital type to check for current link type. --- src/i830_sdvo.c | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c index 256d16d..65321f3 100644 --- a/src/i830_sdvo.c +++ b/src/i830_sdvo.c @@ -1450,6 +1450,18 @@ i830_sdvo_dump(ScrnInfoPtr pScrn) } } +static Bool +i830_sdvo_digital_output(xf86OutputPtr output) +{ + I830OutputPrivatePtr intel_output = output->driver_private; + struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; + + if (dev_priv->caps.output_flags & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) + return TRUE; + else + return FALSE; +} + /** * Asks the SDVO device if any displays are currently connected. * @@ -1462,6 +1474,8 @@ i830_sdvo_dump(ScrnInfoPtr pScrn) static xf86OutputStatus i830_sdvo_detect(xf86OutputPtr output) { + I830OutputPrivatePtr intel_output = output->driver_private; + xf86MonPtr edid_mon; uint8_t response[2]; uint8_t status; @@ -1471,10 +1485,16 @@ 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] == 0 && response[1] == 0) return XF86OutputStatusDisconnected; + + if (i830_sdvo_digital_output(output)) { + edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus); + if (!edid_mon || !DIGITAL(edid_mon->features.input_type)) + return XF86OutputStatusDisconnected; + xfree(edid_mon); + } + return XF86OutputStatusConnected; } static DisplayModePtr -- 1.5.6.5