1 /* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
3 * Copyright (C) 2012 Google, Inc.
5 * This program is distributed in the hope that it will be useful,
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 * GNU General Public License for more details.
12 #ifndef _UAPI_LINUX_SYNC_H
13 #define _UAPI_LINUX_SYNC_H
15 #if defined(__linux__)
17 #include <linux/ioctl.h>
18 #include <linux/types.h>
20 #else /* One of the BSDs */
22 #include <sys/types.h>
23 #include <sys/ioccom.h>
27 typedef int16_t __s16
;
28 typedef uint16_t __u16
;
29 typedef int32_t __s32
;
30 typedef uint32_t __u32
;
31 typedef int64_t __s64
;
32 typedef uint64_t __u64
;
37 * struct sync_merge_data - data passed to merge ioctl
38 * @name: name of new fence
39 * @fd2: file descriptor of second fence
40 * @fence: returns the fd of the new fence to userspace
41 * @flags: merge_data flags
42 * @pad: padding for 64-bit alignment, should always be zero
44 struct sync_merge_data
{
53 * struct sync_fence_info - detailed fence information
54 * @obj_name: name of parent sync_timeline
55 * @driver_name: name of driver implementing the parent
56 * @status: status of the fence 0:active 1:signaled <0:error
57 * @flags: fence_info flags
58 * @timestamp_ns: timestamp of status change in nanoseconds
60 struct sync_fence_info
{
69 * struct sync_file_info - data returned from fence info ioctl
70 * @name: name of fence
71 * @status: status of fence. 1: signaled 0:active <0:error
72 * @flags: sync_file_info flags
73 * @num_fences number of fences in the sync_file
74 * @pad: padding for 64-bit alignment, should always be zero
75 * @sync_fence_info: pointer to array of structs sync_fence_info with all
76 * fences in the sync_file
78 struct sync_file_info
{
85 __u64 sync_fence_info
;
88 #define SYNC_IOC_MAGIC '>'
91 * Opcodes 0, 1 and 2 were burned during a API change to avoid users of the
92 * old API to get weird errors when trying to handling sync_files. The API
93 * change happened during the de-stage of the Sync Framework when there was
94 * no upstream users available.
98 * DOC: SYNC_IOC_MERGE - merge two fences
100 * Takes a struct sync_merge_data. Creates a new fence containing copies of
101 * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the
102 * new fence's fd in sync_merge_data.fence
104 #define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
107 * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
109 * Takes a struct sync_file_info. If num_fences is 0, the field is updated
110 * with the actual number of fences. If num_fences is > 0, the system will
111 * use the pointer provided on sync_fence_info to return up to num_fences of
112 * struct sync_fence_info, with detailed fence information.
114 #define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
116 #endif /* _UAPI_LINUX_SYNC_H */