summaryrefslogtreecommitdiff
path: root/drivers/staging/android/sync_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/android/sync_debug.c')
-rw-r--r--drivers/staging/android/sync_debug.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c
index 85ae98a6..fd13f1e 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/staging/android/sync_debug.c
@@ -85,39 +85,40 @@ static const char *sync_status_str(int status)
return "error";
}
-static void sync_print_pt(struct seq_file *s, struct fence *pt, bool fence)
+static void sync_print_fence(struct seq_file *s, struct fence *fence, bool show)
{
int status = 1;
+ struct sync_timeline *parent = fence_parent(fence);
- if (fence_is_signaled_locked(pt))
- status = pt->status;
+ if (fence_is_signaled_locked(fence))
+ status = fence->status;
- seq_printf(s, " %s%spt %s",
- fence && pt->ops->get_timeline_name ?
- pt->ops->get_timeline_name(pt) : "",
- fence ? "_" : "",
+ seq_printf(s, " %s%sfence %s",
+ show ? parent->name : "",
+ show ? "_" : "",
sync_status_str(status));
if (status <= 0) {
struct timespec64 ts64 =
- ktime_to_timespec64(pt->timestamp);
+ ktime_to_timespec64(fence->timestamp);
seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
}
- if ((!fence || pt->ops->timeline_value_str) &&
- pt->ops->fence_value_str) {
+ if ((!fence || fence->ops->timeline_value_str) &&
+ fence->ops->fence_value_str) {
char value[64];
bool success;
- pt->ops->fence_value_str(pt, value, sizeof(value));
+ fence->ops->fence_value_str(fence, value, sizeof(value));
success = strlen(value);
if (success)
seq_printf(s, ": %s", value);
if (success && fence) {
- pt->ops->timeline_value_str(pt, value, sizeof(value));
+ fence->ops->timeline_value_str(fence, value,
+ sizeof(value));
if (strlen(value))
seq_printf(s, " / %s", value);
@@ -145,25 +146,25 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
spin_lock_irqsave(&obj->child_list_lock, flags);
list_for_each(pos, &obj->child_list_head) {
- struct sync_pt *pt =
- container_of(pos, struct sync_pt, child_list);
- sync_print_pt(s, &pt->base, false);
+ struct fence *fence =
+ container_of(pos, struct fence, child_list);
+ sync_print_fence(s, fence, false);
}
spin_unlock_irqrestore(&obj->child_list_lock, flags);
}
static void sync_print_sync_file(struct seq_file *s,
struct sync_file *sync_file)
- {
+{
int i;
seq_printf(s, "[%p] %s: %s\n", sync_file, sync_file->name,
sync_status_str(atomic_read(&sync_file->status)));
for (i = 0; i < sync_file->num_fences; ++i)
- sync_print_pt(s, sync_file->cbs[i].fence, true);
- }
-
+ sync_print_fence(s, sync_file->cbs[i].fence, true);
+}
+
static int sync_debugfs_show(struct seq_file *s, void *unused)
{
unsigned long flags;
@@ -244,7 +245,7 @@ static long sw_sync_ioctl_create_fence(struct sw_sync_timeline *obj,
{
int fd = get_unused_fd_flags(O_CLOEXEC);
int err;
- struct sync_pt *pt;
+ struct fence *fence;
struct sync_file *sync_file;
struct sw_sync_create_fence_data data;
@@ -256,16 +257,16 @@ static long sw_sync_ioctl_create_fence(struct sw_sync_timeline *obj,
goto err;
}
- pt = sw_sync_pt_create(obj, data.value);
- if (!pt) {
+ fence = sw_sync_pt_create(obj, data.value);
+ if (!fence) {
err = -ENOMEM;
goto err;
}
data.name[sizeof(data.name) - 1] = '\0';
- sync_file = sync_file_create(data.name, pt);
+ sync_file = sync_file_create(data.name, fence);
if (!sync_file) {
- sync_pt_free(pt);
+ fence_put(fence);
err = -ENOMEM;
goto err;
}