Lines Matching defs:obj

80 	struct sync_timeline *obj;
82 obj = kzalloc(sizeof(*obj), GFP_KERNEL);
83 if (!obj)
86 kref_init(&obj->kref);
87 obj->context = dma_fence_context_alloc(1);
88 strscpy(obj->name, name, sizeof(obj->name));
90 obj->pt_tree = RB_ROOT;
91 INIT_LIST_HEAD(&obj->pt_list);
92 spin_lock_init(&obj->lock);
94 sync_timeline_debug_add(obj);
96 return obj;
101 struct sync_timeline *obj =
104 sync_timeline_debug_remove(obj);
106 kfree(obj);
109 static void sync_timeline_get(struct sync_timeline *obj)
111 kref_get(&obj->kref);
114 static void sync_timeline_put(struct sync_timeline *obj)
116 kref_put(&obj->kref, sync_timeline_free);
186 * @obj: sync_timeline to signal
192 static void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc)
197 trace_sync_timeline(obj);
199 spin_lock_irq(&obj->lock);
201 obj->value += inc;
203 list_for_each_entry_safe(pt, next, &obj->pt_list, link) {
210 rb_erase(&pt->node, &obj->pt_tree);
215 spin_unlock_irq(&obj->lock);
225 * @obj: parent sync_timeline
233 static struct sync_pt *sync_pt_create(struct sync_timeline *obj,
242 sync_timeline_get(obj);
243 dma_fence_init(&pt->base, &timeline_fence_ops, &obj->lock,
244 obj->context, value);
247 spin_lock_irq(&obj->lock);
249 struct rb_node **p = &obj->pt_tree.rb_node;
265 sync_timeline_put(obj);
274 rb_insert_color(&pt->node, &obj->pt_tree);
278 parent ? &rb_entry(parent, typeof(*pt), node)->link : &obj->pt_list);
281 spin_unlock_irq(&obj->lock);
292 /* opening sw_sync create a new sync obj */
295 struct sync_timeline *obj;
300 obj = sync_timeline_create(task_comm);
301 if (!obj)
304 file->private_data = obj;
311 struct sync_timeline *obj = file->private_data;
314 spin_lock_irq(&obj->lock);
316 list_for_each_entry_safe(pt, next, &obj->pt_list, link) {
321 spin_unlock_irq(&obj->lock);
323 sync_timeline_put(obj);
327 static long sw_sync_ioctl_create_fence(struct sync_timeline *obj,
344 pt = sync_pt_create(obj, data.value);
373 static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg)
381 sync_timeline_signal(obj, INT_MAX);
385 sync_timeline_signal(obj, value);
393 struct sync_timeline *obj = file->private_data;
397 return sw_sync_ioctl_create_fence(obj, arg);
400 return sw_sync_ioctl_inc(obj, arg);