Sachin Bhayare | 2b6d004 | 2018-01-13 19:38:21 +0530 | [diff] [blame] | 1 | /* 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 | |
| 20 | struct mdss_fence; |
| 21 | struct mdss_timeline; |
| 22 | |
| 23 | #if defined(CONFIG_SYNC_FILE) |
| 24 | struct mdss_timeline *mdss_create_timeline(const char *name); |
| 25 | |
| 26 | void mdss_destroy_timeline(struct mdss_timeline *tl); |
| 27 | |
| 28 | struct mdss_fence *mdss_get_sync_fence( |
| 29 | struct mdss_timeline *tl, const char *fence_name, |
| 30 | u32 *timestamp, int offset); |
| 31 | |
| 32 | void mdss_resync_timeline(struct mdss_timeline *tl); |
| 33 | |
| 34 | u32 mdss_get_timeline_commit_ts(struct mdss_timeline *tl); |
| 35 | |
| 36 | u32 mdss_get_timeline_retire_ts(struct mdss_timeline *tl); |
| 37 | |
| 38 | int mdss_inc_timeline(struct mdss_timeline *tl, int increment); |
| 39 | |
| 40 | void mdss_put_sync_fence(struct mdss_fence *fence); |
| 41 | |
| 42 | int mdss_wait_sync_fence(struct mdss_fence *fence, |
| 43 | long timeout); |
| 44 | |
| 45 | struct mdss_fence *mdss_get_fd_sync_fence(int fd); |
| 46 | |
| 47 | int mdss_get_sync_fence_fd(struct mdss_fence *fence); |
| 48 | const char *mdss_get_sync_fence_name(struct mdss_fence *fence); |
| 49 | #else |
| 50 | static inline |
| 51 | struct mdss_timeline *mdss_create_timeline(const char *name) |
| 52 | { |
| 53 | return NULL; |
| 54 | } |
| 55 | |
| 56 | static inline |
| 57 | void mdss_destroy_timeline(struct mdss_timeline *tl) |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | static inline |
| 62 | struct 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 | |
| 69 | static inline |
| 70 | void mdss_resync_timeline(struct mdss_timeline *tl) |
| 71 | { |
| 72 | } |
| 73 | |
| 74 | static inline |
| 75 | int mdss_inc_timeline(struct mdss_timeline *tl, int increment) |
| 76 | { |
| 77 | return 0; |
| 78 | } |
| 79 | |
| 80 | static inline |
| 81 | u32 mdss_get_timeline_commit_ts(struct mdss_timeline *tl) |
| 82 | { |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | static inline |
| 87 | u32 mdss_get_timeline_retire_ts(struct mdss_timeline *tl) |
| 88 | { |
| 89 | return 0; |
| 90 | } |
| 91 | |
| 92 | static inline |
| 93 | void mdss_put_sync_fence(struct mdss_fence *fence) |
| 94 | { |
| 95 | } |
| 96 | |
| 97 | static inline |
| 98 | int mdss_wait_sync_fence(struct mdss_fence *fence, |
| 99 | long timeout) |
| 100 | { |
| 101 | return 0; |
| 102 | } |
| 103 | |
| 104 | static inline |
| 105 | struct mdss_fence *mdss_get_fd_sync_fence(int fd) |
| 106 | { |
| 107 | return NULL; |
| 108 | } |
| 109 | |
| 110 | static inline |
| 111 | int mdss_get_sync_fence_fd(struct mdss_fence *fence) |
| 112 | { |
| 113 | return -EBADF; |
| 114 | } |
| 115 | const char *mdss_get_sync_fence_name(struct mdss_fence *fence) |
| 116 | { |
| 117 | return NULL; |
| 118 | } |
| 119 | } |
| 120 | #endif |
| 121 | |
| 122 | #endif /* MDSS_SYNC_H */ |