msm: kgsl: Add timestamp events
Add support for triggering asynchronous events when a timestamp
expires. The infrastructure is generic enough to support different
sorts of events and callbacks. The first user of the event
infrastructure is a way to release a genlock locks on behalf of a
user space process.
Change-Id: Ic0dedbadfe67d98a5678453cbe0ac6996ba5c68f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl_device.h b/drivers/gpu/msm/kgsl_device.h
index fd203ef..c88f16ef 100644
--- a/drivers/gpu/msm/kgsl_device.h
+++ b/drivers/gpu/msm/kgsl_device.h
@@ -118,6 +118,14 @@
int mpu_range;
};
+struct kgsl_event {
+ uint32_t timestamp;
+ void (*func)(struct kgsl_device *, void *, u32);
+ void *priv;
+ struct list_head list;
+};
+
+
struct kgsl_device {
struct device *dev;
const char *name;
@@ -165,6 +173,7 @@
struct kgsl_pwrscale pwrscale;
struct kobject pwrscale_kobj;
struct work_struct ts_expired_ws;
+ struct list_head events;
};
struct kgsl_context {