From: Juyeon Lee Date: Fri, 10 Jun 2016 03:52:20 +0000 (+0900) Subject: e_info: switch on/off hwc in runtime X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85748a3bc6e3e0f73896d12b74df62848517f76f;p=platform%2Fupstream%2Fenlightenment.git e_info: switch on/off hwc in runtime enlightenment_info -hwc [0: off | 1: on] Change-Id: I2f79ec8beedede4304cbae045883380de27808e8 --- diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 943c179e35..6f6fcaa346 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -864,7 +864,7 @@ _e_comp_cb_update(void) setup_hwcompose: // TO DO : // query if selective HWC plane can be used - if (!e_comp_gl_get() && !e_comp->hwc) + if (!e_comp_gl_get() || !e_comp->hwc || !e_comp->hwc_fs) { goto end; } @@ -1464,6 +1464,8 @@ e_comp_init(void) e_comp->hwc = e_comp_hwc_init(); if (!e_comp->hwc) WRN("fail to init hwc."); + else + e_comp->hwc_fs = EINA_TRUE; // 1: active hwc policy } #endif diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h index 5b03f39d4c..d96f044e58 100644 --- a/src/bin/e_comp.h +++ b/src/bin/e_comp.h @@ -157,6 +157,7 @@ struct _E_Comp Eina_Bool shape_queue_blocked : 1; Eina_Bool calc_fps : 1; Eina_Bool hwc : 1; + Eina_Bool hwc_fs : 1; // active hwc policy Eina_List *connected_clients; Eina_List *launchscrns; // list of dummy clients for launchscreen image. diff --git a/src/bin/e_info_client.c b/src/bin/e_info_client.c index 3e11aa768a..38a60ad5a0 100644 --- a/src/bin/e_info_client.c +++ b/src/bin/e_info_client.c @@ -394,6 +394,8 @@ _e_info_client_proc_topvwins_info(int argc, char **argv) Eina_List *l; int i = 0; int prev_layer = -1; + int hwc_off = 0; + const char *prev_layer_name = NULL; if (!_e_info_client_eldbus_message("get_window_info", _cb_window_info_get)) @@ -424,13 +426,19 @@ _e_info_client_proc_topvwins_info(int argc, char **argv) prev_layer_name = win->layer_name; } - if (win->visibility == 0) + if (win->hwc >= 0) { - if (win->hwc) snprintf(tmp, sizeof(tmp), "hwc@%i", win->pl_zpos); - else snprintf(tmp, sizeof(tmp), "comp@%i", win->pl_zpos); + if (win->visibility == 0) + { + if (win->hwc) snprintf(tmp, sizeof(tmp), "hwc@%i", win->pl_zpos); + else snprintf(tmp, sizeof(tmp), "comp@%i", win->pl_zpos); + } + else + snprintf(tmp, sizeof(tmp), " - "); } - else + else // hwc is not initialized or hwc_fs deactivated { + hwc_off = 1; snprintf(tmp, sizeof(tmp), " - "); } @@ -442,6 +450,9 @@ _e_info_client_proc_topvwins_info(int argc, char **argv) printf("--------------------------------------------------------------------------------------------------------------[%s]\n", prev_layer_name ? prev_layer_name : " "); + if(hwc_off) + printf("\nHWC is disabled\n\n"); + E_FREE_LIST(e_info_client.win_list, _e_win_info_free); } @@ -1229,6 +1240,32 @@ _e_info_client_proc_effect_control(int argc, char **argv) printf("Error Check Args: enlightenment_info -effect [1: on, 0: off]\n"); } +static void +_e_info_client_proc_hwc(int argc, char **argv) +{ + uint32_t onoff; + + if (argc < 3) + { + printf("Error Check Args: enlightenment_info -hwc [1: on, 0: off]\n"); + return; + } + + onoff = atoi(argv[2]); + + if (onoff == 1 || onoff == 0) + { + if (!_e_info_client_eldbus_message_with_args("hwc", NULL, "i", onoff)) + { + printf("_e_info_client_eldbus_message_with_args error"); + return; + } + } + else + printf("Error Check Args: enlightenment_info -hwc [1: on, 0: off]\n"); + +} + static struct { const char *option; @@ -1337,6 +1374,12 @@ static struct "[on: 1, off: 0]", "On/Off the window effect", _e_info_client_proc_effect_control + }, + { + "hwc", + "[on: 1, off: 0]", + "On/Off the hw composite", + _e_info_client_proc_hwc } }; diff --git a/src/bin/e_info_server.c b/src/bin/e_info_server.c index 6734b06b7e..d25f154af2 100644 --- a/src/bin/e_info_server.c +++ b/src/bin/e_info_server.c @@ -109,7 +109,7 @@ _msg_clients_append(Eldbus_Message_Iter *iter) } } - if (e_comp->hwc) + if (e_comp->hwc && e_comp->hwc_fs) { #ifdef ENABLE_HWC_MULTI Eina_List *l, *ll; @@ -127,14 +127,14 @@ _msg_clients_append(Eldbus_Message_Iter *iter) pl_zpos = ep->zpos; } } - } #else - if (e_comp->nocomp_ec == ec) - { - hwc = 1; + if (e_comp->nocomp_ec == ec) hwc = 1; pl_zpos = 0; - } #endif + } + else + hwc = -1; + eldbus_message_iter_arguments_append(array_of_ec, "("VALUE_TYPE_FOR_TOPVWINS")", &struct_of_ec); eldbus_message_iter_arguments_append @@ -1303,6 +1303,42 @@ e_info_server_cb_effect_control(const Eldbus_Service_Interface *iface EINA_UNUSE return reply; } +static int override = 0; +static Eldbus_Message * +e_info_server_cb_hwc(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg) +{ + Eldbus_Message *reply = eldbus_message_method_return_new(msg); + uint32_t onoff; + + if (!eldbus_message_arguments_get(msg, "i", &onoff)) + { + ERR("Error getting arguments."); + return reply; + } + + if (!e_comp->hwc) + { + ERR("Error HWC is not initialized."); + return reply; + } + + if (onoff == 1) + { + e_comp->hwc_fs = EINA_TRUE; + } + else if (onoff == 0) + { +#ifdef ENABLE_HWC_MULTI + _e_comp_hwc_end("in runtime by e_info.."); +#else + e_comp_nocomp_end("in runtime by e_info.."); +#endif // end of ENABLE_HWC_MULTI + e_comp->hwc_fs = EINA_FALSE; + } + + return reply; +} + static const Eldbus_Method methods[] = { { "get_window_info", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_TOPVWINS")", "array of ec"}), _e_info_server_cb_window_info_get, 0 }, { "dump_topvwins", ELDBUS_ARGS({"s", "directory"}), NULL, _e_info_server_cb_topvwins_dump, 0 }, @@ -1327,6 +1363,7 @@ static const Eldbus_Method methods[] = { #endif { "get_keymap", NULL, ELDBUS_ARGS({"hi", "keymap fd"}), _e_info_server_cb_keymap_info_get, 0}, { "effect_control", ELDBUS_ARGS({"i", "effect_control"}), NULL, e_info_server_cb_effect_control, 0}, + { "hwc", ELDBUS_ARGS({"i", "hwc"}), NULL, e_info_server_cb_hwc, 0}, { NULL, NULL, NULL, NULL, 0 } };