2 * Copyright (C) 2012 Google, Inc.
4 * This program is distributed in the hope that it will be useful,
5 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7 * GNU General Public License for more details.
11 #ifndef _UAPI_LINUX_SYNC_H
12 #define _UAPI_LINUX_SYNC_H
14 #include <linux/ioctl.h>
15 #include <linux/types.h>
18 * struct sync_merge_data - data passed to merge ioctl
19 * @fd2: file descriptor of second fence
20 * @name: name of new fence
21 * @fence: returns the fd of the new fence to userspace
23 struct sync_merge_data {
24 __s32 fd2; /* fd of second fence */
25 char name[32]; /* name of new fence */
26 __s32 fence; /* fd on newly created fence */
30 * struct sync_pt_info - detailed sync_pt information
31 * @len: length of sync_pt_info including any driver_data
32 * @obj_name: name of parent sync_timeline
33 * @driver_name: name of driver implementing the parent
34 * @status: status of the sync_pt 0:active 1:signaled <0:error
35 * @timestamp_ns: timestamp of status change in nanoseconds
36 * @driver_data: any driver dependent data
49 * struct sync_fence_info_data - data returned from fence info ioctl
50 * @len: ioctl caller writes the size of the buffer its passing in.
51 * ioctl returns length of sync_fence_data returned to userspace
53 * @name: name of fence
54 * @status: status of fence. 1: signaled 0:active <0:error
55 * @pt_info: a sync_pt_info struct for every sync_pt in the fence
57 struct sync_fence_info_data {
65 #define SYNC_IOC_MAGIC '>'
68 * DOC: SYNC_IOC_WAIT - wait for a fence to signal
70 * pass timeout in milliseconds. Waits indefinitely timeout < 0.
72 #define SYNC_IOC_WAIT _IOW(SYNC_IOC_MAGIC, 0, __s32)
75 * DOC: SYNC_IOC_MERGE - merge two fences
77 * Takes a struct sync_merge_data. Creates a new fence containing copies of
78 * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the
79 * new fence's fd in sync_merge_data.fence
81 #define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 1, struct sync_merge_data)
84 * DOC: SYNC_IOC_FENCE_INFO - get detailed information on a fence
86 * Takes a struct sync_fence_info_data with extra space allocated for pt_info.
87 * Caller should write the size of the buffer into len. On return, len is
88 * updated to reflect the total size of the sync_fence_info_data including
91 * pt_info is a buffer containing sync_pt_infos for every sync_pt in the fence.
92 * To iterate over the sync_pt_infos, use the sync_pt_info.len field.
94 #define SYNC_IOC_FENCE_INFO _IOWR(SYNC_IOC_MAGIC, 2,\
95 struct sync_fence_info_data)
97 #endif /* _UAPI_LINUX_SYNC_H */