X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Ftdm_private.h;h=8c710a8a6caf25d63f622e42b7dda00e895ff20f;hb=6c6338dd5b9527db34621319b61d567bad57c226;hp=59cb1ad4854080c161255d85f7b7642f582d7f37;hpb=11599cb15fc96bc8389869e0bcd08b3146ebd9c4;p=platform%2Fcore%2Fuifw%2Flibtdm.git diff --git a/src/tdm_private.h b/src/tdm_private.h index 59cb1ad..8c710a8 100644 --- a/src/tdm_private.h +++ b/src/tdm_private.h @@ -52,7 +52,9 @@ #include #include #include +#include #include +#include #include #include @@ -84,20 +86,35 @@ enum { TDM_DEBUG_COMMIT = (1 << 5), }; +enum { + TDM_TTRACE_NONE, + TDM_TTRACE_VBLANK = (1 << 0), + TDM_TTRACE_CLIENT = (1 << 1), + TDM_TTRACE_LAYER = (1 << 2), + TDM_TTRACE_PP = (1 << 3), + TDM_TTRACE_CAPTURE = (1 << 4), +}; + extern int tdm_debug_module; extern int tdm_debug_dump; +extern int tdm_ttrace_module; +extern int tdm_ttrace_output; #ifdef HAVE_TTRACE #include -#define TDM_TRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_GRAPHICS, "TDM:"#NAME) +#define TDM_TRACE_BEGIN(fmt, ...) traceBegin(TTRACE_TAG_GRAPHICS, fmt, ##__VA_ARGS__) #define TDM_TRACE_END() traceEnd(TTRACE_TAG_GRAPHICS) -#define TDM_TRACE_COUNT(NAME, COUNT) traceCounter(TTRACE_TAG_GRAPHICS, COUNT, "TDM:"#NAME) -#define TDM_TRACE_MARK(NAME) traceMark(TTRACE_TAG_GRAPHICS, "TDM:"#NAME) +#define TDM_TRACE_ASYNC_BEGIN(key, name,...) traceAsyncBegin(TTRACE_TAG_GRAPHICS, key, name, ##__VA_ARGS__) +#define TDM_TRACE_ASYNC_END(key, name,...) traceAsyncEnd(TTRACE_TAG_GRAPHICS, key, name, ##__VA_ARGS__) +#define TDM_TRACE_COUNT(count, fmt, ...) traceCounter(TTRACE_TAG_GRAPHICS, count, fmt, ##__VA_ARGS__) +#define TDM_TRACE_MARK(fmt, ...) traceMark(TTRACE_TAG_GRAPHICS, fmt, ##__VA_ARGS__) #else -#define TDM_TRACE_BEGIN(NAME) +#define TDM_TRACE_BEGIN(fmt, ...) #define TDM_TRACE_END() -#define TDM_TRACE_COUNT(NAME, COUNT) -#define TDM_TRACE_MARK(NAME) +#define TDM_TRACE_ASYNC_BEGIN(key, name,...) +#define TDM_TRACE_ASYNC_END(key, name,...) +#define TDM_TRACE_COUNT(count, fmt, ...) +#define TDM_TRACE_MARK(fmt, ...) #endif typedef enum { @@ -109,6 +126,7 @@ enum { TDM_DUMP_FLAG_LAYER = (1 << 0), TDM_DUMP_FLAG_PP = (1 << 1), TDM_DUMP_FLAG_CAPTURE = (1 << 2), + TDM_DUMP_FLAG_WINDOW = (1 << 3), }; #define TDM_DUMP_DIR "/tmp" @@ -122,6 +140,7 @@ typedef enum { typedef struct _tdm_private_display tdm_private_display; typedef struct _tdm_private_output tdm_private_output; typedef struct _tdm_private_layer tdm_private_layer; +typedef struct _tdm_private_hwc_window tdm_private_hwc_window; typedef struct _tdm_private_pp tdm_private_pp; typedef struct _tdm_private_capture tdm_private_capture; typedef struct _tdm_private_loop tdm_private_loop; @@ -151,6 +170,7 @@ struct _tdm_private_display { tdm_func_display func_display; tdm_func_output func_output; tdm_func_layer func_layer; + tdm_func_hwc_window func_hwc_window; tdm_func_pp func_pp; tdm_func_capture func_capture; @@ -172,10 +192,6 @@ struct _tdm_private_display { /* output order */ tdm_output **outputs; - /* calling a output commit per a vblank */ - int commit_per_vblank; - tdm_commit_type commit_type; - int print_fps; }; @@ -192,6 +208,7 @@ struct _tdm_private_output { unsigned int pipe; tdm_output_dpms current_dpms_value; + unsigned int waiting_dpms_change; const tdm_output_mode *current_mode; int regist_vblank_cb; @@ -200,6 +217,7 @@ struct _tdm_private_output { int regist_dpms_cb; struct list_head layer_list; + struct list_head hwc_window_list; struct list_head capture_list; struct list_head vblank_handler_list; struct list_head output_commit_handler_list; @@ -218,6 +236,19 @@ struct _tdm_private_output { /* TODO: temp solution for handling DPMS things in sub-htread */ tdm_event_loop_source *dpms_changed_timer; + + struct { + /* look at the tdm_output_set_need_revalidate_handler() declaration for the details */ + tdm_output_need_validate_handler hndl; + int event_fd; + } need_validate; + + /* calling a output commit per a vblank */ + int commit_per_vblank; + tdm_commit_type commit_type; + + /* for ttrace vblank */ + tdm_vblank *ttrace_vblank; }; struct _tdm_private_layer { @@ -231,6 +262,12 @@ struct _tdm_private_layer { tdm_caps_layer caps; tdm_layer *layer_backend; + /* pending data until committed */ + unsigned int pending_info_changed; + tdm_info_layer pending_info; + unsigned int pending_buffer_changed; + tbm_surface_h pending_buffer; + /* When a buffer is set to a layer, it will be stored to waiting_buffer. * And when a layer is committed, it will be moved to committed_buffer. * Finally when a commit handler is called, it will be moved to showing_buffer. @@ -249,6 +286,19 @@ struct _tdm_private_layer { unsigned int fps_count; }; +struct _tdm_private_hwc_window { + struct list_head link; + + int index; + uint32_t zpos; + + tdm_private_display *private_display; + tdm_private_output *private_output; + + tdm_hwc_window *hwc_window_backend; +}; + + struct _tdm_private_pp { struct list_head link; @@ -419,6 +469,9 @@ tdm_output_cb_status(tdm_output *output_backend, tdm_output_conn_status status, void tdm_output_cb_dpms(tdm_output *output_backend, tdm_output_dpms dpms, void *user_data); +INTERN tdm_error +tdm_output_cb_need_validate(tdm_private_output *private_output); + tdm_error tdm_output_wait_vblank_add_front(tdm_output *output, int interval, int sync, tdm_output_vblank_handler func, void *user_data); @@ -427,6 +480,11 @@ tdm_output_commit_internal(tdm_output *output, int sync, tdm_output_commit_handl tdm_error tdm_output_get_dpms_internal(tdm_output *output, tdm_output_dpms *dpms_value); +tdm_error +tdm_output_need_validate_event_init(tdm_output *output); +tdm_error +tdm_output_choose_commit_per_vblank_mode(tdm_private_output *private_output, int mode); + void tdm_output_remove_vblank_handler_internal(tdm_output *output, tdm_output_vblank_handler func, void *user_data); void @@ -434,6 +492,8 @@ tdm_output_remove_commit_handler_internal(tdm_output *output, tdm_output_commit_ void tdm_layer_remove_commit_handler_internal(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data); +tdm_error +tdm_layer_commit_pending_data(tdm_private_layer *private_layer); void tdm_layer_committed(tdm_private_layer *private_layer, tdm_private_layer_buffer **committed_buffer); @@ -449,6 +509,8 @@ tdm_error tdm_vblank_set_add_front(tdm_vblank *vblank, unsigned int add_front); tdm_error tdm_vblank_set_resource(tdm_vblank *vblank, struct wl_resource *resource); +double +tdm_vblank_get_stamp(tdm_vblank *vblank); tdm_error tdm_vblank_set_client_vblank_fps(unsigned int pid, const char *name, unsigned int fps); void @@ -466,6 +528,11 @@ tdm_pp_create_internal(tdm_private_display *private_display, tdm_error *error); void tdm_pp_destroy_internal(tdm_private_pp *private_pp); +tdm_hwc_window * +tdm_hwc_window_create_internal(tdm_private_output *private_output, int is_video, tdm_error *error); +tdm_error +tdm_hwc_window_destroy_internal(tdm_private_hwc_window * private_hwc_window); + tdm_private_capture * tdm_capture_create_output_internal(tdm_private_output *private_output, tdm_error *error); @@ -492,6 +559,8 @@ tdm_event_loop_init(tdm_private_display *private_display); void tdm_event_loop_deinit(tdm_private_display *private_display); void +tdm_event_loop_stop(tdm_private_display *private_display); +void tdm_event_loop_create_backend_source(tdm_private_display *private_display); int tdm_event_loop_get_fd(tdm_private_display *private_display); @@ -511,6 +580,7 @@ typedef enum { TDM_THREAD_CB_PP_DONE, TDM_THREAD_CB_CAPTURE_DONE, TDM_THREAD_CB_VBLANK_SW, + TDM_THREAD_CB_NEED_VALIDATE, } tdm_thread_cb_type; typedef struct _tdm_thread_cb_base tdm_thread_cb_base; @@ -521,6 +591,7 @@ typedef struct _tdm_thread_cb_output_dpms tdm_thread_cb_output_dpms; typedef struct _tdm_thread_cb_pp_done tdm_thread_cb_pp_done; typedef struct _tdm_thread_cb_capture_done tdm_thread_cb_capture_done; typedef struct _tdm_thread_cb_vblank_sw tdm_thread_cb_vblank_sw; +typedef struct _tdm_thread_cb_need_validate tdm_thread_cb_need_validate; struct _tdm_thread_cb_base { tdm_thread_cb_type type; @@ -570,6 +641,11 @@ struct _tdm_thread_cb_vblank_sw { double vblank_stamp; }; +struct _tdm_thread_cb_need_validate { + tdm_thread_cb_base base; + tdm_private_output *o; +}; + tdm_error tdm_thread_init(tdm_private_loop *private_loop); void @@ -591,6 +667,8 @@ void tdm_server_deinit(tdm_private_loop *private_loop); const char* tdm_server_get_client_name(pid_t pid); +tdm_error +tdm_server_enable_ttrace_client_vblank(tdm_display *dpy, tdm_output *output, int enable); char * tdm_helper_dump_make_directory(const char *path, char *reply, int *len); @@ -685,36 +763,13 @@ tdm_display_enable_dump(tdm_private_display *private_display, const char *dump_s tdm_error tdm_display_enable_path(const char *path); tdm_error -tdm_display_enable_ttrace_vblank(tdm_display *dpy, tdm_output *output, int enable); -tdm_error -tdm_display_enable_commit_per_vblank(tdm_private_display *private_display, int enable); +tdm_display_enable_ttrace(tdm_private_display *private_display, const char *ttrace, int output_id, char *reply, int *len); tdm_error tdm_display_enable_fps(tdm_private_display *private_display, int enable); void tdm_monitor_server_command(tdm_display *dpy, const char *options, char *reply, int *len); - - -#define TDM_WAYLAND_LOGGER ((WAYLAND_VERSION_MAJOR == 1) && (WAYLAND_VERSION_MINOR > 11)) - -#if !TDM_WAYLAND_LOGGER -#ifndef WL_CLOSURE_MAX_ARGS -#define WL_CLOSURE_MAX_ARGS 20 -#endif - -struct wl_closure { - int count; - const struct wl_message *message; - uint32_t opcode; - uint32_t sender_id; - union wl_argument args[WL_CLOSURE_MAX_ARGS]; - struct wl_list link; - struct wl_proxy *proxy; - struct wl_array extra[0]; -}; -#endif /* TDM_WAYLAND_LOGGER */ - struct argument_details { char type; int nullable;