Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: third_party/libsync/include/linux/sync.h

Issue 1754293002: third_party: Add the libsync library from Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use strlcpy from aosp Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libsync/include/linux/sw_sync.h ('k') | third_party/libsync/include/sw_sync.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google, Inc
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef _UAPI_LINUX_SYNC_H
18 #define _UAPI_LINUX_SYNC_H
19
20 #include <linux/ioctl.h>
21 #include <linux/types.h>
22
23 /**
24 * struct sync_merge_data - data passed to merge ioctl
25 * @fd2: file descriptor of second fence
26 * @name: name of new fence
27 * @fence: returns the fd of the new fence to userspace
28 */
29 struct sync_merge_data {
30 __s32 fd2; /* fd of second fence */
31 char name[32]; /* name of new fence */
32 __s32 fence; /* fd on newly created fence */
33 };
34
35 /**
36 * struct sync_pt_info - detailed sync_pt information
37 * @len: length of sync_pt_info including any driver_data
38 * @obj_name: name of parent sync_timeline
39 * @driver_name: name of driver implementing the parent
40 * @status: status of the sync_pt 0:active 1:signaled <0:error
41 * @timestamp_ns: timestamp of status change in nanoseconds
42 * @driver_data: any driver dependent data
43 */
44 struct sync_pt_info {
45 __u32 len;
46 char obj_name[32];
47 char driver_name[32];
48 __s32 status;
49 __u64 timestamp_ns;
50
51 __u8 driver_data[0];
52 };
53
54 /**
55 * struct sync_fence_info_data - data returned from fence info ioctl
56 * @len: ioctl caller writes the size of the buffer its passing in.
57 * ioctl returns length of sync_fence_data returned to userspace
58 * including pt_info.
59 * @name: name of fence
60 * @status: status of fence. 1: signaled 0:active <0:error
61 * @pt_info: a sync_pt_info struct for every sync_pt in the fence
62 */
63 struct sync_fence_info_data {
64 __u32 len;
65 char name[32];
66 __s32 status;
67
68 __u8 pt_info[0];
69 };
70
71 #define SYNC_IOC_MAGIC '>'
72
73 /**
74 * DOC: SYNC_IOC_WAIT - wait for a fence to signal
75 *
76 * pass timeout in milliseconds. Waits indefinitely timeout < 0.
77 */
78 #define SYNC_IOC_WAIT _IOW(SYNC_IOC_MAGIC, 0, __s32)
79
80 /**
81 * DOC: SYNC_IOC_MERGE - merge two fences
82 *
83 * Takes a struct sync_merge_data. Creates a new fence containing copies of
84 * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the
85 * new fence's fd in sync_merge_data.fence
86 */
87 #define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 1, struct sync_merge_data)
88
89 /**
90 * DOC: SYNC_IOC_FENCE_INFO - get detailed information on a fence
91 *
92 * Takes a struct sync_fence_info_data with extra space allocated for pt_info.
93 * Caller should write the size of the buffer into len. On return, len is
94 * updated to reflect the total size of the sync_fence_info_data including
95 * pt_info.
96 *
97 * pt_info is a buffer containing sync_pt_infos for every sync_pt in the fence.
98 * To iterate over the sync_pt_infos, use the sync_pt_info.len field.
99 */
100 #define SYNC_IOC_FENCE_INFO _IOWR(SYNC_IOC_MAGIC, 2,\
101 struct sync_fence_info_data)
102
103 #endif /* _UAPI_LINUX_SYNC_H */
OLDNEW
« no previous file with comments | « third_party/libsync/include/linux/sw_sync.h ('k') | third_party/libsync/include/sw_sync.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698