]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/uapi/linux/sync_file.h
Merge tag 'rpmsg-v4.15' of git://github.com/andersson/remoteproc
[mirror_ubuntu-bionic-kernel.git] / include / uapi / linux / sync_file.h
CommitLineData
e2be04c7 1/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
64907b94
CC
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#include <linux/ioctl.h>
16#include <linux/types.h>
17
18/**
19 * struct sync_merge_data - data passed to merge ioctl
64907b94 20 * @name: name of new fence
2d75c88f 21 * @fd2: file descriptor of second fence
64907b94 22 * @fence: returns the fd of the new fence to userspace
2d75c88f
GP
23 * @flags: merge_data flags
24 * @pad: padding for 64-bit alignment, should always be zero
64907b94
CC
25 */
26struct sync_merge_data {
a64d6a68
GP
27 char name[32];
28 __s32 fd2;
29 __s32 fence;
2d75c88f
GP
30 __u32 flags;
31 __u32 pad;
64907b94
CC
32};
33
34/**
e1786348 35 * struct sync_fence_info - detailed fence information
64907b94 36 * @obj_name: name of parent sync_timeline
a64d6a68
GP
37* @driver_name: name of driver implementing the parent
38* @status: status of the fence 0:active 1:signaled <0:error
2d75c88f 39 * @flags: fence_info flags
64907b94 40 * @timestamp_ns: timestamp of status change in nanoseconds
64907b94 41 */
e1786348 42struct sync_fence_info {
64907b94
CC
43 char obj_name[32];
44 char driver_name[32];
45 __s32 status;
2d75c88f 46 __u32 flags;
64907b94 47 __u64 timestamp_ns;
64907b94
CC
48};
49
50/**
b5b24ac5 51 * struct sync_file_info - data returned from fence info ioctl
64907b94
CC
52 * @name: name of fence
53 * @status: status of fence. 1: signaled 0:active <0:error
2d75c88f
GP
54 * @flags: sync_file_info flags
55 * @num_fences number of fences in the sync_file
56 * @pad: padding for 64-bit alignment, should always be zero
57 * @sync_fence_info: pointer to array of structs sync_fence_info with all
58 * fences in the sync_file
64907b94 59 */
b5b24ac5 60struct sync_file_info {
64907b94
CC
61 char name[32];
62 __s32 status;
2d75c88f
GP
63 __u32 flags;
64 __u32 num_fences;
65 __u32 pad;
64907b94 66
2d75c88f 67 __u64 sync_fence_info;
64907b94
CC
68};
69
70#define SYNC_IOC_MAGIC '>'
71
2d75c88f
GP
72/**
73 * Opcodes 0, 1 and 2 were burned during a API change to avoid users of the
74 * old API to get weird errors when trying to handling sync_files. The API
75 * change happened during the de-stage of the Sync Framework when there was
76 * no upstream users available.
77 */
78
64907b94
CC
79/**
80 * DOC: SYNC_IOC_MERGE - merge two fences
81 *
82 * Takes a struct sync_merge_data. Creates a new fence containing copies of
83 * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the
84 * new fence's fd in sync_merge_data.fence
85 */
2d75c88f 86#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
64907b94
CC
87
88/**
823d1bc1 89 * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
64907b94 90 *
823d1bc1
EL
91 * Takes a struct sync_file_info. If num_fences is 0, the field is updated
92 * with the actual number of fences. If num_fences is > 0, the system will
93 * use the pointer provided on sync_fence_info to return up to num_fences of
94 * struct sync_fence_info, with detailed fence information.
64907b94 95 */
2d75c88f 96#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
64907b94
CC
97
98#endif /* _UAPI_LINUX_SYNC_H */