]>
Commit | Line | Data |
---|---|---|
d4cab38e GP |
1 | /* |
2 | * include/linux/sync_file.h | |
3 | * | |
4 | * Copyright (C) 2012 Google, Inc. | |
5 | * | |
6 | * This program is distributed in the hope that it will be useful, | |
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
9 | * GNU General Public License for more details. | |
10 | * | |
11 | */ | |
12 | ||
13 | #ifndef _LINUX_SYNC_FILE_H | |
14 | #define _LINUX_SYNC_FILE_H | |
15 | ||
16 | #include <linux/types.h> | |
17 | #include <linux/kref.h> | |
18 | #include <linux/ktime.h> | |
19 | #include <linux/list.h> | |
20 | #include <linux/spinlock.h> | |
21 | #include <linux/fence.h> | |
a02b9dc9 | 22 | #include <linux/fence-array.h> |
d4cab38e GP |
23 | |
24 | /** | |
25 | * struct sync_file - sync file to export to the userspace | |
26 | * @file: file representing this fence | |
27 | * @kref: reference count on fence. | |
28 | * @name: name of sync_file. Useful for debugging | |
29 | * @sync_file_list: membership in global file list | |
d4cab38e | 30 | * @wq: wait queue for fence signaling |
a02b9dc9 GP |
31 | * @fence: fence with the fences in the sync_file |
32 | * @cb: fence callback information | |
d4cab38e GP |
33 | */ |
34 | struct sync_file { | |
35 | struct file *file; | |
36 | struct kref kref; | |
37 | char name[32]; | |
38 | #ifdef CONFIG_DEBUG_FS | |
39 | struct list_head sync_file_list; | |
40 | #endif | |
d4cab38e GP |
41 | |
42 | wait_queue_head_t wq; | |
d4cab38e | 43 | |
a02b9dc9 GP |
44 | struct fence *fence; |
45 | struct fence_cb cb; | |
d4cab38e GP |
46 | }; |
47 | ||
e2416553 GP |
48 | #define POLL_ENABLED FENCE_FLAG_USER_BITS |
49 | ||
d4cab38e | 50 | struct sync_file *sync_file_create(struct fence *fence); |
972526a4 | 51 | struct fence *sync_file_get_fence(int fd); |
d4cab38e GP |
52 | |
53 | #endif /* _LINUX_SYNC_H */ |