xf86-video-intel: Branch 'display-port' - src/i830_dp.c src/i830_driver.c

Keith Packard keithp at kemper.freedesktop.org
Fri Mar 20 11:38:11 PDT 2009


 src/i830_dp.c     |   11 ---------
 src/i830_driver.c |   60 ++++++++++++++++++++++++++++++++++--------------------
 2 files changed, 38 insertions(+), 33 deletions(-)

New commits:
commit 859cdab73887050109ddcf3467c6e51712367c3f
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Mar 20 11:34:23 2009 -0700

    Just add all of the GPIO-detected digital outputs
    
    We can't distinguish between HDMI and DP outputs as they
    share the same GPIO pin. The only way to tell is to parse the
    BIOS tables. Instead of doing that, just add all of the outputs and let
    monitor detection sort it out (which is reliable on DP and HDMI).
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_dp.c b/src/i830_dp.c
index b6d8675..302dd9d 100644
--- a/src/i830_dp.c
+++ b/src/i830_dp.c
@@ -1155,17 +1155,6 @@ i830_dp_init(ScrnInfoPtr pScrn, int output_reg)
     if ((dp & DP_DETECTED) == 0)
 	return FALSE;
 
-    /* XXX
-     * This is wrong -- we cannot distinguish between HDMI and DP,
-     * so we assert that we always have DP_C and never HDMI for
-     * testing on machines that have DP connected on channel C
-     *
-     * We need to grub through the BIOS tables to make this work
-     * right
-     */
-    if (output_reg != DP_C)
-	return TRUE;
-
     output = xf86OutputCreate(pScrn, &i830_dp_output_funcs,
 			      (output_reg == DP_B) ? "DP-1" :
 			      (output_reg == DP_C) ? "DP-2" : "DP-3");
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 4ec892c..b78ef87 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -905,31 +905,47 @@ I830SetupOutputs(ScrnInfoPtr pScrn)
       i830_lvds_init(pScrn);
 
    if (IS_I9XX(pI830)) {
-      if (IS_G4X(pI830) && i830_dp_init(pScrn, DP_B))
-	;
-      else {
-	 Bool found = FALSE;
-	 if ((INREG(SDVOB) & SDVO_DETECTED)) {
-	    found = i830_sdvo_init(pScrn, SDVOB);
-
-	    if (!found && SUPPORTS_INTEGRATED_HDMI(pI830))
-	       i830_hdmi_init(pScrn, SDVOB);
-	 }
-      }
+      Bool found;
+
+      /* Check the digital output B
+       *
+       * Note that SDVOB, HDMI_B and DP_B all share
+       * a single GPIO pin. We can detect SDVO by
+       * poking the SDVO chip through I2C, but we
+       * cannot distinguish between HDMI and DP, so
+       * we simply enable both ports.
+       */
+      found = FALSE;
+      if ((INREG(SDVOB) & SDVO_DETECTED))
+	 found = i830_sdvo_init(pScrn, SDVOB);
+
+      if (!found && SUPPORTS_INTEGRATED_HDMI(pI830) &&
+	  (INREG(SDVOB) & SDVO_DETECTED))
+	 i830_hdmi_init(pScrn, SDVOB);
+      if (!found && IS_G4X(pI830) && (INREG(DP_B) & DP_DETECTED))
+	    i830_dp_init(pScrn, DP_B);
+
+      /* Check for digital output C
+       *
+       * SDVOC uses the same GPIO pin as SDVOB, while
+       * HDMI_C and DP_C use a separate pin. So, we
+       * use the SDVOB pin to determine whether to
+       * check for SDVOC, but then if that is present,
+       * we know there cannot be either HDMI_C or DP_C
+       */
+      found = FALSE;
+      if ((INREG(SDVOB) & SDVO_DETECTED))
+	 found = i830_sdvo_init(pScrn, SDVOC);
 
-      if (IS_G4X(pI830) && i830_dp_init(pScrn, DP_C))
-	;
-      else {
-	 Bool found = FALSE;
-	 if ((INREG(SDVOB) & SDVO_DETECTED))
-	    found = i830_sdvo_init(pScrn, SDVOC);
+      if (!found && SUPPORTS_INTEGRATED_HDMI(pI830) &&
+	  (INREG(SDVOC) & SDVO_DETECTED))
+	 i830_hdmi_init(pScrn, SDVOC);
 
-	 if ((INREG(SDVOC) & SDVO_DETECTED) &&
-	     !found && SUPPORTS_INTEGRATED_HDMI(pI830))
-	    i830_hdmi_init(pScrn, SDVOC);
-      }
+      if (!found && IS_G4X(pI830) && (INREG(DP_C) & DP_DETECTED))
+	 i830_dp_init(pScrn, DP_C);
 
-      if (IS_GM45(pI830))
+      /* Check for digital output D */
+      if (IS_G4X(pI830) && (INREG(DP_D) & DP_DETECTED))
 	 i830_dp_init(pScrn, DP_D);
    } else {
       i830_dvo_init(pScrn);


More information about the xorg-commit mailing list