msm: kgsl: Send the correct timestamp to an expired event
Instead of sending the currently expired timestamp to expired
events, send the timestamp that the event expected. This avoids
confusion for events that don't compare the actual timestamp
to the one they expected. Canceled events send the current
timestamp when they were canceled.
The kgsl_sync handler wasn't prepared for the second case so
add a check to prevent strange things from happening on the
timeline when a event is canceled.
Change-Id: Ic0dedbad3681db6222720884688dcddb9b06bda2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl_sync.c b/drivers/gpu/msm/kgsl_sync.c
index a2dfe3b..9325124 100644
--- a/drivers/gpu/msm/kgsl_sync.c
+++ b/drivers/gpu/msm/kgsl_sync.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -204,7 +204,9 @@
{
struct kgsl_sync_timeline *ktimeline =
(struct kgsl_sync_timeline *) timeline;
- ktimeline->last_timestamp = timestamp;
+
+ if (timestamp_cmp(timestamp, ktimeline->last_timestamp > 0))
+ ktimeline->last_timestamp = timestamp;
sync_timeline_signal(timeline);
}