Revert "Remove potential crash issue" 29/320329/1 accepted/tizen/unified/20241114.092406 accepted/tizen/unified/x/20241218.032613 accepted/tizen/unified/x/asan/20241224.004336
authorjinbong.lee <jinbong.lee@samsung.com>
Wed, 13 Nov 2024 09:37:01 +0000 (18:37 +0900)
committerjinbong.lee <jinbong.lee@samsung.com>
Wed, 13 Nov 2024 09:37:58 +0000 (18:37 +0900)
This reverts commit 3b965dde8e830c15009633b97b5ae81b10f1e422.

Change-Id: I34b5e05bf060b7dacebb6ecdf4c45724d52f40f9
Signed-off-by: jinbong.lee <jinbong.lee@samsung.com>
src/tpl_wayland_egl.c
src/tpl_wl_egl_thread.c
src/tpl_wl_vk_thread.c

index a899fd624b841ed4e036ceedf707f21d9e62f99b..5407f9c1c92667c50f6723b09feeb70318bc824b 100755 (executable)
@@ -172,14 +172,15 @@ __tpl_wayland_egl_display_is_wl_display(tpl_handle_t native_dpy)
 
        /* MAGIC CHECK: A native display handle is a wl_display if the de-referenced first value
           is a memory address pointing the structure of wl_display_interface. */
-       if (wl_egl_native_dpy != &wl_display_interface)
-               return TPL_FALSE;
+       if (wl_egl_native_dpy == &wl_display_interface)
+               return TPL_TRUE;
 
        if (strncmp(wl_egl_native_dpy->name, wl_display_interface.name,
-                                       strlen(wl_display_interface.name)) != 0)
-               return TPL_FALSE;
+                               strlen(wl_display_interface.name)) == 0) {
+               return TPL_TRUE;
+       }
 
-       return TPL_TRUE;
+       return TPL_FALSE;
 }
 
 static tpl_result_t
index b4886ff0d9e36f9a1623cb1ccf722a3d2df87143..7b33f0a6aba4628233b30c7fcc6cd9cc0cd9b458 100755 (executable)
@@ -1355,14 +1355,15 @@ __tpl_display_choose_backend_wl_egl_thread(tpl_handle_t native_dpy)
 
        /* MAGIC CHECK: A native display handle is a wl_display if the de-referenced first value
           is a memory address pointing the structure of wl_display_interface. */
-       if (wl_egl_native_dpy != &wl_display_interface)
-               return TPL_FALSE;
+       if (wl_egl_native_dpy == &wl_display_interface)
+               return TPL_TRUE;
 
        if (strncmp(wl_egl_native_dpy->name, wl_display_interface.name,
-                                       strlen(wl_display_interface.name)) != 0)
-               return TPL_FALSE;
+                               strlen(wl_display_interface.name)) == 0) {
+               return TPL_TRUE;
+       }
 
-       return TPL_TRUE;
+       return TPL_FALSE;
 }
 
 /* -- BEGIN -- wl_egl_window callback functions */
index ccdd879cd4ec7b77bd859746d6d129696e7abf6b..d6be95b69950ea8cd36f1ef22a093d221b3af8fa 100644 (file)
@@ -99,7 +99,7 @@ struct _tpl_wl_vk_swapchain {
 
        tbm_surface_h                *swapchain_buffers;
 
-       /* [TEMP] To fix dEQP-VK.wsi.wayland.swapchain.modify.resize crash issue
+       /* [TEMP] To fix dEQP-VK.wsi.wayland.swapchain.modify.resize crash issue 
         * It will be fixed properly using old_swapchain handle */
        tbm_surface_h                *old_swapchain_buffers;
 
@@ -239,16 +239,22 @@ _check_native_handle_is_wl_display(tpl_handle_t native_dpy)
 {
        struct wl_interface *wl_vk_native_dpy = *(void **) native_dpy;
 
+       if (!wl_vk_native_dpy) {
+               TPL_ERR("Invalid parameter. native_display(%p)", wl_vk_native_dpy);
+               return TPL_FALSE;
+       }
+
        /* MAGIC CHECK: A native display handle is a wl_display if the de-referenced first value
           is a memory address pointing the structure of wl_display_interface. */
-       if (wl_vk_native_dpy != &wl_display_interface)
-               return TPL_FALSE;
+       if (wl_vk_native_dpy == &wl_display_interface)
+               return TPL_TRUE;
 
        if (strncmp(wl_vk_native_dpy->name, wl_display_interface.name,
-                                       strlen(wl_display_interface.name)) != 0)
-               return TPL_FALSE;
+                               strlen(wl_display_interface.name)) == 0) {
+               return TPL_TRUE;
+       }
 
-       return TPL_TRUE;
+       return TPL_FALSE;
 }
 
 static tpl_bool_t
@@ -1807,7 +1813,7 @@ void __untrack_swapchain_buffers(tpl_wl_vk_surface_t *wl_vk_surface, tbm_surface
                                         _get_tbm_surface_bo_name(sc_buffers[i]));
                        tbm_surface_internal_unref(sc_buffers[i]);
                        sc_buffers[i] = NULL;
-               }
+               }               
        }
 }