aco: rework boolean phi pass
[mesa.git] / include / drm-uapi / sync_file.h
1 /* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
2 /*
3 * Copyright (C) 2012 Google, Inc.
4 *
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.
9 *
10 */
11
12 #ifndef _UAPI_LINUX_SYNC_H
13 #define _UAPI_LINUX_SYNC_H
14
15 #if defined(__linux__)
16
17 #include <linux/ioctl.h>
18 #include <linux/types.h>
19
20 #else /* One of the BSDs */
21
22 #include <sys/types.h>
23 #include <sys/ioccom.h>
24
25 typedef int8_t __s8;
26 typedef uint8_t __u8;
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;
33
34 #endif
35
36 /**
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
43 */
44 struct sync_merge_data {
45 char name[32];
46 __s32 fd2;
47 __s32 fence;
48 __u32 flags;
49 __u32 pad;
50 };
51
52 /**
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
59 */
60 struct sync_fence_info {
61 char obj_name[32];
62 char driver_name[32];
63 __s32 status;
64 __u32 flags;
65 __u64 timestamp_ns;
66 };
67
68 /**
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
77 */
78 struct sync_file_info {
79 char name[32];
80 __s32 status;
81 __u32 flags;
82 __u32 num_fences;
83 __u32 pad;
84
85 __u64 sync_fence_info;
86 };
87
88 #define SYNC_IOC_MAGIC '>'
89
90 /**
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.
95 */
96
97 /**
98 * DOC: SYNC_IOC_MERGE - merge two fences
99 *
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
103 */
104 #define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
105
106 /**
107 * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
108 *
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.
113 */
114 #define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
115
116 #endif /* _UAPI_LINUX_SYNC_H */