From: SooChan Lim Date: Thu, 5 Dec 2024 07:46:06 +0000 (+0900) Subject: e_comp_screen: initialize the display at e_comp_screen X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45799b6d4fd5112acc5856c97f9f368db35acb51;p=platform%2Fupstream%2Fenlightenment.git e_comp_screen: initialize the display at e_comp_screen Change-Id: I9f02a78b836d71aef7c4001a22a446d5fe3f3277 --- diff --git a/src/bin/e_comp_screen.c b/src/bin/e_comp_screen.c index 96223194e2..24efe8641d 100644 --- a/src/bin/e_comp_screen.c +++ b/src/bin/e_comp_screen.c @@ -320,69 +320,19 @@ static E_Comp_Screen * _e_comp_screen_new(void) { E_Comp_Screen *e_comp_screen = NULL; - int screen_rotation; e_comp_screen = E_NEW(E_Comp_Screen, 1); - if (!e_comp_screen) return NULL; + EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, EINA_FALSE); e_comp_screen_set(e_comp_screen); - /* check the screen rotation */ - screen_rotation = (e_config->screen_rotation_pre + e_config->screen_rotation_setting) % 360; - - ELOGF("COMP_SCREEN","screen_rotation_pre %d and screen_rotation_setting %d", - NULL, e_config->screen_rotation_pre, e_config->screen_rotation_setting); - - e_comp_screen->rotation_pre = e_config->screen_rotation_pre; - e_comp_screen->rotation_setting = e_config->screen_rotation_setting; - e_comp_screen->rotation = screen_rotation; - - e_main_ts_begin("\te_display_init"); - - if (!e_display_init()) - { - e_main_ts_end("\te_display_init() failed."); - ERR("e_display_init failed"); - free(e_comp_screen); - e_comp_screen_set(NULL); - return NULL; - } - - e_main_ts_end("\te_display_init Done"); - - e_comp_screen->num_outputs = e_display_num_outputs_get(); - e_comp_screen->outputs = e_display_outputs_get(); - - if (e_comp_hwc_is_configured() && e_comp_conf_hwc_deactive_get()) - e_comp_hwc_deactive_set(EINA_TRUE); - - /* tbm bufmgr init */ - e_main_ts_begin("\tTBM Bufmgr Server Init"); - e_comp_screen->bufmgr = tbm_bufmgr_server_init(); - if (!e_comp_screen->bufmgr) - { - e_main_ts_end("\tTBM Bufmgr Server Init Failed"); - ERR("tbm_bufmgr_init failed\n"); - goto fail; - } - e_main_ts_end("\tTBM Bufmgr Server Init Done"); - return e_comp_screen; - -fail: - if (e_comp_screen->bufmgr) tbm_bufmgr_deinit(e_comp_screen->bufmgr); - - free(e_comp_screen); - e_comp_screen_set(NULL); - TRACE_DS_END(); - - return NULL; } static void _e_comp_screen_del(E_Comp_Screen *e_comp_screen) { - if (e_comp_screen->bufmgr) tbm_bufmgr_deinit(e_comp_screen->bufmgr); + if (!e_comp_screen) return; free(e_comp_screen); } @@ -532,6 +482,7 @@ e_comp_screen_init() E_Comp_Wl_Data *comp_wl; E_Comp_Screen *e_comp_screen; int w, h, ptr_x = 0, ptr_y = 0; + int screen_rotation; E_EVENT_SCREEN_CHANGE = ecore_event_type_new(); @@ -549,6 +500,43 @@ e_comp_screen_init() } e_main_ts_end("\tE_Comp_Screen New Done"); + /* check the screen rotation */ + screen_rotation = (e_config->screen_rotation_pre + e_config->screen_rotation_setting) % 360; + + ELOGF("COMP_SCREEN","screen_rotation_pre %d and screen_rotation_setting %d", + NULL, e_config->screen_rotation_pre, e_config->screen_rotation_setting); + + e_comp_screen->rotation_pre = e_config->screen_rotation_pre; + e_comp_screen->rotation_setting = e_config->screen_rotation_setting; + e_comp_screen->rotation = screen_rotation; + + e_main_ts_begin("\te_display_init"); + if (!e_display_init()) + { + e_main_ts_end("\te_display_init() failed."); + ERR("e_display_init failed"); + goto failed_comp_screen; + } + e_main_ts_end("\te_display_init Done"); + + e_comp_screen->num_outputs = e_display_num_outputs_get(); + e_comp_screen->outputs = e_display_outputs_get(); + + if (e_comp_hwc_is_configured() && e_comp_conf_hwc_deactive_get()) + e_comp_hwc_deactive_set(EINA_TRUE); + + /* tbm bufmgr init */ + e_main_ts_begin("\tTBM Bufmgr Server Init"); + e_comp_screen->bufmgr = tbm_bufmgr_server_init(); + if (!e_comp_screen->bufmgr) + { + e_main_ts_end("\tTBM Bufmgr Server Init Failed"); + ERR("tbm_bufmgr_init failed\n"); + goto failed_comp_screen; + } + e_main_ts_end("\tTBM Bufmgr Server Init Done"); + + ecore_event_add(E_EVENT_SCREEN_CHANGE, NULL, NULL, NULL); e_comp_screen_e_screens_setup(e_comp_screen, -1, -1); @@ -640,8 +628,8 @@ e_comp_screen_init() failed_comp_screen: e_input_shutdown(); + if (e_comp_screen->bufmgr) tbm_bufmgr_deinit(e_comp_screen->bufmgr); _e_comp_screen_del(e_comp_screen); - e_comp_screen_set(NULL); return EINA_FALSE; }