xref: /OK3568_Linux_fs/external/linux-rga/core/rga_sync.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *  Copyright 2017 The Android Open Source Project
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  */
16 
17 #ifndef __RGA_IM2D_SYNC_H__
18 #define __RGA_IM2D_SYNC_H__
19 
20 #include <stdint.h>
21 
22 /* timeout in msecs */
23 int rga_sync_wait(int fd, int timeout);
24 
25 /**
26  * Merge two sync files.
27  *
28  * This produces a new sync file with the given name which has the union of the
29  * two original sync file's fences; redundant fences may be removed.
30  *
31  * If one of the input sync files is signaled or invalid, then this function
32  * may behave like dup(): the new file descriptor refers to the valid/unsignaled
33  * sync file with its original name, rather than a new sync file.
34  *
35  * The original fences remain valid, and the caller is responsible for closing
36  * them.
37  *
38  * Available since API level 26.
39  */
40 int32_t rga_sync_merge(const char* name, int32_t fd1, int32_t fd2);
41 
42 #endif
43