From 44041119b739ee4b229401007fdfb48fefa2a302 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Thu, 28 Feb 2013 16:42:59 -0800 Subject: [PATCH] --- yaml --- r: 363259 b: refs/heads/master c: 97a84843ac4a1b81c36ccf35ee26cd19c5b8d873 h: refs/heads/master i: 363257: c4e34140224481be69a8e502a37fefe9602b08f7 363255: 6872bcac75c93f3e38f4aefe0f5bf6e618e28273 v: v3 --- [refs] | 2 +- trunk/drivers/staging/android/sync.c | 5 +++++ trunk/drivers/staging/android/sync.h | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index dd83a32a31c5..f99977a1ff0b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d1906e61dda982070e3910a04d9cce050f7f1a4 +refs/heads/master: 97a84843ac4a1b81c36ccf35ee26cd19c5b8d873 diff --git a/trunk/drivers/staging/android/sync.c b/trunk/drivers/staging/android/sync.c index 4a9e63df83e9..88d7e6625868 100644 --- a/trunk/drivers/staging/android/sync.c +++ b/trunk/drivers/staging/android/sync.c @@ -155,12 +155,17 @@ void sync_pt_free(struct sync_pt *pt) /* call with pt->parent->active_list_lock held */ static int _sync_pt_has_signaled(struct sync_pt *pt) { + int old_status = pt->status; + if (!pt->status) pt->status = pt->parent->ops->has_signaled(pt); if (!pt->status && pt->parent->destroyed) pt->status = -ENOENT; + if (pt->status != old_status) + pt->timestamp = ktime_get(); + return pt->status; } diff --git a/trunk/drivers/staging/android/sync.h b/trunk/drivers/staging/android/sync.h index 388acd1ff412..a8e289d50ae0 100644 --- a/trunk/drivers/staging/android/sync.h +++ b/trunk/drivers/staging/android/sync.h @@ -16,6 +16,7 @@ #include #ifdef __KERNEL__ +#include #include #include #include @@ -90,6 +91,8 @@ struct sync_timeline { * @fence: sync_fence to which the sync_pt belongs * @pt_list: membership in sync_fence.pt_list_head * @status: 1: signaled, 0:active, <0: error + * @timestamp: time which sync_pt status transitioned from active to + * singaled or error. */ struct sync_pt { struct sync_timeline *parent; @@ -102,6 +105,8 @@ struct sync_pt { /* protected by parent->active_list_lock */ int status; + + ktime_t timestamp; }; /**