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 **************************************************************************/
40 #include <sys/types.h>
41 #include <tbm_surface.h>
42 #include <tbm_surface_queue.h>
43 #include <tbm_surface_internal.h>
45 #include "tdm_types.h"
46 #include "tdm_deprecated.h"
54 * @brief The header file for a frontend user.
57 * #include <tdm.h> //for a frontend user
62 * @brief Initialize a display object
63 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
64 * @return A display object
65 * @see tdm_display_deinit
68 tdm_display_init(tdm_error *error);
71 * @brief Deinitialize a display object
72 * @param[in] dpy A display object
73 * @see tdm_display_init
76 tdm_display_deinit(tdm_display *dpy);
79 * @brief Get the file descriptor
80 * @details TDM handles the events of fd with #tdm_display_handle_events.
81 * @param[in] dpy A display object
82 * @param[out] fd The file descriptor
83 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
84 * @see tdm_display_handle_events
87 tdm_display_get_fd(tdm_display *dpy, int *fd);
90 * @brief Handle the events
91 * @param[in] dpy A display object
92 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
93 * @see tdm_display_get_fd
96 tdm_display_handle_events(tdm_display *dpy);
99 * @brief Flush the all events to clients
100 * @param[in] dpy A display object
103 tdm_display_flush(tdm_display *dpy);
106 * @brief Get the capabilities of a display object.
107 * @details A frontend user can get whether TDM supports pp/capture functionality with this function.
108 * @param[in] dpy A display object
109 * @param[out] capabilities The capabilities of a display object
110 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
113 tdm_display_get_capabilities(tdm_display *dpy,
114 tdm_display_capability *capabilities);
117 * @brief Get the pp capabilities of a display object.
118 * @param[in] dpy A display object
119 * @param[out] capabilities The pp capabilities
120 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
123 tdm_display_get_pp_capabilities(tdm_display *dpy,
124 tdm_pp_capability *capabilities);
127 * @brief Get the pp available format array of a display object.
128 * @param[in] dpy A display object
129 * @param[out] formats The pp available format array
130 * @param[out] count The count of formats
131 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
134 tdm_display_get_pp_available_formats(tdm_display *dpy,
135 const tbm_format **formats, int *count);
138 * @brief Get the pp available size of a display object.
139 * @details -1 means that a TDM backend module doesn't define the value.
140 * @param[in] dpy A display object
141 * @param[out] min_w The minimum width which TDM can handle
142 * @param[out] min_h The minimum height which TDM can handle
143 * @param[out] max_w The maximum width which TDM can handle
144 * @param[out] max_h The maximum height which TDM can handle
145 * @param[out] preferred_align The preferred align width which TDM can handle
146 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
149 tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h,
150 int *max_w, int *max_h, int *preferred_align);
153 * @brief Get the capture capabilities of a display object.
154 * @param[in] dpy A display object
155 * @param[out] capabilities The capture capabilities
156 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
159 tdm_display_get_capture_capabilities(tdm_display *dpy,
160 tdm_capture_capability *capabilities);
163 * @brief Get the capture available format array of a display object.
164 * @param[in] dpy A display object
165 * @param[out] formats The capture available format array
166 * @param[out] count The count of formats
167 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
170 tdm_display_get_capture_available_formats(tdm_display *dpy,
171 const tbm_format **formats, int *count);
174 * @brief Get the capture available size of a display object.
175 * @details -1 means that a TDM backend module doesn't define the value.
176 * @param[in] dpy A display object
177 * @param[out] min_w The minimum width which TDM can handle
178 * @param[out] min_h The minimum height which TDM can handle
179 * @param[out] max_w The maximum width which TDM can handle
180 * @param[out] max_h The maximum height which TDM can handle
181 * @param[out] preferred_align The preferred align width which TDM can handle
182 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
185 tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h,
186 int *max_w, int *max_h, int *preferred_align);
189 * @brief Get the output counts which a display object has.
190 * @param[in] dpy A display object
191 * @param[out] count The count of outputs
192 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
193 * @see tdm_display_get_output
196 tdm_display_get_output_count(tdm_display *dpy, int *count);
199 * @brief Get a output object which has the given index.
200 * @param[in] dpy A display object
201 * @param[in] index The index of a output object
202 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
203 * @return A output object if success. Otherwise, NULL.
204 * @see tdm_display_get_output_count
207 tdm_display_get_output(tdm_display *dpy, int index, tdm_error *error);
210 * @brief Add a output create handler
211 * @param[in] output A output object
212 * @param[in] func A output create handler
213 * @param[in] user_data The user data
214 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
217 tdm_display_add_output_create_handler(tdm_display *dpy,
218 tdm_output_create_handler func,
222 * @brief Remove a output create handler
223 * @param[in] output A output object
224 * @param[in] func A output create handler
225 * @param[in] user_data The user data
226 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
229 tdm_display_remove_output_create_handler(tdm_display *dpy,
230 tdm_output_create_handler func,
234 * @brief Find a output object which has the given name.
235 * @param[in] dpy A display object
236 * @param[in] name The name of a output object
237 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
238 * @return A output object if success. Otherwise, NULL.
241 tdm_display_find_output(tdm_display *dpy, const char *name, tdm_error *error);
244 * @brief Create a pp object.
245 * @param[in] dpy A display object
246 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
247 * @return A pp object if success. Otherwise, NULL.
248 * @see tdm_pp_destroy
251 tdm_display_create_pp(tdm_display *dpy, tdm_error *error);
254 * @brief Get the information of the TDM backend module.
255 * @param[in] module A backend module object
256 * @param[out] name The name of the TDM backend module
257 * @param[out] vendor The vendor of the TDM backend module
258 * @param[out] version The version of the TDM backend module
259 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
262 tdm_module_get_info(tdm_module *module, const char **name,
263 const char **vendor, int *major, int *minor);
266 * @brief Add a output destroy handler
267 * @param[in] output A output object
268 * @param[in] func A output destroy handler
269 * @param[in] user_data The user data
270 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
273 tdm_output_add_destroy_handler(tdm_output *output,
274 tdm_output_destroy_handler func,
278 * @brief Remove a output destroy handler
279 * @param[in] output A output object
280 * @param[in] func A output destroy handler
281 * @param[in] user_data The user data
282 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
285 tdm_output_remove_destroy_handler(tdm_output *output,
286 tdm_output_destroy_handler func,
290 * @brief Get a backend module object of the given output.
291 * @param[in] output A output object
292 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
293 * @return A backend object if success. Otherwise, NULL.
296 tdm_output_get_backend_module(tdm_output *output, tdm_error *error);
299 * @brief Get the capabilities of a output object.
300 * @param[in] output A output object
301 * @param[out] capabilities The capabilities of a output object
302 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
305 tdm_output_get_capabilities(tdm_output *output,
306 tdm_output_capability *capabilities);
309 * @brief Get the model information of a output object.
310 * @param[in] output A output object
311 * @param[out] maker The output maker.
312 * @param[out] model The output model.
313 * @param[out] name The output name.
314 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
317 tdm_output_get_model_info(tdm_output *output, const char **maker,
318 const char **model, const char **name);
321 * @brief Get the connection status of a output object.
322 * @param[in] output A output object
323 * @param[out] status The connection status.
324 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
327 tdm_output_get_conn_status(tdm_output *output, tdm_output_conn_status *status);
330 * @brief Add a output change handler
331 * @details The handler will be called when the status of a
332 * output object is changed. connection, DPMS, etc.
333 * @param[in] output A output object
334 * @param[in] func A output change handler
335 * @param[in] user_data The user data
336 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
339 tdm_output_add_change_handler(tdm_output *output,
340 tdm_output_change_handler func,
344 * @brief Remove a output change handler
345 * @param[in] output A output object
346 * @param[in] func A output change handler
347 * @param[in] user_data The user data
348 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
351 tdm_output_remove_change_handler(tdm_output *output,
352 tdm_output_change_handler func,
356 * @brief Add a output mode change handler
357 * @param[in] output A output object
358 * @param[in] func A output mode change handler
359 * @param[in] user_data The user data
360 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
363 tdm_output_add_mode_change_request_handler(tdm_output *output,
364 tdm_output_mode_change_request_handler func,
368 * @brief Remove a output mode change handler
369 * @param[in] output A output object
370 * @param[in] func A output mode change handler
371 * @param[in] user_data The user data
372 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
375 tdm_output_remove_mode_change_request_handler(tdm_output *output,
376 tdm_output_mode_change_request_handler func,
380 * @brief Get the connection type of a output object.
381 * @param[in] output A output object
382 * @param[out] type The connection type.
383 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
386 tdm_output_get_output_type(tdm_output *output, tdm_output_type *type);
389 * @brief Get the layer counts which a output object has.
390 * @param[in] output A output object
391 * @param[out] count The count of layers
392 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
393 * @see tdm_output_get_layer
396 tdm_output_get_layer_count(tdm_output *output, int *count);
399 * @brief Get a layer object which has the given index.
400 * @param[in] output A output object
401 * @param[in] index The index of a layer object
402 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
403 * @return A layer object if success. Otherwise, NULL.
404 * @see tdm_output_get_layer_count
407 tdm_output_get_layer(tdm_output *output, int index, tdm_error *error);
410 * @brief Get the available property array of a output object.
411 * @param[in] output A output object
412 * @param[out] props The available property array
413 * @param[out] count The count of properties
414 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
417 tdm_output_get_available_properties(tdm_output *output, const tdm_prop **props,
421 * @brief Get the available mode array of a output object.
422 * @param[in] output A output object
423 * @param[out] modes The available mode array
424 * @param[out] count The count of modes
425 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
428 tdm_output_get_available_modes(tdm_output *output,
429 const tdm_output_mode **modes, int *count);
432 * @brief Get the available size of a output object.
433 * @details -1 means that a TDM backend module doesn't define the value.
434 * @param[in] output A output object
435 * @param[out] min_w The minimum width which TDM can handle
436 * @param[out] min_h The minimum height which TDM can handle
437 * @param[out] max_w The maximum width which TDM can handle
438 * @param[out] max_h The maximum height which TDM can handle
439 * @param[out] preferred_align The preferred align width which TDM can handle
440 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
443 tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h,
444 int *max_w, int *max_h, int *preferred_align);
447 * @brief Get the available cursor size of a output object.
448 * @details -1 means that a TDM backend module doesn't define the value.
449 * @param[in] output A output object
450 * @param[out] min_w The minimum width which TDM can handle
451 * @param[out] min_h The minimum height which TDM can handle
452 * @param[out] max_w The maximum width which TDM can handle
453 * @param[out] max_h The maximum height which TDM can handle
454 * @param[out] preferred_align The preferred align width which TDM can handle
455 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
458 tdm_output_get_cursor_available_size(tdm_output *output, int *min_w, int *min_h,
459 int *max_w, int *max_h, int *preferred_align);
462 * @brief Get the physical size of a output object.
463 * @param[in] output A output object
464 * @param[out] mmWidth The milimeter width
465 * @param[out] mmHeight The milimeter height
466 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
469 tdm_output_get_physical_size(tdm_output *output, unsigned int *mmWidth,
470 unsigned int *mmHeight);
473 * @brief Get the subpixel of a output object.
474 * @param[in] output A output object
475 * @param[out] subpixel The subpixel
476 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
479 tdm_output_get_subpixel(tdm_output *output, unsigned int *subpixel);
482 * @brief Get the pipe of a output object.
483 * @param[in] output A output object
484 * @param[out] pipe The pipe
485 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
488 tdm_output_get_pipe(tdm_output *output, unsigned int *pipe);
491 * @brief Get the index of a primary layer.
492 * @param[in] output A output object
493 * @param[out] index The primary layer index
494 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
497 tdm_output_get_primary_index(tdm_output *output, int *index);
500 * @brief Set the property which has a given id.
501 * @param[in] output A output object
502 * @param[in] id The property id
503 * @param[in] value The value
504 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
507 tdm_output_set_property(tdm_output *output, unsigned int id, tdm_value value);
510 * @brief Get the property which has a given id
511 * @param[in] output A output object
512 * @param[in] id The property id
513 * @param[out] value The value
514 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
517 tdm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value);
520 * @brief Wait for VBLANK
521 * @details After interval vblanks, a user vblank handler will be called.
522 * @param[in] output A output object
523 * @param[in] interval vblank interval
524 * @param[in] sync 0: asynchronous, 1:synchronous
525 * @param[in] func A user vblank handler
526 * @param[in] user_data The user data
527 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
528 * @see #tdm_output_vblank_handler
531 tdm_output_wait_vblank(tdm_output *output, int interval, int sync,
532 tdm_output_vblank_handler func, void *user_data);
535 * @brief Commit changes for a output object
536 * @details After all change of a output object are applied, a user commit handler
538 * @param[in] output A output object
539 * @param[in] sync 0: asynchronous, 1:synchronous
540 * @param[in] func A user commit handler
541 * @param[in] user_data The user data
542 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
543 * @see #tdm_layer_commit
546 tdm_output_commit(tdm_output *output, int sync, tdm_output_commit_handler func,
550 * @brief Remove the user vblank handler
551 * @param[in] output A output object
552 * @param[in] func A user vblank handler
553 * @param[in] user_data The user data
554 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
557 tdm_output_remove_vblank_handler(tdm_output *output, tdm_output_vblank_handler func, void *user_data);
560 * @brief Remove the user commit handler
561 * @param[in] output A output object
562 * @param[in] func A user commit handler
563 * @param[in] user_data The user data
564 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
567 tdm_output_remove_commit_handler(tdm_output *output, tdm_output_commit_handler func, void *user_data);
570 * @brief Set one of available modes of a output object
571 * @param[in] output A output object
572 * @param[in] mode A output mode
573 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
576 tdm_output_set_mode(tdm_output *output, const tdm_output_mode *mode);
579 * @brief Get the mode of a output object
580 * @param[in] output A output object
581 * @param[out] mode A output mode
582 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
585 tdm_output_get_mode(tdm_output *output, const tdm_output_mode **mode);
588 * @brief Set DPMS of a output object synchronously
589 * @param[in] output A output object
590 * @param[in] dpms_value DPMS value
591 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
592 * @see tdm_output_set_dpms_async
595 tdm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value);
598 * @brief Set DPMS of a output object asynchronously
599 * @details This function can be used when a output supports the asynchronous DPMS
600 * control. The output has #TDM_OUTPUT_CAPABILITY_ASYNC_DPMS flags which
601 * #tdm_output_get_capabilities returns. If an output change handler is added with
602 * #tdm_output_add_change_handler, the output change handler will be called when
603 * the DPMS status is changed indeed.
604 * @param[in] output A output object
605 * @param[in] dpms_value DPMS value
606 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
607 * @see tdm_output_add_change_handler, tdm_output_set_dpms,
608 * tdm_output_get_capabilities, #TDM_OUTPUT_CAPABILITY_ASYNC_DPMS.
611 tdm_output_set_dpms_async(tdm_output *output, tdm_output_dpms dpms_value);
614 * @brief Get DPMS of a output object
615 * @param[in] output A output object
616 * @param[out] dpms_value DPMS value
617 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
620 tdm_output_get_dpms(tdm_output *output, tdm_output_dpms *dpms_value);
623 * @brief Check if a output object has the capture capability
624 * @param[in] output A output object
625 * @param[out] has_capability 1: has the capability, 0: not has the capability
626 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
629 tdm_output_has_capture_capability(tdm_output *output, unsigned int *has_capability);
632 * @brief Create a capture object of a output object
633 * @param[in] output A output object
634 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
635 * @return A capture object
636 * @see tdm_capture_destroy
639 tdm_output_create_capture(tdm_output *output, tdm_error *error);
642 * @brief Get a hwc associated with a output object.
643 * @param[in] output A output object
644 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
645 * @return A hwc object
649 tdm_output_get_hwc(tdm_output *output, tdm_error *error);
652 * @brief Get a output object of a layer object
653 * @param[in] layer A layer object
654 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
655 * @return A TDM output object if success. Otherwise, NULL.
658 tdm_layer_get_output(tdm_layer *layer, tdm_error *error);
661 * @brief Get the index of a layer object.
662 * @param[in] layer A layer object
663 * @param[out] index The index of a layer object
664 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
667 tdm_layer_get_index(tdm_layer *layer, int *index);
670 * @brief Get the capabilities of a layer object.
671 * @param[in] layer A layer object
672 * @param[out] capabilities The capabilities of a layer object
673 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
676 tdm_layer_get_capabilities(tdm_layer *layer,
677 tdm_layer_capability *capabilities);
680 * @brief Get the available format array of a layer object.
681 * @param[in] layer A layer object
682 * @param[out] formats The available format array
683 * @param[out] count The count of formats
684 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
687 tdm_layer_get_available_formats(tdm_layer *layer, const tbm_format **formats,
691 * @brief Get the available property array of a layer object.
692 * @param[in] layer A layer object
693 * @param[out] props The available property array
694 * @param[out] count The count of properties
695 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
698 tdm_layer_get_available_properties(tdm_layer *layer, const tdm_prop **props,
702 * @brief Get the zpos of a layer object.
704 * - GRAPHIC layers have fixed zpos. It starts from 0. It's @b non-changeable.
705 * - But the zpos of VIDEO layers will be decided by a backend module side.
706 * - A frontend user only can set the relative zpos to VIDEO layers via #tdm_layer_set_video_pos
707 * - The zpos of video layers is less than GRAPHIC layers or more than GRAPHIC
708 * layers. ie, ..., -2, -1, 4, 5, ... (if 0 <= GRAPHIC layer's zpos < 4).
709 * -------------------------------- graphic layer 3 <-- top most layer
710 * -------------------------------- graphic layer 2
711 * -------------------------------- graphic layer 1
712 * -------------------------------- graphic layer 0
713 * -------------------------------- video layer -1
714 * -------------------------------- video layer -2 <-- lowest layer
715 * @param[in] layer A layer object
716 * @param[out] zpos The zpos
717 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
718 * @see tdm_layer_set_video_pos, tdm_layer_capability
721 tdm_layer_get_zpos(tdm_layer *layer, int *zpos);
724 * @brief Set the property which has a given id.
725 * @param[in] layer A layer object
726 * @param[in] id The property id
727 * @param[in] value The value
728 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
731 tdm_layer_set_property(tdm_layer *layer, unsigned int id, tdm_value value);
734 * @brief Get the property which has a given id.
735 * @param[in] layer A layer object
736 * @param[in] id The property id
737 * @param[out] value The value
738 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
741 tdm_layer_get_property(tdm_layer *layer, unsigned int id, tdm_value *value);
744 * @brief Set the geometry information to a layer object
745 * @details The geometry information will be applied when the output object
746 * of a layer object is committed. If a layer has TDM_LAYER_CAPABILITY_NO_CROP
747 * capability, a layer will ignore the pos(crop) information of #tdm_info_layer's
749 * @param[in] layer A layer object
750 * @param[in] info The geometry information
751 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
752 * @see tdm_layer_commit
755 tdm_layer_set_info(tdm_layer *layer, tdm_info_layer *info);
758 * @brief Get the geometry information to a layer object
759 * @param[in] layer A layer object
760 * @param[out] info The geometry information
761 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
764 tdm_layer_get_info(tdm_layer *layer, tdm_info_layer *info);
767 * @brief Set a TDM buffer to a layer object
768 * @details A TDM buffer will be applied when the output object
769 * of a layer object is committed.
770 * @param[in] layer A layer object
771 * @param[in] buffer A TDM buffer
772 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
773 * @see tdm_layer_commit
776 tdm_layer_set_buffer(tdm_layer *layer, tbm_surface_h buffer);
779 * @brief Unset a TDM buffer from a layer object
780 * @details When this function is called, a current showing buffer will be
781 * disappeared from screen. Then nothing is showing on a layer object.
782 * @param[in] layer A layer object
783 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
786 tdm_layer_unset_buffer(tdm_layer *layer);
789 * @brief Commit changes for a layer object
790 * @details After all change of a layer object are applied, a user commit handler
792 * @param[in] layer A layer object
793 * @param[in] func A user commit handler
794 * @param[in] user_data The user data
795 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
798 tdm_layer_commit(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data);
801 tdm_layer_is_committing(tdm_layer *layer, unsigned int *committing);
804 * @brief Remove the user commit handler
805 * @param[in] layer A layer object
806 * @param[in] func A user commit handler
807 * @param[in] user_data The user data
808 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
811 tdm_layer_remove_commit_handler(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data);
814 * @brief Get a displaying TDM buffer from a layer object
815 * @details A displaying TDM buffer is a current showing buffer on screen
816 * that is set to layer object and applied output object of a layer object.
817 * @param[in] layer A layer object
818 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
819 * @return A TDM buffer if success. Otherwise, NULL.
822 tdm_layer_get_displaying_buffer(tdm_layer *layer, tdm_error *error);
825 * @brief Set a TBM surface_queue to a layer object
826 * @details A TBM surface_queue will be applied when the output object
827 * of a layer object is committed. and TDM layer will be automatically updated
828 * @param[in] layer A layer object
829 * @param[in] buffer_queue A TBM surface_queue
830 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
831 * @see tdm_layer_commit
834 tdm_layer_set_buffer_queue(tdm_layer *layer, tbm_surface_queue_h buffer_queue);
837 * @brief Unset a TBM surface_queue from a layer object
838 * @details When this function is called, a current surface_queue will be
839 * disappeared from screen. Then nothing is showing on a layer object.
840 * @param[in] layer A layer object
841 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
844 tdm_layer_unset_buffer_queue(tdm_layer *layer);
847 * @brief Check wheter a layer object is available for a frontend user to use.
848 * @details A layer object is not usable if a TDM buffer is showing on screen
849 * via this layer object. By calling #tdm_layer_unset_buffer, this layer object
850 * will become usable.
851 * @param[in] layer A layer object
852 * @param[out] usable 1 if usable, 0 if not usable
853 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
856 tdm_layer_is_usable(tdm_layer *layer, unsigned int *usable);
859 * @brief Set the relative zpos to a VIDEO layer object
860 * @details The zpos value is less than the minimum zpos of GRAPHIC layers, or
861 * it is more than the maximum zpos of GRAPHIC layers.
862 * @param[in] layer A VIDEO layer object
863 * @param[in] zpos The zpos
864 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
865 * @see tdm_layer_get_zpos, tdm_layer_capability
868 tdm_layer_set_video_pos(tdm_layer *layer, int zpos);
871 * @brief Create a capture object of a layer object
872 * @param[in] layer A layer object
873 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
874 * @return A capture object
875 * @see tdm_capture_destroy
878 tdm_layer_create_capture(tdm_layer *layer, tdm_error *error);
881 * @brief Get buffer flags from a layer object
882 * @param[in] layer A layer object
883 * @param[out] flags a buffer flags value
884 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
887 tdm_layer_get_buffer_flags(tdm_layer *layer, unsigned int *flags);
890 * @brief Creates a new window on the given hwc.
891 * @param[in] hwc A hwc object
892 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
893 * @return A created window object
897 tdm_hwc_create_window(tdm_hwc *hwc, tdm_error *error);
900 * @brief Get the video supported format array for hwc windows of a output object.
901 * @param[in] hwc A hwc object
902 * @param[out] formats The available format array
903 * @param[out] count The count of formats
904 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
907 tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats,
911 * @brief Get the hwc video capability
912 * @param[in] hwc A hwc object
913 * @param[out] video_capability A hwc video capability
914 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
917 tdm_hwc_get_video_capability(tdm_hwc *hwc, tdm_hwc_video_capability *video_capability);
920 * @brief Get the available property array of a hwc object.
921 * @param[in] hwc A hwc
922 * @param[out] props The available property array
923 * @param[out] count The count of properties
924 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
927 tdm_hwc_get_available_properties(tdm_hwc *hwc, const tdm_prop **props, int *count);
930 * @brief Get a target buffer queue
931 * @details The client composites the tdm_hwd_windows which have
932 * TDM_COMPOSITE_CLIENT types on the buffer from this target buffer queue.
933 * Then, the client set the buffer by calling tdm_hwc_set_client_target_buffer.
934 * @param[in] output A output object
935 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
936 * @return A buffer queue
940 tdm_hwc_get_client_target_buffer_queue(tdm_hwc *hwc, tdm_error *error);
943 * @brief Set the client(relative to the TDM) target buffer
944 * @details This function lets the backend know the target buffer.
945 * The target buffer contains the result of the gl composition with the
946 * tdm_hwc_windows which marked as TDM_COMPOSITION_CLIENT.
947 * @param[in] hwc A output hwc
948 * @param[in] target_buffer The new target buffer
949 * @param[in] damage The buffer damage region
950 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
954 tdm_hwc_set_client_target_buffer(tdm_hwc *hwc, tbm_surface_h target_buffer, tdm_region damage);
957 * @brief Validate the output
958 * @details Instructs the backend to inspect all of the hw layer state and
959 * determine if there are any composition type changes necessary before
960 * presenting the hwc.
961 * @param[in] hwc A hwc object
962 * @param[in] composited_wnds the hwc window list which is visible.
963 * @param[in] num_wnds the number of the visible windows in the composited_wnds
964 * @param[out] num_types The number of composition type changes
965 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
967 * The backend has to return the num_types when the assgined comopsite types of
968 * the tdm_hwc_windows in the composited_wnds. If the num_types is greater than
969 * 0, the cleint must get the changed composite types of the tdm_hwc_windows
970 * and change the comopsite types
974 tdm_hwc_validate(tdm_hwc *hwc, tdm_hwc_window **composited_wnds, uint32_t num_wnds,
975 uint32_t *num_types);
978 * @brief Get changed composition types
979 * @details Retrieves the windows for which the backend requires a different
980 * composition types that had been set prior to the last call to tdm_hwc_validate().
981 * The client will either update its state with these types and call
982 * tdm_hwc_accept_changes, or will set new types and attempt to validate the
983 * display again. The number of elements returned must be the same as the
984 * value returned in num_types from the last call to tdm_hwc_validate().
985 * @param[in] hwc A hwc object
986 * @param[out] num_elements the number of hwc_windows
987 * @param[out] windows An array of windows
988 * @param[out] composition_types An array of composition types, each corresponding
989 * to an element of windows
990 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
995 tdm_hwc_get_changed_composition_types(tdm_hwc *hwc, uint32_t *num_elements,
996 tdm_hwc_window **hwc_window,
997 tdm_hwc_window_composition *composition_types);
1000 * @brief Accepts the changes required by the backend
1001 * @details Accepts the changes required by the backend from the previous
1002 * tdm_hwc_validate() and tdm_hwc_get_chaged_composition_types().
1003 * @param[in] hwc A hwc object
1004 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1008 tdm_hwc_accept_changes(tdm_hwc *hwc);
1011 * @brief Commit changes for a hwc
1012 * @details After all change of a window object are applied, a user commit handler
1014 * @param[in] hwc A hwc object
1015 * @param[in] sync 0: asynchronous, 1:synchronous
1016 * @param[in] func A user commit handler
1017 * @param[in] user_data The user data
1018 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1021 tdm_hwc_commit(tdm_hwc *hwc, int sync, tdm_hwc_commit_handler func, void *user_data);
1024 * @brief Destroys the given window.
1025 * @param[in] window the pointer of the window to destroy
1029 tdm_hwc_window_destroy(tdm_hwc_window *hwc_window);
1032 * @brief Acquire a buffer queue for the window object
1033 * @details These buffers are used to composite by hardware a client content in
1035 * @param[in] hwc_window A window object
1036 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
1037 * @return A tbm buffer queue
1041 tdm_hwc_window_acquire_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error);
1044 * @brief Release a buffer queue for the window object
1045 * @details Release buffer queue when the client no longer uses buferrs of queue.
1046 * @param[in] hwc_window A window object
1047 * @param[in] A tbm buffer queue
1051 tdm_hwc_window_release_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue);
1054 * @brief Sets the desired composition type of the given window.
1055 * @details During tdm_hwc_validate(), the backend may request changes to
1056 * the composition types of any of the layers as described in the definition
1057 * of tdm_hwc_window_composition_t above.
1058 * @param[in] hwc_window A window object
1059 * @param[in] composition_type The new composition type
1060 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1064 tdm_hwc_window_set_composition_type(tdm_hwc_window *hwc_window,
1065 tdm_hwc_window_composition composition_type);
1068 * @brief Set the buffer damage
1069 * @details Provides the region of the source buffer which has been modified
1070 * since the last frame. This region does not need to be validated before
1071 * calling tdm_output_commit().
1072 * Once set through this function, the damage region remains the same until a
1073 * subsequent call to this function.
1074 * If damage.num_rects > 0, then it may be assumed that any portion of the source
1075 * buffer not covered by one of the rects has not been modified this frame. If
1076 * damage.num_rects == 0, then the whole source buffer must be treated as if it
1077 * has been modified.
1078 * If the layer's contents are not modified relative to the prior frame, damage
1079 * will contain exactly one empty rect([0, 0, 0, 0]).
1080 * The damage rects are relative to the pre-transformed buffer, and their origin
1081 * is the top-left corner. They will not exceed the dimensions of the latched
1083 * @param[in] hwc_window A window object
1084 * @param[in] damage The new buffer damage region
1085 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1089 tdm_hwc_window_set_buffer_damage(tdm_hwc_window *hwc_window, tdm_region damage);
1092 * @brief Set the information to a window object
1093 * @details The information will be applied when the hwc object is committed.
1094 * @param[in] hwc_window A window object
1095 * @param[in] info The information
1096 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1100 tdm_hwc_window_set_info(tdm_hwc_window *hwc_window, tdm_hwc_window_info *info);
1103 * @brief Set a TBM buffer to a window object
1104 * @details A TBM buffer will be applied when the output object of a layer
1105 * object is committed.
1106 * @param[in] hwc_window A window object
1107 * @param[in] buffer A TBM buffer
1108 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1112 tdm_hwc_window_set_buffer(tdm_hwc_window *hwc_window, tbm_surface_h buffer);
1115 * @brief Set the property which has a given id.
1116 * @param[in] hwc_window A hwc window object
1117 * @param[in] id The property id
1118 * @param[in] value The value of the propery id
1119 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1122 tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value value);
1125 * @brief Get the property which has a given id.
1126 * @param[in] hwc_window A hwc window object
1127 * @param[in] id The property id
1128 * @param[out] value The value of the propery id
1129 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1132 tdm_hwc_window_get_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value *value);
1135 * @brief Get the constraints of hwc_window
1136 * @param[in] hwc_window A hwc window object
1137 * @param[out] constraints The tdm_hwc_window_constraint types
1138 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1141 tdm_hwc_window_get_constraints(tdm_hwc_window *hwc_window, int *constraints);
1144 * @brief Destroy a pp object
1145 * @param[in] pp A pp object
1146 * @see tdm_display_create_pp
1149 tdm_pp_destroy(tdm_pp *pp);
1152 * @brief Set the geometry information to a pp object
1153 * @param[in] pp A pp object
1154 * @param[in] info The geometry information
1155 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1156 * @see tdm_pp_commit
1159 tdm_pp_set_info(tdm_pp *pp, tdm_info_pp *info);
1162 * @brief Set the PP done handler to a pp object
1164 * The user PP done handler will be called after converting a source buffer's image
1165 * to a destination buffer.
1166 * @param[in] pp A pp object
1167 * @param[in] func A user PP done handler
1168 * @param[in] user_data The user data
1169 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1172 tdm_pp_set_done_handler(tdm_pp *pp, tdm_pp_done_handler func, void *user_data);
1175 * @brief Attach a source buffer and a destination buffer to a pp object
1176 * @param[in] pp A pp object
1177 * @param[in] src A source buffer
1178 * @param[in] dst A destination buffer
1179 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1180 * @see tdm_pp_commit, tdm_pp_set_done_handler
1183 tdm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst);
1186 * @brief Commit changes for a pp object
1187 * @param[in] pp A pp object
1188 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1191 tdm_pp_commit(tdm_pp *pp);
1194 * @brief Destroy a capture object
1195 * @param[in] capture A capture object
1196 * @see tdm_output_create_capture, tdm_layer_create_capture
1199 tdm_capture_destroy(tdm_capture *capture);
1202 * @brief Set the geometry information to a capture object
1203 * @param[in] capture A capture object
1204 * @param[in] info The geometry information
1205 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1206 * @see tdm_capture_commit
1209 tdm_capture_set_info(tdm_capture *capture, tdm_info_capture *info);
1212 * @brief Set the capture done handler to a capture object
1214 * The user capture done handler will be called after capturing a screen into a
1216 * @param[in] capture A capture object
1217 * @param[in] func A user capture done handler
1218 * @param[in] user_data The user data
1219 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1222 tdm_capture_set_done_handler(tdm_capture *capture, tdm_capture_done_handler func, void *user_data);
1225 * @brief Attach a TDM buffer to a capture object
1226 * @param[in] capture A capture object
1227 * @param[in] buffer A TDM buffer
1228 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1229 * @see tdm_capture_commit, tdm_capture_set_done_handler
1232 tdm_capture_attach(tdm_capture *capture, tbm_surface_h buffer);
1235 * @brief Commit changes for a capture object
1236 * @param[in] capture A capture object
1237 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1240 tdm_capture_commit(tdm_capture *capture);
1243 * @brief The release handler of a TDM buffer
1244 * @param[in] buffer A TDM buffer
1245 * @param[in] user_data user data
1246 * @see tdm_buffer_add_release_handler, tdm_buffer_remove_release_handler
1248 typedef void (*tdm_buffer_release_handler)(tbm_surface_h buffer,
1252 * @brief Add a release handler to a TDM buffer
1254 * TDM has its own buffer release mechanism to let an frontend user know when a TDM buffer
1255 * becomes available for a next job. A TDM buffer can be used for TDM to show
1256 * it on screen or to capture an output and a layer. After all operations,
1257 * TDM will release it immediately when TDM doesn't need it any more.
1258 * @param[in] buffer A TDM buffer
1259 * @param[in] func A release handler
1260 * @param[in] user_data user data
1261 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1262 * @see tdm_buffer_remove_release_handler
1265 tdm_buffer_add_release_handler(tbm_surface_h buffer,
1266 tdm_buffer_release_handler func, void *user_data);
1269 * @brief Remove a release handler from a TDM buffer
1270 * @param[in] buffer A TDM buffer
1271 * @param[in] func A release handler
1272 * @param[in] user_data user data
1273 * @see tdm_buffer_add_release_handler
1276 tdm_buffer_remove_release_handler(tbm_surface_h buffer,
1277 tdm_buffer_release_handler func, void *user_data);
1280 * @brief The handler of a vblank object
1281 * @see #tdm_vblank_wait, #tdm_vblank_wait_seq
1283 typedef void (*tdm_vblank_handler)(tdm_vblank *vblank, tdm_error error, unsigned int sequence,
1284 unsigned int tv_sec, unsigned int tv_usec, void *user_data);
1287 * @brief Set the vblank fps for the given PID and name.
1288 * @param[in] pid The process ID
1289 * @param[in] name The client vblank name
1290 * @param[in] fps The client vblank fps
1291 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1294 tdm_vblank_set_client_vblank_fps(unsigned int pid, const char *name, unsigned int fps);
1297 * @brief Set the ignore global fps for the given PID and name.
1298 * @param[in] pid The process ID
1299 * @param[in] name The client vblank name
1300 * @param[in] ignore 1: ignore 0:not ignore(default)
1301 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1304 tdm_vblank_set_client_ignore_global_fps(unsigned int pid, const char *name, unsigned int ignore);
1307 * @brief Set the vblank global fps for the entire system.
1308 * @param[in] enable 1:enable, 0:disable
1309 * @param[in] fps The vblank global fps
1311 * This global fps will be applied to all client's vblanks for all outputs.
1312 * If the client's vblank fps is less than this, the global fps will be ignored
1313 * for that client. And if a client calls #tdm_vblank_ignore_global_fps to ignore
1314 * the global fps, it will be ignored also.
1315 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1318 tdm_vblank_enable_global_fps(unsigned int enable, unsigned int fps);
1321 * @brief Add the vblank create handler.
1322 * @param[in] dpy A display object
1323 * @param[in] func The user vblank create handler
1324 * @param[in] user_data The user data
1326 * The user vblank create handler will be called when new vblank object created.
1327 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1330 tdm_vblank_add_create_handler(tdm_display *dpy, tdm_vblank_create_handler func, void *user_data);
1333 * @brief Remove the vblank create handler.
1334 * @param[in] dpy A display object
1335 * @param[in] func The user vblank create handler
1336 * @param[in] user_data The user data
1337 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1340 tdm_vblank_remove_create_handler(tdm_display *dpy, tdm_vblank_create_handler func, void *user_data);
1343 * @brief Create a vblank object
1344 * @param[in] dpy A display object
1345 * @param[in] output A output object
1346 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
1347 * @return A vblank object
1348 * @see #tdm_vblank_destroy
1351 tdm_vblank_create(tdm_display *dpy, tdm_output *output, tdm_error *error);
1354 * @brief Destroy a vblank object
1355 * @param[in] vblank A vblank object
1356 * @see #tdm_vblank_create
1359 tdm_vblank_destroy(tdm_vblank *vblank);
1362 * @brief Get a output object of a vblank object
1363 * @param[in] vblank A vblank object
1364 * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value.
1365 * @return A TDM output object if success. Otherwise, NULL.
1366 * @see #tdm_vblank_create
1369 tdm_vblank_get_output(tdm_vblank *vblank, tdm_error *error);
1372 * @brief Get the client PID for a vblank object
1373 * @param[in] vblank A vblank object
1374 * @param[out] pid PID of vblank's client
1375 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1378 tdm_vblank_get_client_pid(tdm_vblank *vblank, pid_t *pid);
1381 * @brief Set the name to a vblank object
1382 * @details The default name is "unknown"
1383 * @param[in] vblank A vblank object
1384 * @param[in] name vblank name
1385 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1388 tdm_vblank_set_name(tdm_vblank *vblank, const char *name);
1391 * @brief Get the name for a vblank object
1392 * @details The default name is "unknown"
1393 * @param[in] vblank A vblank object
1394 * @param[out] name vblank name
1395 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1398 tdm_vblank_get_name(tdm_vblank *vblank, const char **name);
1401 * @brief Set the fps to a vblank object
1402 * @details Default is the @b vertical @b refresh @b rate of the given output.
1403 * It could be ignored when the fixed fps is set by #tdm_vblank_set_fixed_fps
1404 * @param[in] vblank A vblank object
1405 * @param[in] fps over 0
1406 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1409 tdm_vblank_set_fps(tdm_vblank *vblank, unsigned int fps);
1412 * @brief Get the fps for a vblank object
1413 * @param[in] vblank A vblank object
1414 * @param[out] fps over 0
1415 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1418 tdm_vblank_get_fps(tdm_vblank *vblank, unsigned int *fps);
1421 * @brief Set the fixed fps to a vblank object
1423 * It could be ignored when the global fps is set by #tdm_vblank_enable_global_fps
1424 * @param[in] vblank A vblank object
1425 * @param[in] fps over 0
1426 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1429 tdm_vblank_set_fixed_fps(tdm_vblank *vblank, unsigned int fps);
1432 * @brief Ignore the vblank global fps
1434 * The global fps will be applied to all client's vblanks for all outputs.
1435 * If the client's vblank fps is less than this, the global fps will be ignored
1436 * for that client. And if a client calls #tdm_vblank_ignore_global_fps to ignore
1437 * the global fps, it will be ignored also.
1438 * @param[in] vblank A vblank object
1439 * @param[in] ignore 1: ignore 0:not ignore(default)
1440 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1443 tdm_vblank_ignore_global_fps(tdm_vblank *vblank, unsigned int ignore);
1446 * @brief Set the offset(milli-second) to a vblank object
1447 * @details Default is @b 0.
1448 * @param[in] vblank A vblank object
1449 * @param[in] offset the offset(milli-second)
1450 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1453 tdm_vblank_set_offset(tdm_vblank *vblank, int offset);
1456 * @brief Get the offset(milli-second) for a vblank object
1457 * @param[in] vblank A vblank object
1458 * @param[out] offset the offset(milli-second)
1459 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1462 tdm_vblank_get_offset(tdm_vblank *vblank, int *offset);
1465 * @brief Enable/Disable the fake vblank to a vblank object
1467 * If enable_fake == 0, #tdm_vblank_wait will return TDM_ERROR_DPMS_OFF
1468 * when DPMS off. Otherwise, #tdm_vblank_wait will return TDM_ERROR_NONE
1470 * @param[in] vblank A vblank object
1471 * @param[in] enable_fake 1:enable, 0:disable
1472 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1475 tdm_vblank_set_enable_fake(tdm_vblank *vblank, unsigned int enable_fake);
1478 * @brief Get the fake vblank
1479 * @param[in] vblank A vblank object
1480 * @param[out] enable_fake 1:enable, 0:disable
1481 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1484 tdm_vblank_get_enable_fake(tdm_vblank *vblank, unsigned int *enable_fake);
1487 * @brief Wait for a vblank
1489 * Once #tdm_vblank_wait returns TDM_ERROR_NONE, the user vblank handler(#tdm_vblank_handler)
1490 * SHOULD be called after the given interval. \n
1491 * The sequence value of tdm_vblank_handler is the relative value of fps.
1492 * If fps = 10, this sequence value should be increased by 10 during 1 second.
1493 * @param[in] vblank A vblank object
1494 * @param[in] req_sec The vblank request time(second)
1495 * @param[in] req_usec The vblank request time(micro-second)
1496 * @param[in] interval The vblank interval
1497 * @param[in] func The user vblank handler
1498 * @param[in] user_data The user data
1499 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1502 tdm_vblank_wait(tdm_vblank *vblank, unsigned int req_sec, unsigned int req_usec,
1503 unsigned int interval, tdm_vblank_handler func, void *user_data);
1506 * @brief Wait for a vblank with the target sequence number
1507 * @param[in] vblank A vblank object
1508 * @param[in] req_sec The vblank request time(second)
1509 * @param[in] req_usec The vblank request time(micro-second)
1510 * @param[in] sequence The target sequence number
1511 * @param[in] func The user client vblank handler
1512 * @param[in] user_data The user data
1513 * @return #TDM_ERROR_NONE if success. Otherwise, error value.
1516 tdm_vblank_wait_seq(tdm_vblank *vblank, unsigned int req_sec, unsigned int req_usec,
1517 unsigned int sequence, tdm_vblank_handler func, void *user_data);
1523 #endif /* _TDM_H_ */