open-src/xserver/xorg/ddc.patch
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Mon, 19 Mar 2007 17:23:42 -0700
changeset 127 efdfc241889d
permissions -rw-r--r--
6536008 DDC/I2C bus timings set incorrectly when probing monitors
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
127
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     1
From b5a8a71e64c76b8dd42962cbd7984215c6ce4aa8 Mon Sep 17 00:00:00 2001
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     2
From: Keith Packard <[email protected]>
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     3
Date: Sat, 17 Mar 2007 17:26:11 -0700
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     4
Subject: [PATCH] Remove extra (and wrong) I2C ByteTimeout setting in DDC code.
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     5
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     6
The DDC code sets the I2C timeouts to VESA standards, except that it had an
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     7
extra setting of the ByteTimeout value which was wrong (off by a factor of
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     8
50). Removing this should help DDC work on many more monitors. Note that the
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     9
Intel driver duplicated these settings, along with the error. Yay for cult
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    10
and paste coding.
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    11
---
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    12
 hw/xfree86/ddc/xf86DDC.c |    1 -
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    13
 1 files changed, 0 insertions(+), 1 deletions(-)
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    14
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    15
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    16
index 4ce585c..0f24c52 100644
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    17
--- a/hw/xfree86/ddc/xf86DDC.c
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    18
+++ b/hw/xfree86/ddc/xf86DDC.c
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    19
@@ -344,7 +344,6 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pB
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    20
 	dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    21
 	dev->StartTimeout = 550;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    22
 	dev->BitTimeout = 40;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    23
-	dev->ByteTimeout = 40;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    24
 	dev->AcknTimeout = 40;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    25
 
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    26
 	dev->pI2CBus = pBus;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    27
-- 
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    28
1.4.1
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    29
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    30
From 720f302d241e88e6e9f2962207da1aa9a79728b7 Mon Sep 17 00:00:00 2001
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    31
From: Keith Packard <[email protected]>
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    32
Date: Sat, 17 Mar 2007 20:14:05 -0700
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    33
Subject: [PATCH] Slow down DDC I2C bus using a RiseFallTime of 20us for old monitors.
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    34
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    35
This time value makes the bus run slowly enough for even the least reliable
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    36
of monitors. Thanks to Pavel Troller for finding the necessary change.
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    37
---
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    38
 hw/xfree86/ddc/xf86DDC.c |    6 ++++++
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    39
 1 files changed, 6 insertions(+), 0 deletions(-)
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    40
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    41
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    42
index 0f24c52..8080c8d 100644
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    43
--- a/hw/xfree86/ddc/xf86DDC.c
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    44
+++ b/hw/xfree86/ddc/xf86DDC.c
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    45
@@ -337,6 +337,12 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pB
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    46
     unsigned char *R_Buffer;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    47
     int i;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    48
     
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    49
+    /*
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    50
+     * Slow down the bus so that older monitors don't 
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    51
+     * miss things.
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    52
+     */
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    53
+    pBus->RiseFallTime = 20;
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    54
+    
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    55
     if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) {
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    56
 	dev = xf86CreateI2CDevRec();
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    57
 	dev->DevName = "ddc2";
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    58
-- 
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    59
1.4.1
efdfc241889d 6536008 DDC/I2C bus timings set incorrectly when probing monitors
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    60