msm: kgsl: Reimplement the timestamp comparison function
Make timestamp_cmp return -1, 0 or 1 depending if
the first operand is less than, equal or greater
than the second operand.
Change-Id: Ic0dedbad0ea2d918e0eeef9428859f0b54a6e7ad
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/z180.c b/drivers/gpu/msm/z180.c
index 9e14247..cdb9c23 100644
--- a/drivers/gpu/msm/z180.c
+++ b/drivers/gpu/msm/z180.c
@@ -378,7 +378,8 @@
int status = 0;
struct z180_device *z180_dev = Z180_DEVICE(device);
- if (z180_dev->current_timestamp > z180_dev->timestamp)
+ if (timestamp_cmp(z180_dev->current_timestamp,
+ z180_dev->timestamp) > 0)
status = z180_wait(device, z180_dev->current_timestamp,
timeout);
@@ -644,15 +645,10 @@
static unsigned int z180_isidle(struct kgsl_device *device)
{
- int status = false;
struct z180_device *z180_dev = Z180_DEVICE(device);
- int timestamp = z180_dev->timestamp;
-
- if (timestamp == z180_dev->current_timestamp)
- status = true;
-
- return status;
+ return (timestamp_cmp(z180_dev->timestamp,
+ z180_dev->current_timestamp) == 0) ? true : false;
}
static int z180_suspend_context(struct kgsl_device *device)