xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Mon Aug 6 16:17:39 PDT 2012


 Xext/sync.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 4a6f42dda00ba3b5616f8a86f0d4c9a652c7d9d4
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Jul 23 16:34:28 2012 -0400

    sync: Fix logic error from b55bf248581dc66321b24b29f199f6dc8d02db1b
    
    That commit adds two hunks, and I _think_ they're backwards.  It adds
    code to modify bracket_greater on NegativeTransition triggers, and
    bracket_less on PositiveTransition triggers.  That breaks symmetry with
    the surrounding code; the code as of this commit could probably be
    simplified further.
    
    I can't keep the sync trigger rules in my head for more than about five
    minutes at a time, so I'm sending this on for more eyes.  RHEL 6.3's
    xserver is shipping with b55bf248 reverted:
    
        https://bugzilla.redhat.com/show_bug.cgi?id=748704#c33
    
    And there appear to be some upstream reports of the same issue:
    
        https://bugzilla.gnome.org/show_bug.cgi?id=658955
    
    So I'd like to get this sorted out.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/sync.c b/Xext/sync.c
index b8f094d..4d11992 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1038,15 +1038,15 @@ SyncComputeBracketValues(SyncCounter * pCounter)
                 pnewltval = &psci->bracket_less;
             }
             else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
-                     XSyncValueLessThan(pTrigger->test_value,
-                                        psci->bracket_greater)) {
+                     XSyncValueGreaterThan(pTrigger->test_value,
+                                           psci->bracket_less)) {
                 /*
                  * The value is exactly equal to our threshold.  We want one
-                 * more event in the positive direction to ensure we pick up
-                 * when the value *exceeds* this threshold.
+                 * more event in the negative direction to ensure we pick up
+                 * when the value is less than this threshold.
                  */
-                psci->bracket_greater = pTrigger->test_value;
-                pnewgtval = &psci->bracket_greater;
+                psci->bracket_less = pTrigger->test_value;
+                pnewltval = &psci->bracket_less;
             }
         }
         else if (pTrigger->test_type == XSyncPositiveTransition &&
@@ -1058,15 +1058,15 @@ SyncComputeBracketValues(SyncCounter * pCounter)
                 pnewgtval = &psci->bracket_greater;
             }
             else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
-                     XSyncValueGreaterThan(pTrigger->test_value,
-                                           psci->bracket_less)) {
+                     XSyncValueLessThan(pTrigger->test_value,
+                                        psci->bracket_greater)) {
                 /*
                  * The value is exactly equal to our threshold.  We want one
-                 * more event in the negative direction to ensure we pick up
-                 * when the value is less than this threshold.
+                 * more event in the positive direction to ensure we pick up
+                 * when the value *exceeds* this threshold.
                  */
-                psci->bracket_less = pTrigger->test_value;
-                pnewltval = &psci->bracket_less;
+                psci->bracket_greater = pTrigger->test_value;
+                pnewgtval = &psci->bracket_greater;
             }
         }
     }                           /* end for each trigger */


More information about the xorg-commit mailing list