From patchwork Fri Mar 1 00:42:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 15159 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 12BA223E1A for ; Fri, 1 Mar 2013 00:43:47 +0000 (UTC) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by fiordland.canonical.com (Postfix) with ESMTP id 8EC20A1959D for ; Fri, 1 Mar 2013 00:43:46 +0000 (UTC) Received: by mail-vc0-f172.google.com with SMTP id l6so1622388vcl.31 for ; Thu, 28 Feb 2013 16:43:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=4gIEruUjiyCKP4GGr32m30szVwKnd7JxeHZ7casr5xg=; b=c31lPJmTEdeNaquYfYAuQtUuPjE8YIhJOSfH/BhXF9p2wAT1tThLXrjgkBuj4iCqFj TtM3WK6mlWCyCOW2+bifCpUIPOnjRGRvndaDP6EWLRzqrHyd5NdbivGV5kr3T0K8M6U1 iA4j7A3QU2k9DPy6Kr9X0pEgEwtZYWtGP7Ahoaqsc5AabeXoDGBwjLibeq8ISsDB47TO 4KnuHHOYKn8FcAwAxOizu34yksLUQn6cr4HYGRHENfzTzhP5AXCLJrf6U28xMwjFDx7X /FCClcPxgsxY7EdEkELLAZ3EqgugYGZ1gvLxBFfsgzNLbxxvQ8Q/0gbDUFm9stbUikT7 SGRw== X-Received: by 10.58.48.166 with SMTP id m6mr3335218ven.59.1362098626072; Thu, 28 Feb 2013 16:43:46 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp635veb; Thu, 28 Feb 2013 16:43:45 -0800 (PST) X-Received: by 10.68.189.99 with SMTP id gh3mr11840085pbc.203.1362098625024; Thu, 28 Feb 2013 16:43:45 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id pu7si10302451pbc.22.2013.02.28.16.43.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: by mail-pb0-f45.google.com with SMTP id ro8so1388532pbb.18 for ; Thu, 28 Feb 2013 16:43:44 -0800 (PST) X-Received: by 10.68.248.74 with SMTP id yk10mr11876248pbc.38.1362098624636; Thu, 28 Feb 2013 16:43:44 -0800 (PST) Received: from localhost.localdomain (c-24-21-54-107.hsd1.or.comcast.net. [24.21.54.107]) by mx.google.com with ESMTPS id dx17sm10914892pac.17.2013.02.28.16.43.42 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:43 -0800 (PST) From: John Stultz To: lkml Cc: Erik Gilling , Maarten Lankhorst , Daniel Vetter , Rob Clark , Sumit Semwal , Greg KH , dri-devel@lists.freedesktop.org, Android Kernel Team , John Stultz Subject: [PATCH 03/30] staging: sync: Add timestamps to sync_pts Date: Thu, 28 Feb 2013 16:42:59 -0800 Message-Id: <1362098606-26469-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> References: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> X-Gm-Message-State: ALoCoQnUjvAmhcEsSXDGLvaay5g33q98QYvC79V7tG/9fFPKOKee/Sin9yt/RsYrXoIaCP7aIDRt From: Erik Gilling Add ktime timestamps to sync_pt structure and update them when signaled Cc: Maarten Lankhorst Cc: Erik Gilling Cc: Daniel Vetter Cc: Rob Clark Cc: Sumit Semwal Cc: Greg KH Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team Signed-off-by: Erik Gilling [jstultz: Added commit message] Signed-off-by: John Stultz --- drivers/staging/android/sync.c | 5 +++++ drivers/staging/android/sync.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 4a9e63d..88d7e66 100644 --- a/drivers/staging/android/sync.c +++ b/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/drivers/staging/android/sync.h b/drivers/staging/android/sync.h index 388acd1..a8e289d 100644 --- a/drivers/staging/android/sync.h +++ b/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; }; /**