diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-08-13 16:37:00 +1000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-08-25 19:45:36 -0700 |
commit | 55c26d8e4d110b689aea9d806e9d4fa7bbbdd32a (patch) | |
tree | 383d68ad54efbab30d5c2a975af6ebd26ebdd2ff /Xext | |
parent | f274e595ed56722450f6ecebad70500c92e50c58 (diff) |
Xext: fix up wrong conditions for negative sync transitions.
If the counter had a value higher than the trigger value for a negative
transition, the trigger value did not get set.
The correct sequence of checks is:
if (positive transition)
if (counter value < trigger value)
set up trigger
if (negative transition)
if (counter value > trigger value)
set up trigger
Red Hat Bug 501601 <https://bugzilla.redhat.com/show_bug.cgi?id=501601>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit db568f9eabf3450d8a023597ff007df355b13ea8)
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/sync.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/Xext/sync.c b/Xext/sync.c index 424361ee5..a006ae95b 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -1168,28 +1168,24 @@ SyncComputeBracketValues(pCounter, startOver) pnewltval = &psci->bracket_less; } } - else if ( (pTrigger->test_type == XSyncPositiveTransition && + else if (pTrigger->test_type == XSyncNegativeTransition && ct != XSyncCounterNeverIncreases) - || - (pTrigger->test_type == XSyncNegativeTransition && + { + if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) && + XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) + { + psci->bracket_less = pTrigger->test_value; + pnewltval = &psci->bracket_less; + } + } + else if (pTrigger->test_type == XSyncPositiveTransition && ct != XSyncCounterNeverDecreases) - ) { - if (XSyncValueLessThan(pCounter->value, pTrigger->test_value)) + if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) && + XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) { - if (XSyncValueLessThan(pTrigger->test_value, - psci->bracket_greater)) - { - psci->bracket_greater = pTrigger->test_value; - pnewgtval = &psci->bracket_greater; - } - else - if (XSyncValueGreaterThan(pTrigger->test_value, - psci->bracket_less)) - { - psci->bracket_less = pTrigger->test_value; - pnewltval = &psci->bracket_less; - } + psci->bracket_greater = pTrigger->test_value; + pnewgtval = &psci->bracket_greater; } } } /* end for each trigger */ |