Change to use e_comp_screen_get() instead of accessing e_comp->e_comp_screen directly. 84/316184/1
authorjinbong.lee <jinbong.lee@samsung.com>
Wed, 14 Aug 2024 10:53:01 +0000 (19:53 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 14 Aug 2024 11:25:46 +0000 (20:25 +0900)
Change-Id: I60b9bb08ae66b1b9a27c6b386822e57fe49f6c55

19 files changed:
src/bin/compmgr/e_comp.c
src/bin/compmgr/e_comp_canvas.c
src/bin/compmgr/e_comp_intern.h
src/bin/debug/e_info_server.c
src/bin/debug/e_test_helper.c
src/bin/displaymgr/e_display.c
src/bin/displaymgr/e_hwc.c
src/bin/displaymgr/e_output.c
src/bin/displaymgr/e_plane.c
src/bin/displaymgr/e_plane_renderer.c
src/bin/displaymgr/video/e_video_hwc.c
src/bin/displaymgr/video/e_video_hwc_planes.c
src/bin/displaymgr/video/e_video_hwc_windows.c
src/bin/e_comp_screen.c
src/bin/inputmgr/e_input_evdev.c
src/bin/server/e_comp_wl_tbm.c
src/bin/server/e_eom.c
src/bin/server/e_explicit_sync.c
src/bin/server/e_linux_dmabuf.c

index 68b5511bc58eaf6a65abfd6a0459c551d2b8bc45..eca3e94177cbacda028d2b6404b60bbedd8b5474 100644 (file)
@@ -731,6 +731,14 @@ e_comp_gl_get(void)
    return gl_avail;
 }
 
