Commit | Line | Data |
---|---|---|
9d1906e6 EG |
1 | /* |
2 | * include/linux/sw_sync.h | |
3 | * | |
4 | * Copyright (C) 2012 Google, Inc. | |
5 | * | |
6 | * This software is licensed under the terms of the GNU General Public | |
7 | * License version 2, as published by the Free Software Foundation, and | |
8 | * may be copied, distributed, and modified under those terms. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | */ | |
16 | ||
17 | #ifndef _LINUX_SW_SYNC_H | |
18 | #define _LINUX_SW_SYNC_H | |
19 | ||
20 | #include <linux/types.h> | |
64907b94 | 21 | #include <linux/kconfig.h> |
9d1906e6 | 22 | #include "sync.h" |
64907b94 | 23 | #include "uapi/sw_sync.h" |
9d1906e6 EG |
24 | |
25 | struct sw_sync_timeline { | |
26 | struct sync_timeline obj; | |
27 | ||
28 | u32 value; | |
29 | }; | |
30 | ||
31 | struct sw_sync_pt { | |
b55b54b5 | 32 | struct fence pt; |
9d1906e6 EG |
33 | |
34 | u32 value; | |
35 | }; | |
36 | ||
bbd9ae8a | 37 | #if IS_ENABLED(CONFIG_SW_SYNC) |
9d1906e6 EG |
38 | struct sw_sync_timeline *sw_sync_timeline_create(const char *name); |
39 | void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc); | |
40 | ||
b55b54b5 | 41 | struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value); |
bbd9ae8a GH |
42 | #else |
43 | static inline struct sw_sync_timeline *sw_sync_timeline_create(const char *name) | |
44 | { | |
45 | return NULL; | |
46 | } | |
47 | ||
48 | static inline void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc) | |
49 | { | |
50 | } | |
51 | ||
b55b54b5 GP |
52 | static inline struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, |
53 | u32 value) | |
bbd9ae8a GH |
54 | { |
55 | return NULL; | |
56 | } | |
57 | #endif /* IS_ENABLED(CONFIG_SW_SYNC) */ | |
9d1906e6 | 58 | |
9d1906e6 | 59 | #endif /* _LINUX_SW_SYNC_H */ |