X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Ftdm_private_types.h;h=bbc83cdb97908bca6ffad7ef622894e7cb6682eb;hb=7a105d2256426d58cb253253cd0ee1acb5054d5e;hp=6c7d2d51925ac772693bbb20b1a88112e8c9f025;hpb=a0b81702cc5507fe05c913c121ec533699a01ebd;p=platform%2Fcore%2Fuifw%2Flibtdm.git diff --git a/src/tdm_private_types.h b/src/tdm_private_types.h index 6c7d2d5..bbc83cd 100644 --- a/src/tdm_private_types.h +++ b/src/tdm_private_types.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -96,42 +96,47 @@ typedef enum { TDM_COMMIT_TYPE_LAYER, } tdm_commit_type; +typedef struct _tdm_private_module tdm_private_module; typedef struct _tdm_private_display tdm_private_display; typedef struct _tdm_private_output tdm_private_output; +typedef struct _tdm_private_voutput tdm_private_voutput; typedef struct _tdm_private_layer tdm_private_layer; +typedef struct _tdm_private_hwc tdm_private_hwc; 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; typedef struct _tdm_private_server tdm_private_server; typedef struct _tdm_private_thread tdm_private_thread; -typedef struct _tdm_private_vblank_handler tdm_private_vblank_handler; +typedef struct _tdm_private_output_create_handler tdm_private_output_create_handler; +typedef struct _tdm_private_output_destroy_handler tdm_private_output_destroy_handler; typedef struct _tdm_private_output_change_handler tdm_private_output_change_handler; typedef struct _tdm_private_output_commit_handler tdm_private_output_commit_handler; +typedef struct _tdm_private_output_vblank_handler tdm_private_output_vblank_handler; +typedef struct _tdm_private_output_mode_change_handler tdm_private_output_mode_change_handler; typedef struct _tdm_private_layer_commit_handler tdm_private_layer_commit_handler; -typedef struct _tdm_private_hwc_window_commit_handler tdm_private_hwc_window_commit_handler; -typedef struct _tdm_private_output_hwc_target_buffer_window_commit_handler tdm_private_output_hwc_target_buffer_commit_handler; +typedef struct _tdm_private_hwc_commit_handler tdm_private_hwc_commit_handler; +typedef struct _tdm_private_voutput_commit_handler tdm_private_voutput_commit_handler; typedef struct _tdm_private_layer_buffer tdm_private_layer_buffer; -struct _tdm_private_display { - pthread_mutex_t lock; - unsigned int init_count; +struct _tdm_private_module { + struct list_head link; + + tdm_private_display *private_display; /* backend module info */ void *module; tdm_backend_module *module_data; tdm_backend_data *bdata; -#ifdef INIT_BUFMGR - tbm_bufmgr bufmgr; -#endif - /* backend function */ tdm_display_capability capabilities; tdm_func_display func_display; tdm_func_output func_output; + tdm_func_voutput func_voutput; tdm_func_layer func_layer; + tdm_func_hwc func_hwc; tdm_func_hwc_window func_hwc_window; tdm_func_pp func_pp; tdm_func_capture func_capture; @@ -143,16 +148,38 @@ struct _tdm_private_display { /* output, pp list */ struct list_head output_list; + struct list_head voutput_list; struct list_head pp_list; struct list_head capture_list; - void **outputs_ptr; + /* backend output objects. allocated in backend. freed in frontend. ordered */ + tdm_output **outputs; + + int fd; + tdm_event_loop_source *event_source; +}; + +struct _tdm_private_display { + pthread_mutex_t lock; + unsigned int init_count; + + double stamp; + +#ifdef INIT_BUFMGR + tbm_bufmgr bufmgr; +#endif + + struct list_head module_list; + tdm_private_module *dummy_module; + tdm_private_module *virtual_module; + tdm_private_module *current_module; //setted only when loading + tdm_private_module *pp_module; //pp-support backend + tdm_private_module *capture_module; //TODO: remove later /* for event handling */ tdm_private_loop *private_loop; - /* output order */ - tdm_output **outputs; + struct list_head output_create_handler_list; int print_fps; }; @@ -160,6 +187,9 @@ struct _tdm_private_display { struct _tdm_private_output { struct list_head link; + tdm_private_module *private_module; + tdm_private_voutput *private_voutput; + int index; double stamp; @@ -179,7 +209,6 @@ 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; @@ -191,23 +220,13 @@ struct _tdm_private_output { int layer_waiting_vblank; tdm_event_loop_source *vblank_timeout_timer; + unsigned int vblank_timeout_timer_expired; - /* seperate list for multi-thread*/ - struct list_head change_handler_list_main; - struct list_head change_handler_list_sub; + struct list_head destroy_handler_list; + struct list_head change_handler_list; void **layers_ptr; - /* 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; - tdm_event_loop_source *event_source; - } need_validate; - tdm_info_layer target_buffer_info; /* layer_info for the target_buffer */ /* calling a output commit per a vblank */ @@ -219,11 +238,44 @@ struct _tdm_private_output { /* hwc */ int need_set_target_info; + tdm_private_hwc *private_hwc; + + /* virtual */ + char name[TDM_NAME_LEN]; + struct list_head mode_change_request_handler_list; +}; + +struct _tdm_private_voutput { + struct list_head link; + + tdm_private_module *private_module; + + int regist_commit_cb; + + struct list_head voutput_commit_handler_list; + + int index; + + tdm_private_display *private_display; + tdm_private_output *private_output; + + tdm_voutput *voutput_backend; + + char name[TDM_NAME_LEN]; + tdm_output_mode *modes; + int mode_count; + unsigned int mmwidth; + unsigned int mmheight; + int connect_status; + + int set_voutput_commit; }; struct _tdm_private_layer { struct list_head link; + tdm_private_module *private_module; + int index; tdm_private_display *private_display; @@ -254,27 +306,53 @@ struct _tdm_private_layer { double fps_stamp; unsigned int fps_count; + + /* virtual */ + tbm_surface_h commiting_buffer; }; -struct _tdm_private_hwc_window { +struct _tdm_private_hwc { struct list_head link; + tdm_private_module *private_module; + int index; + double stamp; - tdm_private_display *private_display; tdm_private_output *private_output; + struct list_head hwc_window_list; + struct list_head hwc_commit_handler_list; + + int regist_commit_cb; + + tdm_hwc *hwc_backend; + + tbm_surface_h display_target_buffer; + + double fps_stamp; + unsigned int fps_count; +}; + +struct _tdm_private_hwc_window { + struct list_head link; + + tdm_private_module *private_module; + + tdm_private_hwc *private_hwc; tdm_hwc_window *hwc_window_backend; }; struct _tdm_private_pp { struct list_head link; + tdm_private_module *private_module; + double stamp; tdm_private_display *private_display; - tdm_pp *pp_backend; + tdm_pp *pp_module; struct list_head pending_buffer_list; struct list_head buffer_list; @@ -290,6 +368,8 @@ struct _tdm_private_capture { struct list_head link; struct list_head display_link; + tdm_private_module *private_module; + double stamp; tdm_capture_target target; @@ -298,7 +378,7 @@ struct _tdm_private_capture { tdm_private_output *private_output; tdm_private_layer *private_layer; - tdm_capture *capture_backend; + tdm_capture *capture_module; struct list_head pending_buffer_list; struct list_head buffer_list; @@ -323,9 +403,6 @@ struct _tdm_private_loop { struct wl_display *wl_display; struct wl_event_loop *wl_loop; - int backend_fd; - tdm_event_loop_source *backend_source; - /* In event loop, all resources are accessed by this dpy. * CAUTION: * - DO NOT include other private structure in this structure because this @@ -340,9 +417,11 @@ struct _tdm_private_loop { * private_thread is NULL. */ tdm_private_thread *private_thread; + + struct list_head source_list; }; -struct _tdm_private_vblank_handler { +struct _tdm_private_output_vblank_handler { struct list_head link; tdm_private_output *private_output; @@ -356,6 +435,26 @@ struct _tdm_private_vblank_handler { pid_t owner_tid; }; +struct _tdm_private_output_create_handler { + struct list_head link; + + tdm_private_display *private_display; + tdm_output_create_handler func; + void *user_data; + + pid_t owner_tid; +}; + +struct _tdm_private_output_destroy_handler { + struct list_head link; + + tdm_private_output *private_output; + tdm_output_destroy_handler func; + void *user_data; + + pid_t owner_tid; +}; + struct _tdm_private_output_change_handler { struct list_head link; @@ -376,16 +475,33 @@ struct _tdm_private_output_commit_handler { pid_t owner_tid; }; -struct _tdm_private_hwc_window_commit_handler { - tdm_private_hwc_window *private_hwc_window; - tdm_hwc_window_commit_handler func; +struct _tdm_private_voutput_commit_handler { + struct list_head link; + + tdm_private_voutput *private_voutput; + tdm_voutput_commit_func func; void *user_data; + + pid_t owner_tid; }; -struct _tdm_private_output_hwc_target_buffer_window_commit_handler { +struct _tdm_private_output_mode_change_handler { + struct list_head link; + tdm_private_output *private_output; - tdm_output_hwc_target_buffer_commit_handler func; + tdm_output_mode_change_request_handler func; + void *user_data; +}; + +struct _tdm_private_hwc_commit_handler { + struct list_head link; + + tdm_private_hwc *private_hwc; + tdm_hwc_commit_handler func; void *user_data; + + pid_t owner_tid; + int use_vblank; }; struct _tdm_private_layer_commit_handler { @@ -431,6 +547,9 @@ typedef struct _tdm_capture_private_buffer { typedef enum { TDM_THREAD_CB_NONE, + TDM_THREAD_CB_EXIT, /* special type to exit the tdm-thread */ + TDM_THREAD_CB_DISPLAY_OUTPUT_CREATE, + TDM_THREAD_CB_OUTPUT_DESTROY, TDM_THREAD_CB_OUTPUT_COMMIT, TDM_THREAD_CB_OUTPUT_VBLANK, TDM_THREAD_CB_OUTPUT_STATUS, @@ -439,66 +558,72 @@ typedef enum { TDM_THREAD_CB_CAPTURE_DONE, TDM_THREAD_CB_VBLANK_SW, TDM_THREAD_CB_VBLANK_CREATE, - TDM_THREAD_CB_NEED_VALIDATE, + TDM_THREAD_CB_HWC_COMMIT, + TDM_THREAD_CB_VOUTPUT_COMMIT, + TDM_THREAD_CB_MAX, } tdm_thread_cb_type; typedef struct _tdm_thread_cb_base tdm_thread_cb_base; +typedef struct _tdm_thread_cb_display_output_create tdm_thread_cb_display_output_create; +typedef struct _tdm_thread_cb_output_destroy tdm_thread_cb_output_destroy; typedef struct _tdm_thread_cb_output_vblank tdm_thread_cb_output_commit; typedef struct _tdm_thread_cb_output_vblank tdm_thread_cb_output_vblank; -typedef struct _tdm_thread_cb_output_status tdm_thread_cb_output_status; typedef struct _tdm_thread_cb_output_dpms tdm_thread_cb_output_dpms; +typedef struct _tdm_thread_cb_output_status tdm_thread_cb_output_status; 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_vblank_create tdm_thread_cb_vblank_create; -typedef struct _tdm_thread_cb_need_validate tdm_thread_cb_need_validate; +typedef struct _tdm_thread_cb_output_vblank tdm_thread_cb_hwc_commit; +typedef struct _tdm_thread_cb_output_vblank tdm_thread_cb_voutput_commit; struct _tdm_thread_cb_base { tdm_thread_cb_type type; unsigned int length; + double object_stamp; + void *data; + unsigned int sync; +}; + +struct _tdm_thread_cb_display_output_create { + tdm_thread_cb_base base; + tdm_output *output; +}; + +struct _tdm_thread_cb_output_destroy { + tdm_thread_cb_base base; }; struct _tdm_thread_cb_output_vblank { tdm_thread_cb_base base; - double output_stamp; unsigned int sequence; unsigned int tv_sec; unsigned int tv_usec; - void *user_data; }; struct _tdm_thread_cb_output_status { tdm_thread_cb_base base; - double output_stamp; tdm_output_conn_status status; - void *user_data; }; struct _tdm_thread_cb_output_dpms { tdm_thread_cb_base base; - double output_stamp; tdm_output_dpms dpms; - void *user_data; }; struct _tdm_thread_cb_pp_done { tdm_thread_cb_base base; - double pp_stamp; tbm_surface_h src; tbm_surface_h dst; - void *user_data; }; struct _tdm_thread_cb_capture_done { tdm_thread_cb_base base; - double capture_stamp; tbm_surface_h buffer; - void *user_data; }; struct _tdm_thread_cb_vblank_sw { tdm_thread_cb_base base; - double vblank_stamp; }; struct _tdm_thread_cb_vblank_create { @@ -506,11 +631,6 @@ struct _tdm_thread_cb_vblank_create { double vblank_stamp; }; -struct _tdm_thread_cb_need_validate { - tdm_thread_cb_base base; - tdm_private_output *o; -}; - struct argument_details { char type; int nullable;