'info' event has been extended. resolve dead lock in set_window 17/83017/2 accepted/tizen/common/20160812.141255 accepted/tizen/ivi/20160815.233506 accepted/tizen/mobile/20160815.233415 accepted/tizen/tv/20160815.233432 accepted/tizen/wearable/20160815.233448 submit/tizen/20160812.083535
authorRoman Peresipkyn <r.peresipkyn@samsung.com>
Fri, 5 Aug 2016 14:20:35 +0000 (17:20 +0300)
committerRoman Peresipkyn <r.peresipkyn@samsung.com>
Tue, 9 Aug 2016 08:55:45 +0000 (11:55 +0300)
Change-Id: I67d7fca99fc5d39c8b66def6679a920e753cc52b
Signed-off-by: Roman Peresipkyn <r.peresipkyn@samsung.com>
src/eom.c
src/wayland/eom-wayland.c
src/wayland/protocol/eom-client-protocol.h
src/wayland/protocol/eom-protocol.c
src/wayland/protocol/eom.xml

index 43ae03a..348b58f 100644 (file)
--- 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
index 3f49bf3..7e4c33d 100644 (file)
@@ -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*/
index 3fca4db..27dbc21 100644 (file)
@@ -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)
index c032027..b0b38d5 100644 (file)
@@ -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 },
index 2397a57..2ea8e15 100644 (file)
       <arg name="w_mm" type="uint"/>
       <arg name="h_mm" type="uint"/>
       <arg name="connection" type="uint"/>
+      <arg name="skip" type="uint"/>
+      <arg name="attribute" type="uint"/>
+      <arg name="attribute_state" type="uint"/>
+      <arg name="error" type="uint"/>
     </event>
 
     <event name="output_type">