aboutsummaryrefslogtreecommitdiff
path: root/include/uapi/linux/oneshot_sync.h
blob: c55ef2f5a3491918eea6922b8bd8b42e3619388f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef ONESHOT_SYNC_H
#define ONESHOT_SYNC_H

/**
 * DOC: Oneshot sync Userspace API
 *
 * Opening a file descriptor from /dev/oneshot_sync creates a * sync timeline
 * for userspace signaled fences. Userspace may create new fences from a
 * /dev/oneshot_sync file descriptor and then signal them by passing the fence
 * file descriptor in an ioctl() call on the fd used to create the fence.
 * Unlike most sync timelines, there is no ordering on a oneshot timeline.
 * Each fence may be signaled in any order without affecting the state of other
 * fences on the timeline.
 */

#define ONESHOT_SYNC_IOC_MAGIC '1'

/**
 * struct oneshot_sync_create_fence - argument to create fence ioctl
 * @name: name of the new fence, to aid debugging.
 * @fence_fd: returned sync_fence file descriptor
 */
struct oneshot_sync_create_fence {
	char name[32];
	int fence_fd;
};

/**
 * DOC: ONESHOT_SYNC_IOC_CREATE_FENCE - create a userspace signaled fence
 *
 * Create a fence that may be signaled by userspace by calling
 * ONESHOT_SYNC_IOC_SIGNAL_FENCE. There are no order dependencies between
 * these fences, but otherwise they behave like normal sync fences.
 * Argument is struct oneshot_sync_create_fence.
 */
#define ONESHOT_SYNC_IOC_CREATE_FENCE _IOWR(ONESHOT_SYNC_IOC_MAGIC, 1,\
		struct oneshot_sync_create_fence)

/**
 * DOC: ONESHOT_SYNC_IOC_SIGNAL_FENCE - signal a fence
 *
 * Signal a fence that was created by a ONESHOT_SYNC_IOC_CREATE_FENCE
 * call on the same file descriptor. This allows a fence to be shared
 * to other processes but only signaled by the process owning the fd
 * used to create the fence.  Argument is the fence file descriptor.
 */
#define ONESHOT_SYNC_IOC_SIGNAL_FENCE _IOWR(ONESHOT_SYNC_IOC_MAGIC, 2,\
		int)
#endif