1 /**************************************************************************
5 * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
7 * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
8 * JinYoung Jeon <jy0.jeon@samsung.com>,
9 * Taeheon Kim <th908.kim@samsung.com>,
10 * YoungJun Cho <yj44.cho@samsung.com>,
11 * SooChan Lim <sc1.lim@samsung.com>,
12 * Boram Park <sc1.lim@samsung.com>
14 * Permission is hereby granted, free of charge, to any person obtaining a
15 * copy of this software and associated documentation files (the
16 * "Software"), to deal in the Software without restriction, including
17 * without limitation the rights to use, copy, modify, merge, publish,
18 * distribute, sub license, and/or sell copies of the Software, and to
19 * permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
29 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
30 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 **************************************************************************/
36 #ifndef _TDM_COMMON_H_
37 #define _TDM_COMMON_H_
45 #define TDM_NAME_LEN 64
46 #define TDM_PATH_LEN 1024
50 * @brief The header file which defines Enumerations and Structures for TDM
51 * frontend, backend and client.
55 * @brief The error enumeration
58 TDM_ERROR_NONE = 0, /**< none */
59 TDM_ERROR_BAD_REQUEST = -1, /**< bad request */
60 TDM_ERROR_OPERATION_FAILED = -2, /**< operaion failed */
61 TDM_ERROR_INVALID_PARAMETER = -3, /**< wrong input parameter */
62 TDM_ERROR_PERMISSION_DENIED = -4, /**< access denied */
63 TDM_ERROR_BUSY = -5, /**< hardware resource busy */
64 TDM_ERROR_OUT_OF_MEMORY = -6, /**< no free memory */
65 TDM_ERROR_BAD_MODULE = -7, /**< bad backend module */
66 TDM_ERROR_NOT_IMPLEMENTED = -8, /**< not implemented */
67 TDM_ERROR_NO_CAPABILITY = -9, /**< no capability */
68 TDM_ERROR_DPMS_OFF = -10, /**< dpms off */
72 * @brief The transform enumeration(rotate, flip)
75 TDM_TRANSFORM_NORMAL = 0, /**< no transform */
76 TDM_TRANSFORM_90 = 1, /**< rotate 90 */
77 TDM_TRANSFORM_180 = 2, /**< rotate 180 */
78 TDM_TRANSFORM_270 = 3, /**< rotate 270 */
79 TDM_TRANSFORM_FLIPPED = 4, /**< no rotate and horizontal flip */
80 TDM_TRANSFORM_FLIPPED_90 = 5, /**< rotate 90 and horizontal flip */
81 TDM_TRANSFORM_FLIPPED_180 = 6, /**< rotate 180 and horizontal flip */
82 TDM_TRANSFORM_FLIPPED_270 = 7, /**< rotate 270 and horizontal flip */
86 * @brief The layer capability enumeration
88 * A layer can have one of CURSOR, PRIMARY and OVERLAY capability. And a layer
89 * also can have one of GRAPHIC and VIDEO capability. And a layer also can have
90 * SCALE and TRANSFORM capability.\n
94 * capabilities = TDM_LAYER_CAPABILITY_PRIMARY | TDM_LAYER_CAPABILITY_GRAPHIC;
95 * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE;
96 * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE | TDM_LAYER_CAPABILITY_TRANSFORM;
97 * capabilities = TDM_LAYER_CAPABILITY_CURSOR | TDM_LAYER_CAPABILITY_GRAPHIC;
98 * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_VIDEO;
101 * - When a video plays, in most of cases, video buffers will be displayed to
102 * a GRAPHIC layer after converting RGB buffers via PP. In this case, a backend
103 * module doesn't need to offer VIDEO layer.
104 * - But in case that s vendor wants to handle a video by their own way,
105 * a backend module offer VIDEO layers. And a display server will pass a video
106 * buffer to a VIDEO layer without converting.
109 TDM_LAYER_CAPABILITY_CURSOR = (1 << 0), /**< cursor */
110 TDM_LAYER_CAPABILITY_PRIMARY = (1 << 1), /**< primary */
111 TDM_LAYER_CAPABILITY_OVERLAY = (1 << 2), /**< overlay */
112 TDM_LAYER_CAPABILITY_GRAPHIC = (1 << 4), /**< graphic */
113 TDM_LAYER_CAPABILITY_VIDEO = (1 << 5), /**< video */
114 TDM_LAYER_CAPABILITY_SCALE = (1 << 8), /**< if a layer has scale capability */
115 TDM_LAYER_CAPABILITY_TRANSFORM = (1 << 9), /**< if a layer has transform capability */
116 TDM_LAYER_CAPABILITY_SCANOUT = (1 << 10), /**< if a layer allows a scanout buffer only */
117 TDM_LAYER_CAPABILITY_RESEVED_MEMORY = (1 << 11), /**< if a layer allows a reserved buffer only */
118 TDM_LAYER_CAPABILITY_NO_CROP = (1 << 12), /**< if a layer has no cropping capability */
119 } tdm_layer_capability;
122 * @brief The pp capability enumeration
125 TDM_PP_CAPABILITY_SYNC = (1 << 0), /**< The pp device supports synchronous operation */
126 TDM_PP_CAPABILITY_ASYNC = (1 << 1), /**< The pp device supports asynchronous operation */
127 TDM_PP_CAPABILITY_SCALE = (1 << 4), /**< The pp device supports scale operation */
128 TDM_PP_CAPABILITY_TRANSFORM = (1 << 5), /**< The pp device supports transform operation */
132 * @brief The capture capability enumeration
135 TDM_CAPTURE_CAPABILITY_OUTPUT = (1 << 0), /**< The capture device supports to dump a output */
136 TDM_CAPTURE_CAPABILITY_LAYER = (1 << 1), /**< The capture device supports to dump a layer */
137 TDM_CAPTURE_CAPABILITY_SCALE = (1 << 4), /**< The capture device supports scale operation */
138 TDM_CAPTURE_CAPABILITY_TRANSFORM = (1 << 5), /**< The capture device supports transform operation */
139 } tdm_capture_capability;
142 * @brief The output change enumeration of #tdm_output_change_handler
145 TDM_OUTPUT_CHANGE_CONNECTION = (1 << 0), /**< connection chagne */
146 TDM_OUTPUT_CHANGE_DPMS = (1 << 1), /**< dpms change */
147 } tdm_output_change_type;
150 * @brief The output connection status enumeration
153 TDM_OUTPUT_CONN_STATUS_DISCONNECTED, /**< output disconnected */
154 TDM_OUTPUT_CONN_STATUS_CONNECTED, /**< output connected */
155 TDM_OUTPUT_CONN_STATUS_MODE_SETTED, /**< output connected and setted a mode */
156 } tdm_output_conn_status;
159 * @brief The output connection status enumeration
160 * @details bit compatible with the libdrm definitions.
163 TDM_OUTPUT_TYPE_Unknown, /**< unknown */
164 TDM_OUTPUT_TYPE_VGA, /**< VGA connection */
165 TDM_OUTPUT_TYPE_DVII, /**< DVII connection */
166 TDM_OUTPUT_TYPE_DVID, /**< DVID connection */
167 TDM_OUTPUT_TYPE_DVIA, /**< DVIA connection */
168 TDM_OUTPUT_TYPE_Composite, /**< Composite connection */
169 TDM_OUTPUT_TYPE_SVIDEO, /**< SVIDEO connection */
170 TDM_OUTPUT_TYPE_LVDS, /**< LVDS connection */
171 TDM_OUTPUT_TYPE_Component, /**< Component connection */
172 TDM_OUTPUT_TYPE_9PinDIN, /**< 9PinDIN connection */
173 TDM_OUTPUT_TYPE_DisplayPort, /**< DisplayPort connection */
174 TDM_OUTPUT_TYPE_HDMIA, /**< HDMIA connection */
175 TDM_OUTPUT_TYPE_HDMIB, /**< HDMIB connection */
176 TDM_OUTPUT_TYPE_TV, /**< TV connection */
177 TDM_OUTPUT_TYPE_eDP, /**< eDP connection */
178 TDM_OUTPUT_TYPE_VIRTUAL, /**< Virtual connection for WiFi Display */
179 TDM_OUTPUT_TYPE_DSI, /**< DSI connection */
183 * @brief The DPMS enumeration
184 * @details bit compatible with the libdrm definitions.
187 TDM_OUTPUT_DPMS_ON, /**< On */
188 TDM_OUTPUT_DPMS_STANDBY, /**< StandBy */
189 TDM_OUTPUT_DPMS_SUSPEND, /**< Suspend */
190 TDM_OUTPUT_DPMS_OFF, /**< Off */
194 * @brief The output mode type enumeration
195 * @details bit compatible with the libdrm definitions.
198 TDM_OUTPUT_MODE_TYPE_BUILTIN = (1 << 0),
199 TDM_OUTPUT_MODE_TYPE_CLOCK_C = ((1 << 1) | TDM_OUTPUT_MODE_TYPE_BUILTIN),
200 TDM_OUTPUT_MODE_TYPE_CRTC_C = ((1 << 2) | TDM_OUTPUT_MODE_TYPE_BUILTIN),
201 TDM_OUTPUT_MODE_TYPE_PREFERRED = (1 << 3),
202 TDM_OUTPUT_MODE_TYPE_DEFAULT = (1 << 4),
203 TDM_OUTPUT_MODE_TYPE_USERDEF = (1 << 5),
204 TDM_OUTPUT_MODE_TYPE_DRIVER = (1 << 6),
205 } tdm_output_mode_type;
208 * @brief The output mode flag enumeration
209 * @details bit compatible with the libdrm definitions.
212 TDM_OUTPUT_MODE_FLAG_PHSYNC = (1 << 0),
213 TDM_OUTPUT_MODE_FLAG_NHSYNC = (1 << 1),
214 TDM_OUTPUT_MODE_FLAG_PVSYNC = (1 << 2),
215 TDM_OUTPUT_MODE_FLAG_NVSYNC = (1 << 3),
216 TDM_OUTPUT_MODE_FLAG_INTERLACE = (1 << 4),
217 TDM_OUTPUT_MODE_FLAG_DBLSCAN = (1 << 5),
218 TDM_OUTPUT_MODE_FLAG_CSYNC = (1 << 6),
219 TDM_OUTPUT_MODE_FLAG_PCSYNC = (1 << 7),
220 TDM_OUTPUT_MODE_FLAG_NCSYNC = (1 << 8),
221 TDM_OUTPUT_MODE_FLAG_HSKEW = (1 << 9), /* hskew provided */
222 TDM_OUTPUT_MODE_FLAG_BCAST = (1 << 10),
223 TDM_OUTPUT_MODE_FLAG_PIXMUX = (1 << 11),
224 TDM_OUTPUT_MODE_FLAG_DBLCLK = (1 << 12),
225 TDM_OUTPUT_MODE_FLAG_CLKDIV2 = (1 << 13),
226 } tdm_output_mode_flag;
229 * @brief The size structure
231 typedef struct _tdm_size {
232 unsigned int h; /**< width */
233 unsigned int v; /**< height */
237 * @brief The pos structure
239 typedef struct _tdm_pos {
247 * @brief The value union
261 #endif /* _TDM_COMMON_H_ */