blob: fc25924652c1609a480857e7de2bfc7d2a314d9f [file] [log] [blame]
Lingfeng Yang1cbd16b2017-01-31 23:28:39 -08001#include <linux/sync_file.h>
2#include <linux/fence.h>
3
4/**
5 * struct sync_pt - sync_pt object
6 * @base: base fence object
7 * @child_list: sync timeline child's list
8 * @active_list: sync timeline active child's list
9 */
10struct sync_pt {
11 struct fence base;
12 struct list_head child_list;
13 struct list_head active_list;
14};
15
16/**
17 * goldfish_sync_timeline_create_internal() - creates a sync object
18 * @name: goldfish_sync_timeline name
19 *
20 * Creates a new goldfish_sync_timeline.
21 * Returns the goldfish_sync_timeline object or NULL in case of error.
22 */
23struct goldfish_sync_timeline
24*goldfish_sync_timeline_create_internal(const char *name);
25
26/**
27 * goldfish_sync_pt_create_internal() - creates a sync pt
28 * @parent: fence's parent goldfish_sync_timeline
29 * @size: size to allocate for this pt
30 * @inc: value of the fence
31 *
32 * Creates a new sync_pt as a child of @parent. @size bytes will be
33 * allocated allowing for implementation specific data to be kept after
34 * the generic sync_timeline struct. Returns the sync_pt object or
35 * NULL in case of error.
36 */
37struct sync_pt
38*goldfish_sync_pt_create_internal(struct goldfish_sync_timeline *obj,
39 int size, unsigned int value);
40
41/**
42 * goldfish_sync_timeline_signal_internal() -
43 * signal a status change on a sync_timeline
44 * @obj: goldfish_sync_timeline to signal
45 * @inc: num to increment on timeline->value
46 *
47 * A sync implementation should call this any time one of it's fences
48 * has signaled or has an error condition.
49 */
50void goldfish_sync_timeline_signal_internal(struct goldfish_sync_timeline *obj,
51 unsigned int inc);
52
53/**
54 * goldfish_sync_timeline_put_internal() - dec refcount of a sync_timeline
55 * and clean up memory if it was the last ref.
56 * @obj: goldfish_sync_timeline to decref
57 */
58void goldfish_sync_timeline_put_internal(struct goldfish_sync_timeline *obj);