[Intel-gfx] [PATCH 2/3] set hdtv broadcast mode for sdvo

Ma Ling ling.ma at intel.com
Mon Feb 23 08:06:58 CET 2009


enable hdtv broadcast color mode for corresponding sdvo output

---
 src/i830_sdvo.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 0750166..5cdc6a7 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -84,6 +84,11 @@ struct i830_sdvo_priv {
     Bool is_hdmi;
 
     /**
+     * This is set if user requir hdtv use broadcast rgb.
+     */
+    Bool hdtv_use_broadcast;
+
+    /**
      * Returned SDTV resolutions allowed for the current format, if the
      * device reported it.
      */
@@ -1118,6 +1123,10 @@ i830_sdvo_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 	sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT;
     }
 
+    /* apply 16-235 color range to the output */
+    if (dev_priv->hdtv_use_broadcast)
+	sdvox |= SDVO_COLOR_RANGE;
+
     i830_sdvo_write_sdvox(output, sdvox);
 }
 
@@ -1749,6 +1758,20 @@ i830_sdvo_get_digital_encoding_mode(xf86OutputPtr output)
     return TRUE;
 }
 
+static void i830_sdvo_hdtv_use_broadcast(xf86OutputPtr output)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+    I830Ptr pI830 = I830PTR(pScrn);
+    I830OutputPrivatePtr    intel_output = output->driver_private;
+    struct i830_sdvo_priv   *dev_priv = intel_output->dev_priv;
+
+    /* only R G B are 8bit color mode*/
+    if (pScrn->depth == 24 &&
+	/* only DevCL and DevCTG */
+	(IS_I965G(pI830) || IS_GM45(pI830)))
+        dev_priv->hdtv_use_broadcast = TRUE;
+}
+
 Bool
 i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
 {
@@ -1884,6 +1907,13 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
 	    i830_sdvo_set_colorimetry(output, SDVO_COLORIMETRY_RGB256);
 	    name_prefix = "HDMI";
 	}
+        /* apply 16-235 color range to the output */
+        if ((I830PTR(pScrn)->hdtv_1_use_broadcast &&
+	    (strcmp(name_suffix, "-1") == 0)))
+	    i830_sdvo_hdtv_use_broadcast(output);
+	else if ((I830PTR(pScrn)->hdtv_2_use_broadcast &&
+		 (strcmp(name_suffix, "-2") == 0)))
+	    i830_sdvo_hdtv_use_broadcast(output);
     }
     else if (dev_priv->caps.output_flags & SDVO_OUTPUT_SVID0)
     {
-- 
1.5.4.4






More information about the Intel-gfx mailing list