+EINTERN void
+e_comp_screen_set(E_Comp_Screen *screen)
+{
+   EINA_SAFETY_ON_NULL_RETURN(e_comp);
+
+   e_comp->e_comp_screen = screen;
+}
+
 EINTERN void
 e_comp_button_bindings_ungrab_all(void)
 {
index ed9438e71eb51a49a2645074b2e18b067820f1d6..1bd18734dd405a5ebf64b4ad8ec1e8fece099d3c 100644 (file)
@@ -93,7 +93,7 @@ static void
 _e_comp_canvas_resize(Ecore_Evas *ee EINA_UNUSED)
 {
    ecore_evas_geometry_get(ee, NULL, NULL, &e_comp->w, &e_comp->h);
-   e_comp_screen_e_screens_setup(e_comp->e_comp_screen, e_comp->w, e_comp->h);
+   e_comp_screen_e_screens_setup(e_comp_screen_get(), e_comp->w, e_comp->h);
    e_comp_canvas_update();
 }
 
@@ -174,7 +174,7 @@ e_comp_canvas_init(int w, int h)
 
    e_comp->ee_win = ecore_evas_window_get(e_comp->ee);
 
-   screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp->e_comp_screen);
+   screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp_screen_get());
    if (screens)
      {
         E_Screen *scr;
@@ -331,7 +331,7 @@ e_comp_canvas_update(void)
    E_Screen *scr;
    Eina_Bool changed = EINA_FALSE;
 
-   screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp->e_comp_screen);
+   screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp_screen_get());
 
    if (screens)
      {
index 84fa1fca020544697c8eae22d5ecd1acec8fb50d..e82b99e332b54676ba62920e89f972be0a4e1e59 100644 (file)
@@ -19,6 +19,7 @@ EINTERN E_Comp       *e_comp_find_by_window(Ecore_Window win);
 EINTERN void          e_comp_override_timed_pop(void);
 EINTERN void          e_comp_gl_set(Eina_Bool set);
 EINTERN Eina_Bool     e_comp_gl_get(void);
+EINTERN void          e_comp_screen_set(E_Comp_Screen *screen);
 
 EINTERN void          e_comp_button_bindings_grab_all(void);
 EINTERN void          e_comp_button_bindings_ungrab_all(void);
index 5b0d4719f3d46cb01b9ce01807f5ceba935ab049..85c68b63fcb26fc42cba9bf7d2d926422780747c 100644 (file)
@@ -4474,7 +4474,6 @@ static Eldbus_Message *
 _e_info_server_cb_output_mode(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
 {
    Eldbus_Message *reply = eldbus_message_method_return_new(msg);
-   E_Comp_Screen *e_comp_screen = NULL;
    tdm_display *tdpy = NULL;
    int mode = 0, count = 0, output_idx = 0;
 
@@ -4487,7 +4486,7 @@ _e_info_server_cb_output_mode(const Eldbus_Service_Interface *iface EINA_UNUSED,
    if ((mode == E_INFO_CMD_OUTPUT_MODE_GET) ||
        (mode == E_INFO_CMD_OUTPUT_MODE_SET))
      {
-        e_comp_screen = e_comp->e_comp_screen;
+        E_Comp_Screen *e_comp_screen = e_comp_screen_get();
         tdpy = e_comp_screen->tdisplay;
 
         if (tdpy != NULL)
@@ -4598,7 +4597,7 @@ e_info_server_cb_hwc(const Eldbus_Service_Interface *iface EINA_UNUSED, const El
      }
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, reply);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen, reply);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen_get(), reply);
 
    switch (info)
      {
@@ -5235,6 +5234,7 @@ static Eldbus_Message *
 _e_info_server_cb_screen_rotation_pre(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
 {
    Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
    int rotation_pre;
 
    if (!eldbus_message_arguments_get(msg, "i", &rotation_pre))
@@ -5243,13 +5243,13 @@ _e_info_server_cb_screen_rotation_pre(const Eldbus_Service_Interface *iface EINA
         return reply;
      }
 
-   if (!e_comp || !e_comp->e_comp_screen)
+   if (!e_comp_screen)
      {
         ERR("Error no screen.");
         return reply;
      }
 
-   e_comp_screen_rotation_pre_set(e_comp->e_comp_screen, rotation_pre);
+   e_comp_screen_rotation_pre_set(e_comp_screen, rotation_pre);
 
    if (e_config->screen_rotation_pre != rotation_pre)
      {
@@ -5272,6 +5272,7 @@ static Eldbus_Message *
 _e_info_server_cb_screen_rotation(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
 {
    Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
    int rotation;
 
    if (!eldbus_message_arguments_get(msg, "i", &rotation))
@@ -5280,13 +5281,13 @@ _e_info_server_cb_screen_rotation(const Eldbus_Service_Interface *iface EINA_UNU
         return reply;
      }
 
-   if (!e_comp || !e_comp->e_comp_screen)
+   if (!e_comp_screen)
      {
         ERR("Error no screen.");
         return reply;
      }
 
-   e_comp_screen_rotation_setting_set(e_comp->e_comp_screen, rotation);
+   e_comp_screen_rotation_setting_set(e_comp_screen, rotation);
 
    return reply;
 }
index 8d20d086433d5538aa33e07bd2701095907491e1..cf334b0f85955bd976127bc2a9454547260bfd63 100644 (file)
@@ -1705,7 +1705,7 @@ _e_test_helper_cb_get_screen_size(const Eldbus_Service_Interface *iface, const E
 
    if (!th_data) goto fin;
 
-   e_comp_screen_size_get(e_comp->e_comp_screen, &width, &height);
+   e_comp_screen_size_get(e_comp_screen_get(), &width, &height);
 
 fin:
    eldbus_message_arguments_append(reply, "ii", width, height);
index e4078448534ac24749285868ae98394ce2bf6771..daeee84ce16a9a341035115cfa54cd204d239d84 100644 (file)
@@ -466,7 +466,7 @@ _e_display_init_outputs(E_Display *display)
      }
 
    // FIXME: donot call e_comp_screen function at e_display. move this function to other plane, need refactoring
-   e_comp_screen_size_update(e_comp->e_comp_screen);
+   e_comp_screen_size_update(e_comp_screen_get());
 
    e_main_ts_begin("\tE_Hwc Ecore_Evas Init");
    if (!e_hwc_ecore_evas_init())
@@ -507,6 +507,7 @@ EINTERN Eina_Bool
 e_display_init(void)
 {
    E_Display *display;
+   E_Comp_Screen *e_comp_screen;
    tdm_display_capability capabilities;
    const tbm_format *pp_formats;
    tdm_error error = TDM_ERROR_NONE;
@@ -515,6 +516,9 @@ e_display_init(void)
 
    if (g_display) return EINA_TRUE;
 
+   e_comp_screen = e_comp_screen_get();
+   if (!e_comp_screen) return EINA_FALSE;
+
    display = E_NEW(E_Display, 1);
    EINA_SAFETY_ON_NULL_RETURN_VAL(display, EINA_FALSE);
 
@@ -577,7 +581,7 @@ e_display_init(void)
         goto fail;
      }
 
-   e_comp->e_comp_screen->tdisplay = display->tdisplay;
+   e_comp_screen->tdisplay = display->tdisplay;
 
    return EINA_TRUE;
 
index 492f13f259c499897000fc17e3dd4d9cc929c57a..77b7bf89935051c260606765277091cce1c393ca 100644 (file)
@@ -181,7 +181,7 @@ _e_hwc_tbm_surface_queue_alloc(void *data, int w, int h)
 {
    E_Hwc *hwc = (E_Hwc *)data;
    E_Output *output = hwc->output;
-   E_Comp_Screen *e_comp_screen = e_comp->e_comp_screen;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
    tbm_surface_queue_h tqueue = NULL;
    tdm_error error;
    int queue_w, queue_h;
@@ -381,6 +381,7 @@ e_hwc_ecore_evas_init(void)
    E_Output *primary_output = NULL;
    Ecore_Evas *ee = NULL;
    int w = 0, h = 0, scr_w = 1, scr_h = 1;
+   E_Comp_Screen *e_comp_screen;
    E_Hwc *hwc;
    int screen_rotation;
    char buf[1024];
@@ -394,7 +395,10 @@ e_hwc_ecore_evas_init(void)
    EHINF("ecore evase engine init.", hwc);
 
    // TODO: fix me. change the screen_rotation into output_rotation.
-   screen_rotation = e_comp->e_comp_screen->rotation;
+   e_comp_screen = e_comp_screen_get();
+   if (!e_comp_screen) return EINA_FALSE;
+
+   screen_rotation = e_comp_screen->rotation;
 
    /* set env for use tbm_surface_queue*/
    setenv("USE_EVAS_SOFTWARE_TBM_ENGINE", "1", 1);
@@ -405,7 +409,7 @@ e_hwc_ecore_evas_init(void)
        ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_TBM))
      e_comp_gl_set(EINA_TRUE);
 
-   e_comp_screen_size_get(e_comp->e_comp_screen, &scr_w, &scr_h);
+   e_comp_screen_size_get(e_comp_screen, &scr_w, &scr_h);
 
    EHINF("GL available:%d config engine:%d screen size:%dx%d", hwc,
        e_comp_gl_get(), e_comp_config_get()->engine, scr_w, scr_h);
index c69f49d426fdae65731b3dff08461405129a2186..237bfdf3983ae9722dc3f3823ac518ea18e50fdc 100644 (file)
@@ -2603,7 +2603,11 @@ e_output_update(E_Output *output)
              /* we apply the screen rotation only for the primary output */
              error = tdm_output_get_pipe(output->toutput, &pipe);
              if (error == TDM_ERROR_NONE && pipe == 0)
-               output->config.rotation = e_comp->e_comp_screen->rotation;
+               {
+                  E_Comp_Screen *e_comp_screen = e_comp_screen_get();
+                  if (e_comp_screen)
+                    output->config.rotation = e_comp_screen->rotation;
+               }
 
              if (maker)
                {
index 585fd93c8406cb4a8729874f72dbdc70a7492c6d..9a3cc8e2919882d5474db9911b5f091d968aa34a 100644 (file)
@@ -91,7 +91,10 @@ _get_comp_wl_buffer(E_Client *ec)
 static tbm_surface_queue_h
 _get_tbm_surface_queue(E_Comp *e_comp)
 {
-   return e_comp->e_comp_screen->tqueue;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
+   if (!e_comp_screen) return NULL;
+
+   return e_comp_screen->tqueue;
 }
 
 static Eina_Bool
@@ -1786,7 +1789,7 @@ e_plane_new(E_Output *output, int index)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
 
-   comp_screen = e_comp->e_comp_screen;
+   comp_screen = e_comp_screen_get();
    EINA_SAFETY_ON_NULL_RETURN_VAL(comp_screen, NULL);
 
    toutput = output->toutput;
@@ -3380,7 +3383,7 @@ e_plane_zoom_set(E_Plane *plane, Eina_Rectangle *rect)
        (plane->pp_rect.h == rect->h))
      return EINA_TRUE;
 
-   e_comp_screen = e_comp->e_comp_screen;
+   e_comp_screen = e_comp_screen_get();
    e_output_size_get(plane->output, &w, &h);
 
    if (!plane->tpp)
index 2e45b6d3127bfad1d02eaffd4a6d54960569680d..fe498c87fa231dba52cc69e02da197915bb8617f 100644 (file)
@@ -104,7 +104,10 @@ _get_wl_buffer(E_Client *ec)
 static tbm_surface_queue_h
 _get_tbm_surface_queue(Ecore_Evas *ee)
 {
-   return e_comp->e_comp_screen->tqueue;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
+   if (!e_comp_screen) return NULL;
+
+   return e_comp_screen->tqueue;
 }
 
 static void
@@ -845,7 +848,7 @@ _e_plane_renderer_surface_exported_surface_detach_cb(struct wayland_tbm_client_q
    E_Plane_Renderer_Buffer *renderer_buffer = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN(e_comp);
-   EINA_SAFETY_ON_NULL_RETURN(e_comp->e_comp_screen);
+   EINA_SAFETY_ON_NULL_RETURN(e_comp_screen_get());
    EINA_SAFETY_ON_NULL_RETURN(tsurface);
    EINA_SAFETY_ON_NULL_RETURN(data);
 
@@ -879,7 +882,7 @@ _e_plane_renderer_surface_exported_surface_destroy_cb(tbm_surface_h tsurface, vo
    E_Plane_Renderer_Buffer *renderer_buffer = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN(e_comp);
-   EINA_SAFETY_ON_NULL_RETURN(e_comp->e_comp_screen);
+   EINA_SAFETY_ON_NULL_RETURN(e_comp_screen_get());
    EINA_SAFETY_ON_NULL_RETURN(tsurface);
    EINA_SAFETY_ON_NULL_RETURN(data);
 
index 975411634bc3e7448c20a55542ef6eb8ab957fd6..01efb3e0af9b3ab25c056314008d12c000034491 100644 (file)
@@ -598,7 +598,9 @@ _e_video_hwc_pp_render(E_Video_Hwc *evh, E_Comp_Wl_Buffer *comp_buffer)
 
    if (!evh->pp)
      {
-        evh->pp = _e_video_hwc_pp_create(e_comp->e_comp_screen->tdisplay, evh);
+        E_Comp_Screen *e_comp_screen = e_comp_screen_get();
+        if (e_comp_screen)
+          evh->pp = _e_video_hwc_pp_create(e_comp_screen->tdisplay, evh);
         if (!evh->pp)
           return EINA_FALSE;
      }
index a5060eecd26ba9bd3dcef2998602d6b17cb2250c..9f08360bc6ef5e05fbfe95511e86a5669d54b84a 100644 (file)
@@ -970,6 +970,7 @@ static Eina_Bool
 _e_video_hwc_planes_iface_check_if_pp_needed(E_Video_Hwc *evh)
 {
    E_Video_Hwc_Planes *evhp;
+   E_Comp_Screen *e_comp_screen;
    int i, count = 0;
    const tbm_format *formats;
    Eina_Bool found = EINA_FALSE;
@@ -1015,7 +1016,8 @@ _e_video_hwc_planes_iface_check_if_pp_needed(E_Video_Hwc *evh)
        goto need_pp;
 
    /* check rotate */
-   if (evhp->base.geo.transform || e_comp->e_comp_screen->rotation > 0)
+   e_comp_screen = e_comp_screen_get();
+   if (evhp->base.geo.transform || (e_comp_screen && e_comp_screen->rotation > 0))
      if (!(capabilities & TDM_LAYER_CAPABILITY_TRANSFORM))
        goto need_pp;
 
index 6ecd7179fc9b4e690a1139eee391214fe395db52..b958a79337a27084bbee51cc63ace8ae2a4fa0ad 100644 (file)
@@ -227,6 +227,7 @@ static Eina_Bool
 _e_video_hwc_windows_iface_check_if_pp_needed(E_Video_Hwc *evh)
 {
    E_Video_Hwc_Windows *evhw;
+   E_Comp_Screen *e_comp_screen;
    int i, count = 0;
    const tbm_format *formats;
    Eina_Bool found = EINA_FALSE;
@@ -270,7 +271,8 @@ _e_video_hwc_windows_iface_check_if_pp_needed(E_Video_Hwc *evh)
        goto need_pp;
 
    /* check rotate */
-   if (evhw->base.geo.transform || e_comp->e_comp_screen->rotation > 0)
+   e_comp_screen = e_comp_screen_get();
+   if (evhw->base.geo.transform || (e_comp_screen && e_comp_screen->rotation > 0))
      if (!hwc->tdm_hwc_video_transform)
        goto need_pp;
 
index d2a84dabcb14542ffb15042d388fae459ebed118..099ad85401f6a9cd9439565ad47c8bb661bcfdb3 100644 (file)
@@ -50,10 +50,11 @@ static Eldbus_Message *
 _e_comp_screen_dbus_get_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
 {
    Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
    int rotation = 0;
 
-   if (e_comp && e_comp->e_comp_screen)
-     rotation = e_comp->e_comp_screen->rotation;
+   if (e_comp_screen)
+     rotation = e_comp_screen->rotation;
 
    ELOGF("COMP_SCREEN","got screen-rotation 'get' request: %d", NULL, rotation);
 
@@ -80,7 +81,7 @@ static const Eldbus_Service_Interface_Desc iface_desc = {
 static void
 _e_comp_screen_dbus_init()
 {
-   E_Comp_Screen *e_comp_screen = e_comp->e_comp_screen;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
 
    e_comp_screen_iface = eldbus_service_interface_register(edbus_conn,
                                                            PATH,
@@ -176,8 +177,10 @@ _e_comp_screen_cb_input_device_add(void *data, int type, void *event)
      }
    else if (e->clas == ECORE_DEVICE_CLASS_TOUCH)
      {
+        E_Comp_Screen *e_comp_screen = e_comp_screen_get();
         e_comp_wl_input_touch_enabled_set(EINA_TRUE);
-        _e_comp_screen_input_rotation_set(e_comp->e_comp_screen->rotation);
+        if (e_comp_screen)
+          _e_comp_screen_input_rotation_set(e_comp_screen->rotation);
         comp->wl_comp_data->touch.num_devices++;
      }
 
@@ -302,7 +305,7 @@ _e_comp_screen_new(E_Comp *comp)
    e_comp_screen = E_NEW(E_Comp_Screen, 1);
    if (!e_comp_screen) return NULL;
 
-   e_comp->e_comp_screen = e_comp_screen;
+   e_comp_screen_set(e_comp_screen);
 
    /* check the screen rotation */
    screen_rotation = (e_config->screen_rotation_pre + e_config->screen_rotation_setting) % 360;
@@ -321,7 +324,7 @@ _e_comp_screen_new(E_Comp *comp)
         e_main_ts_end("\te_display_init() failed.");
         ERR("e_display_init failed");
         free(e_comp_screen);
-        e_comp->e_comp_screen = NULL;
+        e_comp_screen_set(NULL);
         return NULL;
      }
 
@@ -350,7 +353,7 @@ fail:
    if (e_comp_screen->bufmgr) tbm_bufmgr_deinit(e_comp_screen->bufmgr);
 
    free(e_comp_screen);
-   e_comp->e_comp_screen = NULL;
+   e_comp_screen_set(NULL);
    TRACE_DS_END();
 
    return NULL;
@@ -381,11 +384,11 @@ _e_comp_screen_e_screens_set(E_Comp_Screen *e_comp_screen, Eina_List *screens)
 static void
 _e_comp_screen_engine_deinit(void)
 {
-   if (!e_comp) return;
-   if (!e_comp->e_comp_screen) return;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
+   if (!e_comp_screen) return;
 
-   _e_comp_screen_del(e_comp->e_comp_screen);
-   e_comp->e_comp_screen = NULL;
+   _e_comp_screen_del(e_comp_screen);
+   e_comp_screen_set(NULL);
 }
 
 static Eina_Bool
@@ -531,19 +534,20 @@ e_comp_screen_e_screens_get(E_Comp_Screen *e_comp_screen)
 static void
 _e_comp_screen_cb_output_connect_status_change(void *data, E_Output *output)
 {
-   e_comp_screen_size_update(e_comp->e_comp_screen);
+   e_comp_screen_size_update(e_comp_screen_get());
 }
 
 static void
 _e_comp_screen_cb_output_mode_change(void *data, E_Output *output)
 {
-   e_comp_screen_size_update(e_comp->e_comp_screen);
+   e_comp_screen_size_update(e_comp_screen_get());
 }
 
 EINTERN Eina_Bool
 e_comp_screen_init()
 {
    E_Comp *comp;
+   E_Comp_Screen *e_comp_screen;
    int w, h, ptr_x = 0, ptr_y = 0;
 
    if (!(comp = e_comp))
@@ -632,7 +636,9 @@ e_comp_screen_init()
    E_OUTPUT_HOOK_APPEND(output_hooks, E_OUTPUT_HOOK_CONNECT_STATUS_CHANGE, _e_comp_screen_cb_output_connect_status_change, comp);
    E_OUTPUT_HOOK_APPEND(output_hooks, E_OUTPUT_HOOK_MODE_CHANGE, _e_comp_screen_cb_output_mode_change, comp);
 
-   _e_comp_screen_input_rotation_set(e_comp->e_comp_screen->rotation);
+   e_comp_screen = e_comp_screen_get();
+   if (e_comp_screen)
+     _e_comp_screen_input_rotation_set(e_comp_screen->rotation);
 
    return EINA_TRUE;
 
@@ -647,8 +653,8 @@ failed_comp_screen:
 EINTERN void
 e_comp_screen_shutdown()
 {
-   if (!e_comp) return;
-   if (!e_comp->e_comp_screen) return;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
+   if (!e_comp_screen) return;
 
    if (e_comp_screen_iface)
      {
@@ -672,8 +678,8 @@ e_comp_screen_shutdown()
    e_input_shutdown();
 
    /* delete e_comp_sreen */
-   _e_comp_screen_del(e_comp->e_comp_screen);
-   e_comp->e_comp_screen = NULL;
+   _e_comp_screen_del(e_comp_screen);
+   e_comp_screen_set(NULL);
 }
 
 static Eina_Bool
index c1237569f8d5a856a7f586ab1ce027b08c98eb7f..55b79ebd0b9c27af6f0ccbac2d5c8ece0359b972 100644 (file)
@@ -37,8 +37,9 @@ e_input_evdev_device_calibration_set(E_Input_Evdev *evdev)
    int w = 0, h = 0;
    int temp;
    E_Comp_Config *comp_conf;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
 
-   if (e_comp->e_comp_screen->num_outputs > 1) //multiple outputs
+   if (e_comp_screen && e_comp_screen->num_outputs > 1) //multiple outputs
      {
         comp_conf = e_comp_config_get();
         if (comp_conf && (comp_conf->input_output_assign_policy == 1)) //use output-assignment policy
@@ -131,12 +132,13 @@ _device_output_assign(E_Input_Evdev *evdev, E_Input_Seat_Capabilities cap)
    Eina_Bool need_assign_output = EINA_FALSE;
    const char *output_name;
    E_Output *output;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
 
    if (!(evdev->caps & cap)) return;
    if (evdev->output_name) return; //already assigned
-   if (e_comp->e_comp_screen->num_outputs <= 1) return;
+   if (!e_comp_screen || e_comp_screen->num_outputs <= 1) return;
 
-   last_output_idx = e_comp->e_comp_screen->num_outputs - 1;
+   last_output_idx = e_comp_screen->num_outputs - 1;
    EINA_LIST_FOREACH(evdev->seat->devices, l, ed)
      {
         if (!(ed->caps & cap)) continue;
index 2b52158f3192787a22aba5fb1c63ab10ae92f8f5..6d85eaae6c72be1f9b8504722d541787c1d63508 100644 (file)
@@ -314,11 +314,12 @@ e_comp_wl_tbm_import_gbm_bo(void *gbo)
    tbm_bo tbo = NULL;
    int fd = -1;
    Eina_Bool need_close = EINA_FALSE;
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
    int i;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen->bufmgr, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen->bufmgr, NULL);
 
    info.width = gbm_bo_get_width(gbo);
    info.height = gbm_bo_get_height(gbo);
@@ -335,7 +336,7 @@ e_comp_wl_tbm_import_gbm_bo(void *gbo)
    fd = _e_comp_wl_tbm_gbm_bo_fd_get(gbo, &need_close);
    EINA_SAFETY_ON_FALSE_GOTO(fd >= 0, end);
 
-   tbo = tbm_bo_import_fd(e_comp->e_comp_screen->bufmgr, fd);
+   tbo = tbm_bo_import_fd(e_comp_screen->bufmgr, fd);
    EINA_SAFETY_ON_NULL_GOTO(tbo, end);
 
    tsurface = tbm_surface_internal_create_with_bos(&info, &tbo, 1);
index d0f324d0fee9c736e907ceeeb42ed1bac9039dae..8cb9097b5ef9667303ba42b4905877930801fc2c 100644 (file)
@@ -1110,10 +1110,12 @@ err:
 EINTERN Eina_Bool
 e_eom_init(void)
 {
+   E_Comp_Screen *e_comp_screen;
    EINA_SAFETY_ON_NULL_GOTO(e_comp_wl, err);
 
-   if (e_comp->e_comp_screen->num_outputs < 1)
-     return EINA_TRUE;
+   e_comp_screen = e_comp_screen_get();
+   if (!e_comp || e_comp_screen->num_outputs < 1)
+     return EINA_FALSE;
 
    g_eom = E_NEW(E_Eom, 1);
    EINA_SAFETY_ON_NULL_RETURN_VAL(g_eom, EINA_FALSE);
index db076cfd0da31e624ac139ddc14a61a8cfdae3b6..6965a20167908ab2bc60227e97cfdde8ab2bb38a 100644 (file)
@@ -480,7 +480,7 @@ e_explicit_sync_init(void)
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen_get(), EINA_FALSE);
 
    if (_explicit_sync) return EINA_TRUE;
    if (!e_comp_gl_get()) return EINA_FALSE;
index f07894d172185e1f2f5c892c7acfa33a99493017..5c57e17415cb019db2b37a40a204cad8e0deead6 100644 (file)
@@ -285,11 +285,12 @@ e_linux_dmabuf_tbm_surface_get_from_buffer(struct ds_buffer *ds_buffer)
    tbm_surface_info_s info = {0, };
    tbm_bo bos[LINUX_DMABUF_MAX_PLANES] = {0, };
    off_t bos_size[LINUX_DMABUF_MAX_PLANES] = {0, };
+   E_Comp_Screen *e_comp_screen = e_comp_screen_get();
    int i = 0;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen->bufmgr, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen->bufmgr, NULL);
 
    if (!_dmabuf) return NULL;
 
@@ -311,10 +312,12 @@ e_linux_dmabuf_tbm_surface_get_from_buffer(struct ds_buffer *ds_buffer)
 
    for (i = 0; i < info.num_planes; i++)
      {
+        E_Comp_Screen *e_comp_screen = e_comp_screen_get();
         info.planes[i].stride = ds_attributes->stride[i];
         info.planes[i].offset = ds_attributes->offset[i];
 
-        bos[i] = tbm_bo_import_fd(e_comp->e_comp_screen->bufmgr, ds_attributes->fd[i]);
+        if (e_comp_screen)
+          bos[i] = tbm_bo_import_fd(e_comp_screen->bufmgr, ds_attributes->fd[i]);
         EINA_SAFETY_ON_NULL_GOTO(bos[i], failed);
 
         bos_size[i] = lseek(ds_attributes->fd[i], 0, SEEK_END);