xref: /linux/tools/testing/selftests/sync/sw_sync.h (revision 82208160ae35ca00b5494c5c90c1a8721b15bdb1)
1*82208160SEmilio López /*
2*82208160SEmilio López  *  sw_sync abstraction
3*82208160SEmilio López  *
4*82208160SEmilio López  *  Copyright 2015-2016 Collabora Ltd.
5*82208160SEmilio López  *
6*82208160SEmilio López  *  Based on the implementation from the Android Open Source Project,
7*82208160SEmilio López  *
8*82208160SEmilio López  *  Copyright 2013 Google, Inc
9*82208160SEmilio López  *
10*82208160SEmilio López  *  Permission is hereby granted, free of charge, to any person obtaining a
11*82208160SEmilio López  *  copy of this software and associated documentation files (the "Software"),
12*82208160SEmilio López  *  to deal in the Software without restriction, including without limitation
13*82208160SEmilio López  *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14*82208160SEmilio López  *  and/or sell copies of the Software, and to permit persons to whom the
15*82208160SEmilio López  *  Software is furnished to do so, subject to the following conditions:
16*82208160SEmilio López  *
17*82208160SEmilio López  *  The above copyright notice and this permission notice shall be included in
18*82208160SEmilio López  *  all copies or substantial portions of the Software.
19*82208160SEmilio López  *
20*82208160SEmilio López  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21*82208160SEmilio López  *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22*82208160SEmilio López  *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23*82208160SEmilio López  *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24*82208160SEmilio López  *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25*82208160SEmilio López  *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26*82208160SEmilio López  *  OTHER DEALINGS IN THE SOFTWARE.
27*82208160SEmilio López  */
28*82208160SEmilio López 
29*82208160SEmilio López #ifndef SELFTESTS_SW_SYNC_H
30*82208160SEmilio López #define SELFTESTS_SW_SYNC_H
31*82208160SEmilio López 
32*82208160SEmilio López /*
33*82208160SEmilio López  * sw_sync is mainly intended for testing and should not be compiled into
34*82208160SEmilio López  * production kernels
35*82208160SEmilio López  */
36*82208160SEmilio López 
37*82208160SEmilio López int sw_sync_timeline_create(void);
38*82208160SEmilio López int sw_sync_timeline_is_valid(int fd);
39*82208160SEmilio López int sw_sync_timeline_inc(int fd, unsigned int count);
40*82208160SEmilio López void sw_sync_timeline_destroy(int fd);
41*82208160SEmilio López 
42*82208160SEmilio López int sw_sync_fence_create(int fd, const char *name, unsigned int value);
43*82208160SEmilio López int sw_sync_fence_is_valid(int fd);
44*82208160SEmilio López void sw_sync_fence_destroy(int fd);
45*82208160SEmilio López 
46*82208160SEmilio López #endif
47