e_comp_screen: initialize egl_sync at e_comp_canvas
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 13 Dec 2024 00:40:20 +0000 (09:40 +0900)
committerJunseok Kim <juns.kim@samsung.com>
Fri, 13 Dec 2024 05:15:52 +0000 (14:15 +0900)
move the initialization of egl_sync from e_server to e_comp_canvas

Change-Id: I998a4abd785524b10e0d1098c711018230d9021a

src/bin/compmgr/e_comp_canvas.c
src/bin/compmgr/e_egl_sync.c
src/bin/e_comp_screen.c
src/bin/server/e_server.c
src/bin/server/e_server_intern.h

index 0791e1a1eb8548dfda7f5a5399fbab532df4031f..a38f01e06f7706f0ec4ca78bf3b5d315fa5b9312 100644 (file)
@@ -339,6 +339,14 @@ e_comp_canvas_init(E_Comp_Screen *comp_screen)
    e_view_name_set(view, "comp->bg_blank_view");
    e_view_show(view);
 
+   if(!e_egl_sync_init())
+     {
+        ERR("fail to e_egl_sync_init");
+        e_canvas_destroy(comp->canvas);
+        _e_comp_canvas_ecore_evas_deinit(ee);
+        return EINA_FALSE;
+     }
+
    evas_event_callback_add(comp->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_render_post, NULL);
 
    comp->ee_win = ecore_evas_window_get(comp->ee);
@@ -367,6 +375,7 @@ e_comp_canvas_clear(void)
 
    E_FREE_LIST(handlers, ecore_event_handler_del);
 
+   e_egl_sync_deinit();
    _e_comp_canvas_ecore_evas_deinit(comp->ee);
    e_view_destroy(comp->bg_blank_view);
    e_canvas_destroy(comp->canvas);
index 1d5bbf733e7e5190c837089a93476d6d8228888f..06e0647c7335035b9103ad2099ae55cc98b82bc6 100644 (file)
@@ -1,6 +1,4 @@
 #include "e_egl_sync_intern.h"
-#include "e_comp_wl_intern.h"
-#include "e_comp_intern.h"
 
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
@@ -193,16 +191,8 @@ e_egl_sync_init(void)
 {
    E_Egl_Sync_Mgr *egl_sync_mgr = NULL;
    const char *extensions = NULL;
-   E_Comp *comp = e_comp_get();
-   E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl->wl.disp, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(comp, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(comp->comp_screen, EINA_FALSE);
 
    if (_egl_sync_mgr) return EINA_TRUE;
-   if (!e_comp_gl_get()) return EINA_TRUE;
 
    egl_sync_mgr = E_NEW(E_Egl_Sync_Mgr, 1);
    EINA_SAFETY_ON_NULL_RETURN_VAL(egl_sync_mgr, EINA_FALSE);
index 5977a54b60b27f433e830cc33d7cec1416deb832..53dd03c360ed1e72b06fa39fb2135b812296fa02 100644 (file)
@@ -15,7 +15,6 @@
 #include "e_output_intern.h"
 #include "e_hwc_intern.h"
 #include "e_hwc_windows_intern.h"
-#include "e_egl_sync_intern.h"
 #include "e_config_intern.h"
 #include "e_dbus_conn_intern.h"
 #include "e_main_intern.h"
index 6b0f9b2f66485e28cac3184c9534654ba7a5922a..168260fc9e12f3bc570fcc420e4fcbcceaa9559f 100644 (file)
@@ -16,7 +16,6 @@
 #include "e_blur_intern.h"
 #include "e_foreign_intern.h"
 #include "e_explicit_sync_intern.h"
-#include "e_egl_sync_intern.h"
 #include "e_tizen_screen_manager_intern.h"
 #include "e_linux_dmabuf_intern.h"
 #include "e_screen_rotation_intern.h"
@@ -53,7 +52,6 @@ struct _E_Server
         Dummy_Handle *tizen_blur_manager_handle;
         Dummy_Handle *tizen_foreign_handle;
         Dummy_Handle *explicit_sync_handle;
-        Dummy_Handle *egl_sync_handle;
         E_Tizen_Screen_Manager *tizen_screen_manager;
         Dummy_Handle *linux_dmabuf_handle;
         Dummy_Handle *tizen_screen_rotation_handle;
@@ -114,8 +112,6 @@ e_server_init(void)
      e_server_feature_register(E_SERVER_FEATURE_TIZEN_BLUR_MANAGER, &dummy_handle);
    if (e_foreign_global_init(comp_wl->wl.disp))
      e_server_feature_register(E_SERVER_FEATURE_TIZEN_FOREIGN, &dummy_handle);
-   if (e_egl_sync_init())
-     e_server_feature_register(E_SERVER_FEATURE_EGL_SYNC, &dummy_handle);
    if (e_explicit_sync_init())
      e_server_feature_register(E_SERVER_FEATURE_EXPLICIT_SYNC, &dummy_handle);
    if (e_video_shell_create(comp_wl->wl.disp))
@@ -147,7 +143,6 @@ e_server_shutdown(void)
    e_screen_rotation_shutdown();
    e_linux_dmabuf_shutdown();
    e_tizen_screen_manager_shutdown();
-   e_egl_sync_deinit();
    e_explicit_sync_deinit();
    e_foreign_global_shutdown();
    e_blur_manager_shutdown();
@@ -231,9 +226,6 @@ e_server_feature_register(E_SERVER_FEATURE feature, void *handle)
        case E_SERVER_FEATURE_EXPLICIT_SYNC:
          g_server->handles.explicit_sync_handle = handle;
          break;
-       case E_SERVER_FEATURE_EGL_SYNC:
-         g_server->handles.egl_sync_handle = handle;
-         break;
        case E_SERVER_FEATURE_TIZEN_SRCREEN_MANAGER:
          g_server->handles.tizen_screen_manager = handle;
          break;
@@ -324,9 +316,6 @@ e_server_feature_handle_get(E_SERVER_FEATURE feature)
        case E_SERVER_FEATURE_EXPLICIT_SYNC:
          handle = g_server->handles.explicit_sync_handle;
          break;
-       case E_SERVER_FEATURE_EGL_SYNC:
-         handle = g_server->handles.egl_sync_handle;
-         break;
        case E_SERVER_FEATURE_TIZEN_SRCREEN_MANAGER:
          handle = g_server->handles.tizen_screen_manager;
          break;
index 6529817c388b9a2e185795c248530dfac5190928..d83e2f07315d57b91a8308d9497952fa67e798ce 100644 (file)
@@ -21,7 +21,6 @@ typedef enum _E_SERVER_FEATURE {
     E_SERVER_FEATURE_TIZEN_BLUR_MANAGER,
     E_SERVER_FEATURE_TIZEN_FOREIGN,
     E_SERVER_FEATURE_EXPLICIT_SYNC,
-    E_SERVER_FEATURE_EGL_SYNC,
     E_SERVER_FEATURE_TIZEN_SRCREEN_MANAGER,
     E_SERVER_FEATURE_LINUX_DMABUF,
     E_SERVER_FEATURE_TIZEN_SCREEN_ROTATION,