From: Roman Peresipkyn Date: Fri, 5 Aug 2016 14:20:35 +0000 (+0300) Subject: 'info' event has been extended. resolve dead lock in set_window X-Git-Tag: accepted/tizen/common/20160812.141255^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb96bf962d4062f87ebfcb7c0fc9581af8248b2e;p=platform%2Fcore%2Fuifw%2Flibeom.git 'info' event has been extended. resolve dead lock in set_window Change-Id: I67d7fca99fc5d39c8b66def6679a920e753cc52b Signed-off-by: Roman Peresipkyn --- diff --git a/src/eom.c b/src/eom.c index 43ae03a..348b58f 100644 --- a/src/eom.c +++ b/src/eom.c @@ -1254,7 +1254,9 @@ eom_set_output_window(eom_output_id output_id, Evas_Object *win) INFO("output_id: %d, evas_win: %p\n", output_id, win); #ifdef HAVE_WAYLAND + _eom_mutex_unlock(); ret_array = eom_wayland_client_set_window(output_id, win); + _eom_mutex_lock(); #else ret_array = eom_dbus_client_set_window(output_id, win); #endif diff --git a/src/wayland/eom-wayland.c b/src/wayland/eom-wayland.c index 3f49bf3..7e4c33d 100644 --- a/src/wayland/eom-wayland.c +++ b/src/wayland/eom-wayland.c @@ -516,7 +516,11 @@ _eom_wl_eom_output_info(void *data, uint32_t h, uint32_t w_mm, uint32_t h_mm, - uint32_t connection) + uint32_t connection, + uint32_t skip, + uint32_t attribute, + uint32_t attribute_state, + uint32_t error) { EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data; EomWaylandOutput *eom_wl_output = NULL; @@ -524,25 +528,80 @@ _eom_wl_eom_output_info(void *data, INFO("INFO - id : %d, type : %d, mode : %d, w : %d, h : %d, w_mm : %d, h_mm : %d, conn : %d\n", output_id, type, mode, w, h, w_mm, h_mm, connection); - /* make external output info */ - eom_wl_output = calloc(1, sizeof(EomWaylandOutput)); - if (!eom_wl_output) { - ERR("Fail to allocate the eom_output.\n"); - return; - } + eom_wl_output = _eom_wayland_client_find_output_from_wl_output( + &eom_client_info->eom_wl_output_list, output_id); + if (eom_wl_output) { + eom_wl_output->width = w; + eom_wl_output->height = h; + eom_wl_output->physical_width = w_mm; + eom_wl_output->physical_height = h_mm; + + /* save the output type */ + if (eom_wl_output->eom_type != type) + eom_wl_output->eom_type = type; + + /* check the connection status and call the notify */ + if (eom_wl_output->eom_status != connection) { + eom_wl_output->eom_status = connection; + + INFO("INFO send connection: %d", connection); + + if (connection == WL_EOM_STATUS_CONNECTION) + _eom_wayland_client_call_notify(eom_wl_output, + EOM_OUTPUT_NOTIFY_ADD); + else if (connection == WL_EOM_STATUS_DISCONNECTION) + _eom_wayland_client_call_notify(eom_wl_output, + EOM_OUTPUT_NOTIFY_REMOVE); + } + + /* check the eom mode and call the notify */ + if (eom_wl_output->eom_mode != mode) { + eom_wl_output->eom_mode = mode; + + INFO("INFO send mode:%d", mode); + + _eom_wayland_client_call_notify(eom_wl_output, + EOM_OUTPUT_NOTIFY_MODE_CHANGED); + } + + if (skip) + return; + + /* check the eom attribute and call the notify */ + if ((eom_wl_output->eom_attribute != attribute) || + (eom_wl_output->eom_attribute_state != attribute_state)) { + eom_wl_output->eom_attribute = attribute; + eom_wl_output->eom_attribute_state = attribute_state; - eom_wl_output->id = output_id; - eom_wl_output->eom_type = type; - eom_wl_output->eom_mode = mode; - eom_wl_output->width = w; - eom_wl_output->height = h; - eom_wl_output->physical_width = w_mm; - eom_wl_output->physical_height = h_mm; - eom_wl_output->eom_status = connection; - eom_wl_output->client_info = &wl_client_info; - eom_wl_output->error = WL_EOM_ERROR_NONE; - - wl_list_insert(&eom_client_info->eom_wl_output_list, &eom_wl_output->link); + INFO("INFO NEW send attribute:%d", attribute); + INFO("INFO NEW send attribute state:%d", attribute_state); + + _eom_wayland_client_call_notify(eom_wl_output, + EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED); + } + + eom_wl_output->error = error; + } else { + /* make external output info */ + eom_wl_output = calloc(1, sizeof(EomWaylandOutput)); + if (!eom_wl_output) { + ERR("Fail to allocate the eom_output.\n"); + return; + } + + eom_wl_output->id = output_id; + eom_wl_output->eom_type = type; + eom_wl_output->eom_mode = mode; + eom_wl_output->width = w; + eom_wl_output->height = h; + eom_wl_output->physical_width = w_mm; + eom_wl_output->physical_height = h_mm; + eom_wl_output->eom_status = connection; + eom_wl_output->client_info = &wl_client_info; + eom_wl_output->error = WL_EOM_ERROR_NONE; + + wl_list_insert(&eom_client_info->eom_wl_output_list, &eom_wl_output->link); + } } /*LCOV_EXCL_STOP*/ /*LCOV_EXCL_START*/ diff --git a/src/wayland/protocol/eom-client-protocol.h b/src/wayland/protocol/eom-client-protocol.h index 3fca4db..27dbc21 100644 --- a/src/wayland/protocol/eom-client-protocol.h +++ b/src/wayland/protocol/eom-client-protocol.h @@ -174,6 +174,10 @@ struct wl_eom_listener { * @w_mm: (none) * @h_mm: (none) * @connection: (none) + * @skip: (none) + * @attribute: (none) + * @attribute_state: (none) + * @error: (none) */ void (*output_info)(void *data, struct wl_eom *wl_eom, @@ -184,7 +188,11 @@ struct wl_eom_listener { uint32_t h, uint32_t w_mm, uint32_t h_mm, - uint32_t connection); + uint32_t connection, + uint32_t skip, + uint32_t attribute, + uint32_t attribute_state, + uint32_t error); /** * output_type - (none) * @output_id: (none) diff --git a/src/wayland/protocol/eom-protocol.c b/src/wayland/protocol/eom-protocol.c index c032027..b0b38d5 100644 --- a/src/wayland/protocol/eom-protocol.c +++ b/src/wayland/protocol/eom-protocol.c @@ -15,6 +15,10 @@ static const struct wl_interface *types[] = { NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, &xdg_surface_interface, NULL, &wl_shell_surface_interface, @@ -22,14 +26,14 @@ static const struct wl_interface *types[] = { static const struct wl_message wl_eom_requests[] = { { "set_attribute", "uu", types + 0 }, - { "set_xdg_window", "uo", types + 8 }, - { "set_shell_window", "uo", types + 10 }, + { "set_xdg_window", "uo", types + 12 }, + { "set_shell_window", "uo", types + 14 }, { "get_output_info", "u", types + 0 }, }; static const struct wl_message wl_eom_events[] = { { "output_count", "u", types + 0 }, - { "output_info", "uuuuuuuu", types + 0 }, + { "output_info", "uuuuuuuuuuuu", types + 0 }, { "output_type", "uuu", types + 0 }, { "output_mode", "uu", types + 0 }, { "output_attribute", "uuuu", types + 0 }, diff --git a/src/wayland/protocol/eom.xml b/src/wayland/protocol/eom.xml index 2397a57..2ea8e15 100644 --- a/src/wayland/protocol/eom.xml +++ b/src/wayland/protocol/eom.xml @@ -104,6 +104,10 @@ + + + +