1
commit da218289275e67e49d801d58dd818d237de8a9bc
2
Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
3
Date: Tue Aug 24 13:30:25 2010 +1000
5
Xext: Fix edge case with {Positive,Negative}Transition triggers.
7
The {Positive,Negative}Transition triggers only fire when the counter
8
goes from strictly {below,above} the threshold. If
9
SyncComputeBracketValues gets called exactly at this threshold we may update
10
the bracket values so that the counter is not updated past the threshold.
12
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
14
diff --git a/Xext/sync.c b/Xext/sync.c
15
index a51262a..c00e692 100644
18
@@ -959,6 +959,17 @@ SyncComputeBracketValues(SyncCounter *pCounter)
20
psci->bracket_less = pTrigger->test_value;
21
pnewltval = &psci->bracket_less;
22
+ } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
23
+ XSyncValueLessThan(pTrigger->test_value,
24
+ psci->bracket_greater))
27
+ * The value is exactly equal to our threshold. We want one
28
+ * more event in the positive direction to ensure we pick up
29
+ * when the value *exceeds* this threshold.
31
+ psci->bracket_greater = pTrigger->test_value;
32
+ pnewgtval = &psci->bracket_greater;
35
else if (pTrigger->test_type == XSyncPositiveTransition &&
36
@@ -969,6 +980,17 @@ SyncComputeBracketValues(SyncCounter *pCounter)
38
psci->bracket_greater = pTrigger->test_value;
39
pnewgtval = &psci->bracket_greater;
40
+ } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
41
+ XSyncValueGreaterThan(pTrigger->test_value,
42
+ psci->bracket_less))
45
+ * The value is exactly equal to our threshold. We want one
46
+ * more event in the negative direction to ensure we pick up
47
+ * when the value is less than this threshold.
49
+ psci->bracket_less = pTrigger->test_value;
50
+ pnewltval = &psci->bracket_less;
53
} /* end for each trigger */
54
commit d9e9c0c3cf0456f78b6eed3290e6a418e38963fb
55
Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
56
Date: Tue Aug 24 13:35:05 2010 +1000
58
IDLETIME: Fix edge-case in IdleTimeBlockHandler
60
Ensure that if we're called exactly on the threshold of a
61
NegativeTransition trigger that we reshedule to pick up
62
an idle time over the threshold.
64
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
66
diff --git a/Xext/sync.c b/Xext/sync.c
67
index c00e692..314b63e 100644
70
@@ -2322,6 +2322,14 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
75
+ * We've been called exactly on the idle time, but we have a
76
+ * NegativeTransition trigger which requires a transition from an
77
+ * idle time greater than this. Schedule a wakeup for the next
78
+ * millisecond so we won't miss a transition.
80
+ if (XSyncValueEqual (idle, *pIdleTimeValueLess))
81
+ AdjustWaitForDelay(wt, 1);
83
else if (pIdleTimeValueGreater)