summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2012-07-23 16:34:28 -0400
committerKeith Packard <keithp@keithp.com>2012-08-06 16:14:37 -0700
commit4a6f42dda00ba3b5616f8a86f0d4c9a652c7d9d4 (patch)
treee600b3b69accac12e7e75d993c28af03eaf11c62
parent454d0e3a1bb14d7f2579ccb5e513cec5686160e7 (diff)
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@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--Xext/sync.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index b8f094db5..4d11992bb 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 */