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 <boram1288.park@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>
41 #include "tdm_common.h"
49 * @brief The header file which defines Enumerations and Structures for frontend and backend.
51 * Both frontend(@ref tdm.h) and backend(@ref tdm_backend.h) header files
52 * include @ref tdm_types.h
55 * #include <tdm.h> //for a frontend user
58 * #include <tdm_backend.h> //for a vendor to implement a backend module
63 TDM_EVENT_LOOP_READABLE = (1 << 0),
64 TDM_EVENT_LOOP_WRITABLE = (1 << 1),
65 TDM_EVENT_LOOP_HANGUP = (1 << 2),
66 TDM_EVENT_LOOP_ERROR = (1 << 3),
67 } tdm_event_loop_mask;
70 * @brief The display capability enumeration
73 TDM_DISPLAY_CAPABILITY_PP = (1 << 0), /**< if hardware supports pp operation */
74 TDM_DISPLAY_CAPABILITY_CAPTURE = (1 << 1), /**< if hardware supports capture operation */
75 } tdm_display_capability;
78 * @brief The output mode structure
80 typedef struct _tdm_output_mode {
82 unsigned int hdisplay, hsync_start, hsync_end, htotal, hskew;
83 unsigned int vdisplay, vsync_start, vsync_end, vtotal, vscan;
84 unsigned int vrefresh;
87 char name[TDM_NAME_LEN];
91 * @brief The property structure
93 typedef struct _tdm_prop {
95 char name[TDM_NAME_LEN];
100 * @brief The info config structure
102 typedef struct _tdm_info_config {
109 * @brief The layer info structre
111 typedef struct _tdm_info_layer {
112 tdm_info_config src_config;
114 tdm_transform transform;
118 * @brief The hwc window info structure
121 typedef struct _tdm_hwc_window_info {
122 tdm_info_config src_config;
124 tdm_transform transform;
125 } tdm_hwc_window_info;
127 typedef struct _tdm_hwc_region {
128 unsigned int num_rects;
129 tdm_pos const *rects;
133 * @brief The pp info structre
135 typedef struct _tdm_info_pp {
136 tdm_info_config src_config;
137 tdm_info_config dst_config;
138 tdm_transform transform;
144 * @brief The capture info structre
146 typedef struct _tdm_info_capture {
147 tdm_info_config dst_config;
148 tdm_transform transform;
149 tdm_capture_type type;
155 * @brief Possible composition types for a given window
160 /** Set by the client for an invisible window. The value by default.
162 * The device ignores windows of this type.
164 TDM_COMPOSITION_NONE = 0,
166 /** The client will composite this window into the client target window
168 * User can choose this type for window to avoid a hardware composition for
171 * The device must not request any composition type changes for windows of
174 TDM_COMPOSITION_CLIENT = 1,
176 /** Set by the client before tdm_output_hwc_validate().
178 * Upon tdm_output_hwc_validate(), the device may request a change from this type to
179 * TDM_COMPOSITION_DEVICE or TDM_COMPOSITION_CLIENT. */
180 TDM_COMPOSITION_DEVICE_CANDIDATE = 2,
182 /** Set by the HWC after tdm_output_hwc_validate().
184 * The device will handle the composition of this window through a hardware
185 * overlay or other similar means.
187 * Upon tdm_output_hwc_validate(), the device may request a change from this type to
188 * TDM_COMPOSITION_CLIENT or TDM_COMPOSITION_DEVICE_CANDIDATE. */
189 TDM_COMPOSITION_DEVICE = 3,
191 /** Similar to DEVICE, but the position of this layer may also be set
192 * asynchronously through layer_set_cursor_position. If this functionality is not
193 * supported on a layer that the client sets to TDM_COMPOSITION_CURSOR, the
194 * device must request that the composition type of that layer is changed to
195 * TDM_COMPOSITION_CLIENT upon the next call to tdm_output_hwc_validate().
197 * Upon tdm_output_hwc_validate(), the device may request a change from this type to
198 * either TDM_COMPOSITION_DEVICE or TDM_COMPOSITION_CLIENT. Changing to
199 * TDM_COMPOSITION_DEVICE will prevent the use of layer_set_cursor_position but
200 * still permit the device to composite the layer. */
201 TDM_COMPOSITION_CURSOR = 4,
203 /** This type is for the VIDEO window which can be set to the reserved hw overlay
204 * which is assigned by the device.
206 * Normally, this VIDEO window displays under the primary hw overlayer of the output. */
207 TDM_COMPOSITION_VIDEO = 5,
208 } tdm_hwc_window_composition;
211 * @brief The hwc window flag enumeration
215 TDM_HWC_WINDOW_FLAG_NONE = 0,
216 } tdm_hwc_window_flag;
219 * @brief The tdm display object
221 typedef void tdm_display;
224 * @brief The tdm backend object
226 typedef void tdm_module;
229 * @brief The tdm output object
231 typedef void tdm_output;
234 * @brief The tdm layer object
236 typedef void tdm_layer;
239 * @brief The tdm window object
242 typedef void tdm_hwc_window;
245 * @brief The tdm capture object
247 typedef void tdm_capture;
250 * @brief The tdm pp object
255 * @brief The tdm vblank object
257 typedef void tdm_vblank;
260 * @brief The output change handler
261 * @details This handler will be called when the status of a output object is
262 * changed in runtime.
264 typedef void (*tdm_output_change_handler)(tdm_output *output,
265 tdm_output_change_type type,
270 * @brief The vblank handler
271 * @see output_set_vblank_handler() function of #tdm_func_display
273 typedef void (*tdm_output_vblank_handler)(tdm_output *output, unsigned int sequence,
274 unsigned int tv_sec, unsigned int tv_usec,
278 * @brief The output commit handler
279 * @see output_set_commit_handler() function of #tdm_func_display
281 typedef void (*tdm_output_commit_handler)(tdm_output *output, unsigned int sequence,
282 unsigned int tv_sec, unsigned int tv_usec,
286 * @brief The layer commit handler
288 typedef void (*tdm_layer_commit_handler)(tdm_layer *layer, unsigned int sequence,
289 unsigned int tv_sec, unsigned int tv_usec,
293 * @brief The hwc_window commit handler
295 typedef void (*tdm_hwc_window_commit_handler)(tdm_hwc_window *hwc_window, unsigned int sequence,
296 unsigned int tv_sec, unsigned int tv_usec,
300 * @brief The output target_buffer commit handler
302 typedef void (*tdm_output_hwc_target_buffer_commit_handler)(tdm_output *output, unsigned int sequence,
303 unsigned int tv_sec, unsigned int tv_usec,
307 * @brief The done handler of a pp object
309 typedef void (*tdm_pp_done_handler)(tdm_pp *pp, tbm_surface_h src,
310 tbm_surface_h dst, void *user_data);
313 * @brief The done handler of a capture object
315 typedef void (*tdm_capture_done_handler)(tdm_capture *capture,
316 tbm_surface_h buffer, void *user_data);
319 * @brief The create handler of a vblank object
321 typedef void (*tdm_vblank_create_handler)(tdm_vblank *vblank, void *user_data);
324 * @brief The 'need to validate' handler of an output object
327 typedef void (*tdm_output_need_validate_handler)(tdm_output *output);
333 #endif /* _TDM_TYPES_H_ */