Release 4.7 drivers/staging/android/sync.c
/*
* drivers/base/sync.c
*
* Copyright (C) 2012 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/debugfs.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/anon_inodes.h>
#include "sync.h"
#define CREATE_TRACE_POINTS
#include "trace/sync.h"
static const struct fence_ops android_fence_ops;
struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops,
int size, const char *name)
{
struct sync_timeline *obj;
if (size < sizeof(struct sync_timeline))
return NULL;
obj = kzalloc(size, GFP_KERNEL);
if (!obj)
return NULL;
kref_init(&obj->kref);
obj->ops = ops;
obj->context = fence_context_alloc(1);
strlcpy(obj->name, name, sizeof(obj->name));
INIT_LIST_HEAD(&obj->child_list_head);
INIT_LIST_HEAD(&obj->active_list_head);
spin_lock_init(&obj->child_list_lock);
sync_timeline_debug_add(obj);
return obj;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
erik gilling | erik gilling | 115 | 90.55% | 3 | 60.00% |
maarten lankhorst | maarten lankhorst | 11 | 8.66% | 1 | 20.00% |
ioana ciornei | ioana ciornei | 1 | 0.79% | 1 | 20.00% |
| Total | 127 | 100.00% | 5 | 100.00% |
EXPORT_SYMBOL(sync_timeline_create);
static void sync_timeline_free(struct kref *kref)
{
struct sync_timeline *obj =
container_of(kref, struct sync_timeline, kref);
sync_timeline_debug_remove(obj);
kfree(obj);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
erik gilling | erik gilling | 35 | 97.22% | 2 | 66.67% |
maarten lankhorst | maarten lankhorst | 1 | 2.78% | 1 | 33.33% |
| Total | 36 | 100.00% | 3 | 100.00% |
static void sync_timeline_get(struct sync_timeline *obj)
{
kref_get(&obj->kref);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
maarten lankhorst | maarten lankhorst | 19 | 100.00% | 1 | 100.00% |
| Total | 19 | 100.00% | 1 | 100.00% |
static void sync_timeline_put(struct sync_timeline *obj)
{
kref_put(&obj->kref, sync_timeline_free);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
maarten lankhorst | maarten lankhorst | 21 | 100.00% | 1 | 100.00% |
| Total | 21 | 100.00% | 1 | 100.00% |
void sync_timeline_destroy(struct sync_timeline *obj)
{
obj->destroyed = true;
/*
* Ensure timeline is marked as destroyed before
* changing timeline's fences status.
*/
smp_wmb();
sync_timeline_put(obj);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
erik gilling | erik gilling | 20 | 80.00% | 1 | 25.00% |
prakash kamliya | prakash kamliya | 3 | 12.00% | 1 | 25.00% |
niv yehezkel | niv yehezkel | 1 | 4.00% | 1 | 25.00% |
maarten lankhorst | maarten lankhorst | 1 | 4.00% | 1 | 25.00% |
| Total | 25 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(sync_timeline_destroy);
void sync_timeline_signal(struct sync_timeline *obj)
{
unsigned long flags;
struct fence *fence, *next;
trace_sync_timeline(obj);
spin_lock_irqsave(&obj->child_list_lock, flags);
list_for_each_entry_safe(fence, next, &obj->active_list_head,
active_list) {
if (fence_is_signaled_locked(fence))
list_del_init(&fence->active_list);
}
spin_unlock_irqrestore(&obj->child_list_lock, flags);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
erik gilling | erik gilling | 40 | 54.05% | 1 | 25.00% |
maarten lankhorst | maarten lankhorst | 28 | 37.84% | 1 | 25.00% |
gustavo padovan | gustavo padovan | 5 | 6.76% | 1 | 25.00% |
alistair strachan | alistair strachan | 1 | 1.35% | 1 | 25.00% |
| Total | 74 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(sync_timeline_signal);
struct fence *sync_pt_create(struct sync_timeline *obj, int size)
{
unsigned long flags;
struct fence *fence;
if (size < sizeof(*fence))
return NULL;
fence = kzalloc(size, GFP_KERNEL);
if (!fence)
return NULL;
spin_lock_irqsave(&obj->child_list_lock, flags);
sync_timeline_get(obj);
fence_init(fence, &android_fence_ops, &obj->child_list_lock,
obj->context, ++obj->value);
list_add_tail(&fence->child_list, &obj->child_list_head);
INIT_LIST_HEAD(&fence->active_list);
spin_unlock_irqrestore(&obj->child_list_lock, flags);
return fence;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
erik gilling | erik gilling | 62 | 49.60% | 3 | 50.00% |
maarten lankhorst | maarten lankhorst | 51 | 40.80% | 1 | 16.67% |
gustavo padovan | gustavo padovan | 11 | 8.80% | 1 | 16.67% |
ioana ciornei | ioana ciornei | 1 | 0.80% | 1 | 16.67% |
| Total | 125 | 100.00% | 6 | 100.00% |
EXPORT_SYMBOL(sync_pt_create);
static const char *android_fence_get_driver_name(struct fence *fence)
{
struct sync_timeline *parent = fence_parent(fence);
return parent->ops->driver_name;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo padovan | gustavo padovan | 19 | 63.33% | 1 | 33.33% |
erik gilling | erik gilling | 10 | 33.33% | 1 | 33.33% |
maarten lankhorst | maarten lankhorst | 1 | 3.33% | 1 | 33.33% |
| Total | 30 | 100.00% | 3 | 100.00% |
static const char *android_fence_get_timeline_name(struct fence *fence)
{
struct sync_timeline *parent = fence_parent(fence);
return parent->name;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo padovan | gustavo padovan | 27 | 96.43% | 1 | 50.00% |
maarten lankhorst | maarten lankhorst | 1 | 3.57% | 1 | 50.00% |
| Total | 28 | 100.00% | 2 | 100.00% |
static void android_fence_release(struct fence *fence)
{
struct sync_timeline *parent = fence_parent(fence);
unsigned long flags;
spin_lock_irqsave(fence->lock, flags);
list_del(&fence->child_list);
if (WARN_ON_ONCE(!list_empty(&fence->active_list)))
list_del(&fence->active_list);
spin_unlock_irqrestore(fence->lock, flags);
sync_timeline_put(parent);
fence_free(fence);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo padovan | gustavo padovan | 59 | 71.08% | 1 | 20.00% |
erik gilling | erik gilling | 14 | 16.87% | 3 | 60.00% |
maarten lankhorst | maarten lankhorst | 10 | 12.05% | 1 | 20.00% |
| Total | 83 | 100.00% | 5 | 100.00% |
static bool android_fence_signaled(struct fence *fence)
{
struct sync_timeline *parent = fence_parent(fence);
int ret;
ret = parent->ops->has_signaled(fence);
if (ret < 0)
fence->status = ret;
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo padovan | gustavo padovan | 29 | 58.00% | 1 | 33.33% |
maarten lankhorst | maarten lankhorst | 11 | 22.00% | 1 | 33.33% |
erik gilling | erik gilling | 10 | 20.00% | 1 | 33.33% |
| Total | 50 | 100.00% | 3 | 100.00% |
static bool android_fence_enable_signaling(struct fence *fence)
{
struct sync_timeline *parent = fence_parent(fence);
if (android_fence_signaled(fence))
return false;
list_add_tail(&fence->active_list, &parent->active_list_head);
return true;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo padovan | gustavo padovan | 23 | 48.94% | 2 | 33.33% |
maarten lankhorst | maarten lankhorst | 12 | 25.53% | 2 | 33.33% |
erik gilling | erik gilling | 12 | 25.53% | 2 | 33.33% |
| Total | 47 | 100.00% | 6 | 100.00% |
static void android_fence_value_str(struct fence *fence,
char *str, int size)
{
struct sync_timeline *parent = fence_parent(fence);
if (!parent->ops->fence_value_str) {
if (size)
*str = 0;
return;
}
parent->ops->fence_value_str(fence, str, size);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo padovan | gustavo padovan | 38 | 61.29% | 2 | 33.33% |
erik gilling | erik gilling | 16 | 25.81% | 2 | 33.33% |
maarten lankhorst | maarten lankhorst | 7 | 11.29% | 1 | 16.67% |
rebecca schultz zavin | rebecca schultz zavin | 1 | 1.61% | 1 | 16.67% |
| Total | 62 | 100.00% | 6 | 100.00% |
static void android_fence_timeline_value_str(struct fence *fence,
char *str, int size)
{
struct sync_timeline *parent = fence_parent(fence);
if (!parent->ops->timeline_value_str) {
if (size)
*str = 0;
return;
}
parent->ops->timeline_value_str(parent, str, size);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gustavo padovan | gustavo padovan | 42 | 67.74% | 1 | 33.33% |
erik gilling | erik gilling | 12 | 19.35% | 1 | 33.33% |
maarten lankhorst | maarten lankhorst | 8 | 12.90% | 1 | 33.33% |
| Total | 62 | 100.00% | 3 | 100.00% |
static const struct fence_ops android_fence_ops = {
.get_driver_name = android_fence_get_driver_name,
.get_timeline_name = android_fence_get_timeline_name,
.enable_signaling = android_fence_enable_signaling,
.signaled = android_fence_signaled,
.wait = fence_default_wait,
.release = android_fence_release,
.fence_value_str = android_fence_value_str,
.timeline_value_str = android_fence_timeline_value_str,
};
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
erik gilling | erik gilling | 412 | 45.93% | 6 | 37.50% |
gustavo padovan | gustavo padovan | 283 | 31.55% | 3 | 18.75% |
maarten lankhorst | maarten lankhorst | 194 | 21.63% | 2 | 12.50% |
prakash kamliya | prakash kamliya | 3 | 0.33% | 1 | 6.25% |
ioana ciornei | ioana ciornei | 2 | 0.22% | 1 | 6.25% |
niv yehezkel | niv yehezkel | 1 | 0.11% | 1 | 6.25% |
rebecca schultz zavin | rebecca schultz zavin | 1 | 0.11% | 1 | 6.25% |
alistair strachan | alistair strachan | 1 | 0.11% | 1 | 6.25% |
| Total | 897 | 100.00% | 16 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.