diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c index 701aeaa..7be79b4 100644 --- a/src/i830_sdvo.c +++ b/src/i830_sdvo.c @@ -770,7 +770,7 @@ i830_sdvo_get_supp_encode(xf86OutputPtr output, struct i830_sdvo_encode *encode) i830_sdvo_write_cmd(output, SDVO_CMD_GET_SUPP_ENCODE, NULL, 0); status = i830_sdvo_read_response(output, encode, sizeof(*encode)); - if (status != SDVO_CMD_STATUS_SUCCESS) { + if (status != SDVO_CMD_STATUS_SUCCESS) { /* non-support means DVI */ memset(encode, 0, sizeof(*encode)); return FALSE; } @@ -1723,6 +1723,22 @@ i830_sdvo_select_ddc_bus(struct i830_sdvo_priv *dev_priv) } Bool +i830_sdvo_get_digital_encoding_mode(xf86OutputPtr output, uint8_t *mode) +{ + I830OutputPrivatePtr intel_output = output->driver_private; + struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; + uint8_t status; + + i830_sdvo_set_target_output(output, dev_priv->controlled_output); + + i830_sdvo_write_cmd(output, SDVO_CMD_GET_ENCODE, NULL, 0); + status = i830_sdvo_read_response(output, mode, 1); + if (status != SDVO_CMD_STATUS_SUCCESS) + return FALSE; + return TRUE; +} + +Bool i830_sdvo_init(ScrnInfoPtr pScrn, int output_device) { xf86OutputPtr output; @@ -1842,6 +1858,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device) if (dev_priv->caps.output_flags & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) { + uint8_t hdmi_mode; if (dev_priv->caps.output_flags & SDVO_OUTPUT_TMDS0) dev_priv->controlled_output = SDVO_OUTPUT_TMDS0; else @@ -1849,8 +1866,9 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device) output->subpixel_order = SubPixelHorizontalRGB; name_prefix="TMDS"; - i830_sdvo_get_supp_encode(output, &dev_priv->encode); - if (dev_priv->encode.hdmi_rev != 0) { + if (i830_sdvo_get_supp_encode(output, &dev_priv->encode) && + i830_sdvo_get_digital_encoding_mode(output, &hdmi_mode) && + (hdmi_mode == 1)) { /* enable hdmi encoding mode if supported */ i830_sdvo_set_encode(output, SDVO_ENCODE_HDMI); i830_sdvo_set_colorimetry(output, SDVO_COLORIMETRY_RGB256);