[Intel-gfx] [PATCH 2/2] fetch edid for mac mini through CRT DDC

ling.ma at intel.com ling.ma at intel.com
Mon Jun 29 17:30:53 CEST 2009


For Mac mini we will try to fetch EDID through the analog, 
when we can not do through SDVO DDC. In this patch we always
will steal CRT DDC only if it is not effective.

It fixed freedescktop.org bug #22248

Signed-off-by: Ma Ling <ling.ma at intel.com>
---
 src/i830_sdvo.c |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index b09012b..72a4f64 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1778,10 +1778,11 @@ i830_sdvo_get_ddc_modes(xf86OutputPtr output)
     ScrnInfoPtr pScrn = output->scrn;
     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     DisplayModePtr modes = NULL;
-    xf86OutputPtr crt;
     I830OutputPrivatePtr intel_output =output->driver_private;
     xf86MonPtr edid_mon = NULL;
     struct i830_sdvo_priv *dev_priv = intel_output->dev_priv;
+    I2CBusPtr ddcbus = NULL;
+    int i;
 
     if (dev_priv->is_lvds)
         modes = i830_sdvo_lvds_fetch_modes(output);
@@ -1796,14 +1797,24 @@ i830_sdvo_get_ddc_modes(xf86OutputPtr output)
      * but it does load-detect as connected.  So, just steal the DDC bits from
      * analog when we fail at finding it the right way.
      */
-    crt = xf86_config->output[0];
-    intel_output = crt->driver_private;
-    if (intel_output->type == I830_OUTPUT_ANALOG &&
-	crt->funcs->detect(crt) == XF86OutputStatusDisconnected) {
-	I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOA, "CRTDDC_A");
-	edid_mon = xf86OutputGetEDID(crt, intel_output->pDDCBus);
-	xf86DestroyI2CBusRec(intel_output->pDDCBus, TRUE, TRUE);
+    ddcbus = intel_output->pDDCBus;
+    for (i = 0; i < xf86_config->num_output; i++) {
+
+        xf86OutputPtr output_cnfg = xf86_config->output[i];
+        I830OutputPrivatePtr intel_output_cnfg = output_cnfg->driver_private;
+
+        if (intel_output_cnfg->type == I830_OUTPUT_ANALOG) {
+            if (output_cnfg->funcs->detect(output_cnfg) ==
+                XF86OutputStatusConnected)
+                goto check_hdmi;
+            break;
+        }
     }
+    I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOA, "CRTDDC_A");
+    edid_mon = xf86OutputGetEDID(output, intel_output->pDDCBus);
+    xf86DestroyI2CBusRec(intel_output->pDDCBus, TRUE, TRUE);
+    intel_output->pDDCBus = ddcbus;
+
     if (edid_mon) {
 	xf86OutputSetEDID(output, edid_mon);
 	modes = xf86OutputGetEDIDModes(output);
-- 
1.5.4.4




More information about the Intel-gfx mailing list