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 **************************************************************************/
39 #include <tbm_surface.h>
47 * @brief The header file which defines Enumerations and Structures for frontend and backend.
49 * Both frontend(@ref tdm.h) and backend(@ref tdm_backend.h) header files
50 * include @ref tdm_types.h
53 * #include <tdm.h> //for a frontend user
56 * #include <tdm_backend.h> //for a vendor to implement a backend module
60 #include <tdm_common.h>
63 * @brief The transform enumeration(rotate, flip)
66 TDM_TRANSFORM_NORMAL = 0, /**< no transform */
67 TDM_TRANSFORM_90 = 1, /**< rotate 90 */
68 TDM_TRANSFORM_180 = 2, /**< rotate 180 */
69 TDM_TRANSFORM_270 = 3, /**< rotate 270 */
70 TDM_TRANSFORM_FLIPPED = 4, /**< no rotate and horizontal flip */
71 TDM_TRANSFORM_FLIPPED_90 = 5, /**< rotate 90 and horizontal flip */
72 TDM_TRANSFORM_FLIPPED_180 = 6, /**< rotate 180 and horizontal flip */
73 TDM_TRANSFORM_FLIPPED_270 = 7, /**< rotate 270 and horizontal flip */
77 * @brief The output connection status enumeration
78 * @details bit compatible with the libdrm definitions.
81 TDM_OUTPUT_TYPE_Unknown, /**< unknown */
82 TDM_OUTPUT_TYPE_VGA, /**< VGA connection */
83 TDM_OUTPUT_TYPE_DVII, /**< DVII connection */
84 TDM_OUTPUT_TYPE_DVID, /**< DVID connection */
85 TDM_OUTPUT_TYPE_DVIA, /**< DVIA connection */
86 TDM_OUTPUT_TYPE_Composite, /**< Composite connection */
87 TDM_OUTPUT_TYPE_SVIDEO, /**< SVIDEO connection */
88 TDM_OUTPUT_TYPE_LVDS, /**< LVDS connection */
89 TDM_OUTPUT_TYPE_Component, /**< Component connection */
90 TDM_OUTPUT_TYPE_9PinDIN, /**< 9PinDIN connection */
91 TDM_OUTPUT_TYPE_DisplayPort, /**< DisplayPort connection */
92 TDM_OUTPUT_TYPE_HDMIA, /**< HDMIA connection */
93 TDM_OUTPUT_TYPE_HDMIB, /**< HDMIB connection */
94 TDM_OUTPUT_TYPE_TV, /**< TV connection */
95 TDM_OUTPUT_TYPE_eDP, /**< eDP connection */
96 TDM_OUTPUT_TYPE_VIRTUAL, /**< Virtual connection for WiFi Display */
97 TDM_OUTPUT_TYPE_DSI, /**< DSI connection */
101 * @brief The layer capability enumeration
103 * A layer can have one of CURSOR, PRIMARY and OVERLAY capability. And a layer
104 * also can have one of GRAPHIC and VIDEO capability. And a layer also can have
105 * SCALE and TRANSFORM capability.\n
109 * capabilities = TDM_LAYER_CAPABILITY_PRIMARY | TDM_LAYER_CAPABILITY_GRAPHIC;
110 * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE;
111 * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_GRAPHIC | TDM_LAYER_CAPABILITY_SCALE | TDM_LAYER_CAPABILITY_TRANSFORM;
112 * capabilities = TDM_LAYER_CAPABILITY_CURSOR | TDM_LAYER_CAPABILITY_GRAPHIC;
113 * capabilities = TDM_LAYER_CAPABILITY_OVERLAY | TDM_LAYER_CAPABILITY_VIDEO;
116 * - When a video plays, in most of cases, video buffers will be displayed to
117 * a GRAPHIC layer after converting RGB buffers via PP. In this case, a backend
118 * module doesn't need to offer VIDEO layer.
119 * - But in case that s vendor wants to handle a video by their own way,
120 * a backend module offer VIDEO layers. And a display server will pass a video
121 * buffer to a VIDEO layer without converting.
124 TDM_LAYER_CAPABILITY_CURSOR = (1 << 0), /**< cursor */
125 TDM_LAYER_CAPABILITY_PRIMARY = (1 << 1), /**< primary */
126 TDM_LAYER_CAPABILITY_OVERLAY = (1 << 2), /**< overlay */
127 TDM_LAYER_CAPABILITY_GRAPHIC = (1 << 4), /**< graphic */
128 TDM_LAYER_CAPABILITY_VIDEO = (1 << 5), /**< video */
129 TDM_LAYER_CAPABILITY_SCALE = (1 << 8), /**< if a layer has scale capability */
130 TDM_LAYER_CAPABILITY_TRANSFORM = (1 << 9), /**< if a layer has transform capability */
131 TDM_LAYER_CAPABILITY_SCANOUT = (1 << 10), /**< if a layer allows a scanout buffer only */
132 TDM_LAYER_CAPABILITY_RESEVED_MEMORY = (1 << 11), /**< if a layer allows a reserved buffer only */
133 TDM_LAYER_CAPABILITY_NO_CROP = (1 << 12), /**< if a layer has no cropping capability */
134 } tdm_layer_capability;
137 * @brief The pp capability enumeration
140 TDM_PP_CAPABILITY_SYNC = (1 << 0), /**< The pp device supports synchronous operation */
141 TDM_PP_CAPABILITY_ASYNC = (1 << 1), /**< The pp device supports asynchronous operation */
142 TDM_PP_CAPABILITY_SCALE = (1 << 4), /**< The pp device supports scale operation */
143 TDM_PP_CAPABILITY_TRANSFORM = (1 << 5), /**< The pp device supports transform operation */
147 * @brief The capture capability enumeration
150 TDM_CAPTURE_CAPABILITY_OUTPUT = (1 << 0), /**< The capture device supports to dump a output */
151 TDM_CAPTURE_CAPABILITY_LAYER = (1 << 1), /**< The capture device supports to dump a layer */
152 TDM_CAPTURE_CAPABILITY_SCALE = (1 << 4), /**< The capture device supports scale operation */
153 TDM_CAPTURE_CAPABILITY_TRANSFORM = (1 << 5), /**< The capture device supports transform operation */
154 } tdm_capture_capability;
157 * @brief The output mode type enumeration
158 * @details bit compatible with the libdrm definitions.
161 TDM_OUTPUT_MODE_TYPE_BUILTIN = (1 << 0),
162 TDM_OUTPUT_MODE_TYPE_CLOCK_C = ((1 << 1) | TDM_OUTPUT_MODE_TYPE_BUILTIN),
163 TDM_OUTPUT_MODE_TYPE_CRTC_C = ((1 << 2) | TDM_OUTPUT_MODE_TYPE_BUILTIN),
164 TDM_OUTPUT_MODE_TYPE_PREFERRED = (1 << 3),
165 TDM_OUTPUT_MODE_TYPE_DEFAULT = (1 << 4),
166 TDM_OUTPUT_MODE_TYPE_USERDEF = (1 << 5),
167 TDM_OUTPUT_MODE_TYPE_DRIVER = (1 << 6),
168 } tdm_output_mode_type;
171 * @brief The output mode flag enumeration
172 * @details bit compatible with the libdrm definitions.
175 TDM_OUTPUT_MODE_FLAG_PHSYNC = (1 << 0),
176 TDM_OUTPUT_MODE_FLAG_NHSYNC = (1 << 1),
177 TDM_OUTPUT_MODE_FLAG_PVSYNC = (1 << 2),
178 TDM_OUTPUT_MODE_FLAG_NVSYNC = (1 << 3),
179 TDM_OUTPUT_MODE_FLAG_INTERLACE = (1 << 4),
180 TDM_OUTPUT_MODE_FLAG_DBLSCAN = (1 << 5),
181 TDM_OUTPUT_MODE_FLAG_CSYNC = (1 << 6),
182 TDM_OUTPUT_MODE_FLAG_PCSYNC = (1 << 7),
183 TDM_OUTPUT_MODE_FLAG_NCSYNC = (1 << 8),
184 TDM_OUTPUT_MODE_FLAG_HSKEW = (1 << 9), /* hskew provided */
185 TDM_OUTPUT_MODE_FLAG_BCAST = (1 << 10),
186 TDM_OUTPUT_MODE_FLAG_PIXMUX = (1 << 11),
187 TDM_OUTPUT_MODE_FLAG_DBLCLK = (1 << 12),
188 TDM_OUTPUT_MODE_FLAG_CLKDIV2 = (1 << 13),
189 } tdm_output_mode_flag;
192 TDM_EVENT_LOOP_READABLE = (1 << 0),
193 TDM_EVENT_LOOP_WRITABLE = (1 << 1),
194 TDM_EVENT_LOOP_HANGUP = (1 << 2),
195 TDM_EVENT_LOOP_ERROR = (1 << 3),
196 } tdm_event_loop_mask;
199 * @brief The output mode structure
201 typedef struct _tdm_output_mode {
203 unsigned int hdisplay, hsync_start, hsync_end, htotal, hskew;
204 unsigned int vdisplay, vsync_start, vsync_end, vtotal, vscan;
205 unsigned int vrefresh;
208 char name[TDM_NAME_LEN];
212 * @brief The property structure
214 typedef struct _tdm_prop {
216 char name[TDM_NAME_LEN];
220 * @brief The info config structure
222 typedef struct _tdm_info_config {
229 * @brief The layer info structre
231 typedef struct _tdm_info_layer {
232 tdm_info_config src_config;
234 tdm_transform transform;
238 * @brief The pp info structre
240 typedef struct _tdm_info_pp {
241 tdm_info_config src_config;
242 tdm_info_config dst_config;
243 tdm_transform transform;
249 * @brief The capture info structre
251 typedef struct _tdm_info_capture {
252 tdm_info_config dst_config;
253 tdm_transform transform;
260 * @brief The tdm display object
262 typedef void tdm_display;
265 * @brief The tdm output object
267 typedef void tdm_output;
270 * @brief The tdm layer object
272 typedef void tdm_layer;
275 * @brief The tdm capture object
277 typedef void tdm_capture;
280 * @brief The tdm pp object
285 * @brief The vblank handler
286 * @see output_set_vblank_handler() function of #tdm_func_display
288 typedef void (*tdm_output_vblank_handler)(tdm_output *output, unsigned int sequence,
289 unsigned int tv_sec, unsigned int tv_usec,
293 * @brief The commit handler
294 * @see output_set_commit_handler() function of #tdm_func_display
296 typedef void (*tdm_output_commit_handler)(tdm_output *output, unsigned int sequence,
297 unsigned int tv_sec, unsigned int tv_usec,
304 #endif /* _TDM_TYPES_H_ */