summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorErik Gilling <konkers@android.com>2013-02-28 16:43:01 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-04 17:40:08 +0800
commitcebed3b1d7eaee7fb79e2c510a0da4296db043c8 (patch)
treecbc2e5abdd722f6cbe03017a2b6b861733f2ced7 /drivers
parentaf7582f293cdc29999d05f75b1ec835ffa43cb68 (diff)
staging: sw_sync: Add debug support
Add debugfs support hooks. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Add commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/android/sw_sync.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index c27004c94cc6..64c5ebbbb1a0 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -70,11 +70,30 @@ static int sw_sync_pt_compare(struct sync_pt *a, struct sync_pt *b)
return sw_sync_cmp(pt_a->value, pt_b->value);
}
+static void sw_sync_print_obj(struct seq_file *s,
+ struct sync_timeline *sync_timeline)
+{
+ struct sw_sync_timeline *obj = (struct sw_sync_timeline *)sync_timeline;
+
+ seq_printf(s, "%d", obj->value);
+}
+
+static void sw_sync_print_pt(struct seq_file *s, struct sync_pt *sync_pt)
+{
+ struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt;
+ struct sw_sync_timeline *obj =
+ (struct sw_sync_timeline *)sync_pt->parent;
+
+ seq_printf(s, "%d / %d", pt->value, obj->value);
+}
+
struct sync_timeline_ops sw_sync_timeline_ops = {
.driver_name = "sw_sync",
.dup = sw_sync_pt_dup,
.has_signaled = sw_sync_pt_has_signaled,
.compare = sw_sync_pt_compare,
+ .print_obj = sw_sync_print_obj,
+ .print_pt = sw_sync_print_pt,
};