Lines Matching defs:pt

31 static void sync_fence_signal_pt(struct sync_pt *pt);
32 static int _sync_pt_has_signaled(struct sync_pt *pt);
103 static void sync_timeline_add_pt(struct sync_timeline *obj, struct sync_pt *pt)
107 pt->parent = obj;
110 list_add_tail(&pt->child_list, &obj->child_list_head);
114 static void sync_timeline_remove_pt(struct sync_pt *pt)
116 struct sync_timeline *obj = pt->parent;
120 if (!list_empty(&pt->active_list))
121 list_del_init(&pt->active_list);
125 if (!list_empty(&pt->child_list)) {
126 list_del_init(&pt->child_list);
140 struct sync_pt *pt =
143 if (_sync_pt_has_signaled(pt)) {
145 list_add(&pt->signaled_list, &signaled_pts);
146 kref_get(&pt->fence->kref);
153 struct sync_pt *pt =
157 sync_fence_signal_pt(pt);
158 kref_put(&pt->fence->kref, sync_fence_free);
165 struct sync_pt *pt;
170 pt = kzalloc(size, GFP_KERNEL);
171 if (pt == NULL)
174 INIT_LIST_HEAD(&pt->active_list);
176 sync_timeline_add_pt(parent, pt);
178 return pt;
182 void sync_pt_free(struct sync_pt *pt)
184 if (pt->parent->ops->free_pt)
185 pt->parent->ops->free_pt(pt);
187 sync_timeline_remove_pt(pt);
189 kref_put(&pt->parent->kref, sync_timeline_free);
191 kfree(pt);
195 /* call with pt->parent->active_list_lock held */
196 static int _sync_pt_has_signaled(struct sync_pt *pt)
198 int old_status = pt->status;
200 if (!pt->status)
201 pt->status = pt->parent->ops->has_signaled(pt);
203 if (!pt->status && pt->parent->destroyed)
204 pt->status = -ENOENT;
206 if (pt->status != old_status)
207 pt->timestamp = ktime_get();
209 return pt->status;
212 static struct sync_pt *sync_pt_dup(struct sync_pt *pt)
214 return pt->parent->ops->dup(pt);
217 /* Adds a sync pt to the active queue. Called when added to a fence */
218 static void sync_pt_activate(struct sync_pt *pt)
220 struct sync_timeline *obj = pt->parent;
226 err = _sync_pt_has_signaled(pt);
230 list_add_tail(&pt->active_list, &obj->active_list_head);
283 struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt)
287 if (pt->fence)
294 pt->fence = fence;
295 list_add(&pt->pt_list, &fence->pt_list_head);
296 sync_pt_activate(pt);
376 struct sync_pt *pt = container_of(pos, struct sync_pt, pt_list);
377 sync_timeline_remove_pt(pt);
386 struct sync_pt *pt = container_of(pos, struct sync_pt, pt_list);
387 sync_pt_free(pt);
427 struct sync_pt *pt = container_of(pos, struct sync_pt, pt_list);
428 int pt_status = pt->status;
469 static void sync_fence_signal_pt(struct sync_pt *pt)
472 struct sync_fence *fence = pt->fence;
696 static int sync_fill_pt_info(struct sync_pt *pt, void *data, int size)
706 if (pt->parent->ops->fill_driver_data) {
707 ret = pt->parent->ops->fill_driver_data(pt, info->driver_data,
715 strlcpy(info->obj_name, pt->parent->name, sizeof(info->obj_name));
716 strlcpy(info->driver_name, pt->parent->ops->driver_name,
718 info->status = pt->status;
719 info->timestamp_ns = ktime_to_ns(pt->timestamp);
751 struct sync_pt *pt =
754 ret = sync_fill_pt_info(pt, (u8 *)data + len, size - len);
805 static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence)
807 int status = pt->status;
809 fence ? pt->parent->name : "",
812 if (pt->status) {
813 struct timeval tv = ktime_to_timeval(pt->timestamp);
817 if (pt->parent->ops->print_pt) {
819 pt->parent->ops->print_pt(s, pt);
841 struct sync_pt *pt =
843 sync_print_pt(s, pt, false);
857 struct sync_pt *pt =
859 sync_print_pt(s, pt, true);