xf86-video-intel: 3 commits - src/i810_reg.h src/i830_hdmi.c src/i830_sdvo.c

Zhenyu Wang zhen at kemper.freedesktop.org
Wed Nov 12 17:57:50 PST 2008


 src/i810_reg.h  |    1 +
 src/i830_hdmi.c |   20 ++++++++++++++++++++
 src/i830_sdvo.c |   10 ++++++----
 3 files changed, 27 insertions(+), 4 deletions(-)

New commits:
commit 42ec6938bdea3a5b065a4248fdca5f031415191e
Author: Ma Ling <ling.ma at intel.com>
Date:   Fri Nov 7 14:23:41 2008 +0800

    enable Intel G35 SDVO HDMI audio output
    
    Set the SDVO_AUDIO_ENABLE bit to enable SDVO HDMI audio output of the
    Intel G35 chipset.
    
    Signed-off-by: Ma Ling <ling.ma at intel.com>
    Signed-off-by: Wu Fengguang <wfg at linux.intel.com>

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 4a424de..256d16d 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1019,7 +1019,7 @@ i830_sdvo_mode_set(xf86OutputPtr output, DisplayModePtr mode,
     struct i830_sdvo_priv   *dev_priv = intel_output->dev_priv;
     xf86CrtcPtr	    crtc = output->crtc;
     I830CrtcPrivatePtr	    intel_crtc = crtc->driver_private;
-    uint32_t sdvox;
+    uint32_t sdvox = 0;
     int sdvo_pixel_multiply;
     struct i830_sdvo_in_out_map in_out;
     struct i830_sdvo_dtd input_dtd;
@@ -1041,8 +1041,10 @@ i830_sdvo_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 			&in_out, sizeof(in_out));
     status = i830_sdvo_read_response(output, NULL, 0);
 
-    if (dev_priv->is_hdmi)
+    if (dev_priv->is_hdmi) {
 	i830_sdvo_set_avi_infoframe(output, mode);
+	sdvox |= SDVO_AUDIO_ENABLE;
+    }
 
     i830_sdvo_get_dtd_from_mode(&input_dtd, mode);
 
@@ -1090,11 +1092,11 @@ i830_sdvo_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 
     /* Set the SDVO control regs. */
     if (IS_I965G(pI830)) {
-	sdvox = SDVO_BORDER_ENABLE |
+	sdvox |= SDVO_BORDER_ENABLE |
 		SDVO_VSYNC_ACTIVE_HIGH |
 		SDVO_HSYNC_ACTIVE_HIGH;
     } else {
-	sdvox = INREG(dev_priv->output_device);
+	sdvox |= INREG(dev_priv->output_device);
 	switch (dev_priv->output_device) {
 	case SDVOB:
 	    sdvox &= SDVOB_PRESERVE_MASK;
commit 42b3903c3fda95a7c536cb957d8163d8dc54a9a1
Author: Wu Fengguang <wfg at linux.intel.com>
Date:   Fri Nov 7 14:23:40 2008 +0800

    enable Intel G45 integrated HDMI audio output
    
    Enable audio output for the integrated HDMI of Intel G45 chipset
    by introducing the SDVO_AUDIO_ENABLE bit.
    
    Signed-off-by: Wu Fengguang <wfg at linux.intel.com>

diff --git a/src/i810_reg.h b/src/i810_reg.h
index b391d55..e2ffba1 100644
--- a/src/i810_reg.h
+++ b/src/i810_reg.h
@@ -1296,6 +1296,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 /** Requird for HDMI operation */
 #define SDVO_NULL_PACKETS_DURING_VSYNC		(1 << 9)
 #define SDVO_BORDER_ENABLE			(1 << 7)
+#define SDVO_AUDIO_ENABLE			(1 << 6)
 /** New with 965, default is to be set */
 #define SDVO_VSYNC_ACTIVE_HIGH			(1 << 4)
 /** New with 965, default is to be set */
diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c
index a3e3ba8..05aa9ac 100644
--- a/src/i830_hdmi.c
+++ b/src/i830_hdmi.c
@@ -80,6 +80,10 @@ i830_hdmi_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 	SDVO_BORDER_ENABLE |
 	SDVO_VSYNC_ACTIVE_HIGH |
 	SDVO_HSYNC_ACTIVE_HIGH;
+
+    if (dev_priv->has_hdmi_sink)
+	    sdvox |= SDVO_AUDIO_ENABLE;
+
     if (intel_crtc->pipe == 1)
 	sdvox |= SDVO_PIPE_B_SELECT;
 
commit 293f4a8b6d1ca8a47d14c4d4b5904b85a8167e12
Author: Wu Fengguang <wfg at linux.intel.com>
Date:   Thu Nov 13 09:50:37 2008 +0800

    introduce i830_hdmi_priv.has_hdmi_sink
    
    HDMI is compatible with DVI, and we've seen many boards that
    use HDMI port for DVI output.
    
    So Zhenyu proposed this flag: i830_hdmi_priv.has_hdmi_sink
    to indicate the presence of HDMI capable monitors.
    
    Signed-off-by: Wu Fengguang <wfg at linux.intel.com>

diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c
index 806ca7d..a3e3ba8 100644
--- a/src/i830_hdmi.c
+++ b/src/i830_hdmi.c
@@ -38,6 +38,8 @@ struct i830_hdmi_priv {
     uint32_t output_reg;
 
     uint32_t save_SDVO;
+
+    Bool has_hdmi_sink;
 };
 
 static int
@@ -142,6 +144,8 @@ i830_hdmi_detect(xf86OutputPtr output)
     xf86OutputStatus status;
     xf86MonPtr edid_mon;
 
+    dev_priv->has_hdmi_sink = FALSE;
+
     /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written 0xd.
      * Failure to do so will result in spurious interrupts being
      * generated on the port when a cable is not attached.
@@ -180,6 +184,17 @@ i830_hdmi_detect(xf86OutputPtr output)
     edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
     if (!edid_mon || !DIGITAL(edid_mon->features.input_type))
 	status = XF86OutputStatusDisconnected;
+
+    if (xf86LoaderCheckSymbol("xf86MonitorIsHDMI") &&
+	    xf86MonitorIsHDMI(edid_mon))
+	dev_priv->has_hdmi_sink = TRUE;
+
+    if (pI830->debug_modes)
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+			"%s monitor detected on HDMI-%d\n",
+			dev_priv->has_hdmi_sink ? "HDMI" : "DVI",
+			(dev_priv->output_reg == SDVOB) ? 1 : 2);
+
     xfree(edid_mon);
     return status;
 }
@@ -232,6 +247,7 @@ i830_hdmi_init(ScrnInfoPtr pScrn, int output_reg)
 
     dev_priv = (struct i830_hdmi_priv *)(intel_output + 1);
     dev_priv->output_reg = output_reg;
+    dev_priv->has_hdmi_sink = FALSE;
 
     intel_output->dev_priv = dev_priv;
     intel_output->type = I830_OUTPUT_HDMI;


More information about the xorg-commit mailing list