tbm_drm_helper: remove setenv usage in client side
[platform/core/uifw/libtbm.git] / src / tbm_sync.h
1 #ifndef _TBM_SYNC_H_
2 #define _TBM_SYNC_H_
3
4 #include <tbm_bufmgr.h>
5
6 /**
7  * @brief Create timeline object.
8  * @return file descriptor for the created timeline on success, -1 otherwise
9  * @remarks close the fd when you no longer need it
10  */
11 tbm_fd tbm_sync_timeline_create(void);
12
13 /**
14  * @brief Increase the current value of the timeline.
15  * @param[in] timeline timeline object
16  * @param[in] count amount of increment
17  * @return 1 on success, 0 otherwise
18  */
19 int tbm_sync_timeline_inc(tbm_fd timeline, unsigned int count);
20
21 /**
22  * @brief Create fence object.
23  * @param[in] timeline timeline object on which the fence is created
24  * @param[in] name fence name (only first 31 characters will be used)
25  * @param[in] value timeline point value for the fence
26  * @return file descriptor for the created fence on success, -1 otherwise
27  * @remarks close the fd when you no longer need it
28  */
29 tbm_fd tbm_sync_fence_create(tbm_fd timeline, const char *name, unsigned int value);
30
31 /**
32  * @brief Wait for the given fence to be signaled
33  * @param[in] fence fence object
34  * @param[in] timeout timeout in milliseconds
35  * @return 1 on success, 0 on failure, -1 on timeout expire
36  * @remarks negative timeout means infinite, timeout 0 returns immediately
37  */
38 int tbm_sync_fence_wait(tbm_fd fence, int timeout);
39
40 /**
41  * @brief Merge two fences into one
42  * @param[in] name name of the new fence
43  * @param[in] fence1 fence to be merged
44  * @param[in] fence2 fence to be merged
45  * @return file descriptor for the new fence on success, -1 otherwise
46  * @remarks close the fd when you no longer need it
47  */
48 tbm_fd tbm_sync_fence_merge(const char *name, tbm_fd fence1, tbm_fd fence2);
49
50 #endif /* _TBM_SYNC_H */