blob: 39a1aa7b6d429edfd719d26665006ce2a45d178c [file] [log] [blame]
Sachin Bhayare2b6d0042018-01-13 19:38:21 +05301/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef MDSS_SYNC_H
15#define MDSS_SYNC_H
16
17#include <linux/types.h>
18#include <linux/errno.h>
19
20struct mdss_fence;
21struct mdss_timeline;
22
23#if defined(CONFIG_SYNC_FILE)
24struct mdss_timeline *mdss_create_timeline(const char *name);
25
26void mdss_destroy_timeline(struct mdss_timeline *tl);
27
28struct mdss_fence *mdss_get_sync_fence(
29 struct mdss_timeline *tl, const char *fence_name,
30 u32 *timestamp, int offset);
31
32void mdss_resync_timeline(struct mdss_timeline *tl);
33
34u32 mdss_get_timeline_commit_ts(struct mdss_timeline *tl);
35
36u32 mdss_get_timeline_retire_ts(struct mdss_timeline *tl);
37
38int mdss_inc_timeline(struct mdss_timeline *tl, int increment);
39
40void mdss_put_sync_fence(struct mdss_fence *fence);
41
42int mdss_wait_sync_fence(struct mdss_fence *fence,
43 long timeout);
44
45struct mdss_fence *mdss_get_fd_sync_fence(int fd);
46
47int mdss_get_sync_fence_fd(struct mdss_fence *fence);
48const char *mdss_get_sync_fence_name(struct mdss_fence *fence);
49#else
50static inline
51struct mdss_timeline *mdss_create_timeline(const char *name)
52{
53 return NULL;
54}
55
56static inline
57void mdss_destroy_timeline(struct mdss_timeline *tl)
58{
59}
60
61static inline
62struct mdss_fence *mdss_get_sync_fence(
63 struct mdss_timeline *tl, const char *fence_name,
64 u32 *timestamp, int offset)
65{
66 return NULL;
67}
68
69static inline
70void mdss_resync_timeline(struct mdss_timeline *tl)
71{
72}
73
74static inline
75int mdss_inc_timeline(struct mdss_timeline *tl, int increment)
76{
77 return 0;
78}
79
80static inline
81u32 mdss_get_timeline_commit_ts(struct mdss_timeline *tl)
82{
83 return 0;
84}
85
86static inline
87u32 mdss_get_timeline_retire_ts(struct mdss_timeline *tl)
88{
89 return 0;
90}
91
92static inline
93void mdss_put_sync_fence(struct mdss_fence *fence)
94{
95}
96
97static inline
98int mdss_wait_sync_fence(struct mdss_fence *fence,
99 long timeout)
100{
101 return 0;
102}
103
104static inline
105struct mdss_fence *mdss_get_fd_sync_fence(int fd)
106{
107 return NULL;
108}
109
110static inline
111int mdss_get_sync_fence_fd(struct mdss_fence *fence)
112{
113 return -EBADF;
114}
115const char *mdss_get_sync_fence_name(struct mdss_fence *fence)
116{
117 return NULL;
118}
119}
120#endif
121
122#endif /* MDSS_SYNC_H */