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