[PATCH] Retry SDVO enable for failure to sync during SDVO dpms on

Will . nodenet at hotmail.com
Thu Mar 15 17:06:43 PDT 2007


This made SDVO TV out sync reliably. I've seperated it from the SDVO TV out 
code as I can't see why it can't be applied as a generic patch.

>From d7a52b929d1d25e7d2de6c8ac90570b271b31329 Mon Sep 17 00:00:00 2001
From: William Wiseman <wisemanw at wisemanw.me.uk>
Date: Thu, 15 Mar 2007 23:51:38 +0000
Subject: [PATCH] Retry SDVO enable for failure to sync during SDVO dpms on

---
src/i830_sdvo.c |   36 ++++++++++++++++++++++++------------
1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index fb6a7c8..75e18a1 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -763,18 +763,30 @@ i830_sdvo_dpms(xf86OutputPtr output, int mode)
            POSTING_READ(dev_priv->output_device);
#endif
        }
-       for (i = 0; i < 2; i++)
-           i830WaitForVblank(pScrn);
-
-       status = i830_sdvo_get_trained_inputs(output, &input1, &input2);
-
-       /* Warn if the device reported failure to sync. */
-       if (status == SDVO_CMD_STATUS_SUCCESS && !input1) {
-           xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                      "First %s output reported failure to sync\n",
-                      SDVO_NAME(dev_priv));
-       }
-
+
+        /** Get trained inputs, try to re-enable the SDVO port if
+            it fails to sync **/
+
+        i = 0;
+        do {
+            i++;
+            i830WaitForVblank(pScrn);
+
+            status = i830_sdvo_get_trained_inputs(output, &input1, 
&input2);
+
+            /* Warn if the device reported failure to sync. */
+            if(status == SDVO_CMD_STATUS_SUCCESS && !input1) {
+                xf86DrvMsg(pScrn->scrnIndex, (i<4)?X_WARNING:X_ERROR,
+                           "First %s output reported failure to sync"
+                           " attempt %d\n",i, SDVO_NAME(dev_priv));
+                if(i<4) {
+                    i830_sdvo_write_sdvox(output,
+                                INREG(dev_priv->output_device) | 
SDVO_ENABLE);
+                    POSTING_READ(dev_priv->output_device);
+                }
+            }
+        } while(i < 4 && !input1);
+
        if (0)
            i830_sdvo_set_encoder_power_state(output, mode);
        i830_sdvo_set_active_outputs(output, dev_priv->active_outputs);
--
1.4.4.4

_________________________________________________________________
Txt a lot? Get Messenger FREE on your mobile. 
https://livemessenger.mobile.uk.msn.com/




More information about the xorg mailing list