return 1;
}
-EINTERN void
-e_comp_deferred_job(void)
-{
- e_main_ts_begin("\tE_Comp_Wl_Deferred");
- e_comp_wl_deferred_job();
- e_main_ts_end("\tE_Comp_Wl_Deferred Done");
-}
-
E_API void
e_comp_render_queue(void)
{
EINTERN E_Comp *e_comp_get(void);
EINTERN int e_comp_internal_save(void);
-EINTERN void e_comp_deferred_job(void);
EINTERN void e_comp_client_post_update_add(E_Client *ec);
EINTERN void e_comp_util_wins_print(void);
EINTERN void e_comp_ignore_win_add(E_Pixmap_Type type, Ecore_Window win);
#include <tizen-extension-server-protocol.h>
#include <tbm_bufmgr_internal.h>
#include <gbm.h>
+#include <Evas_GL.h>
#define PATH "/org/enlightenment/wm"
#define IFACE "org.enlightenment.wm.screen_rotation"
+typedef struct _E_Comp_Wl_Evas_Gl E_Comp_Wl_Evas_Gl;
+
+struct _E_Comp_Wl_Evas_Gl
+{
+ Evas_GL *gl;
+ Evas_GL_Config *glcfg;
+ Evas_GL_Context *glctx;
+ Evas_GL_Surface *glsfc;
+ Evas_GL_API *glapi;
+};
+
static Eina_List *g_policy_zones;
static Ecore_Event_Handler *dbus_init_done_handler;
static void _e_comp_screen_e_screens_setup(E_Comp_Screen *e_comp_screen, int rw, int rh);
static void _e_comp_screen_screen_policy_update(void);
+static void
+_e_comp_screen_gl_shutdown(E_Comp_Screen *e_comp_screen)
+{
+ if (!e_comp_screen->evas_gl) return;
+
+ if (e_comp_screen->evas_gl->glapi->evasglUnbindWaylandDisplay)
+ e_comp_screen->evas_gl->glapi->evasglUnbindWaylandDisplay(e_comp_screen->evas_gl->gl, e_comp_screen->wl_display);
+
+ evas_gl_make_current(e_comp_screen->evas_gl->gl, NULL, NULL);
+ evas_gl_context_destroy(e_comp_screen->evas_gl->gl, e_comp_screen->evas_gl->glctx);
+ evas_gl_surface_destroy(e_comp_screen->evas_gl->gl, e_comp_screen->evas_gl->glsfc);
+ evas_gl_free(e_comp_screen->evas_gl->gl);
+
+ E_FREE(e_comp_screen->evas_gl);
+}
+
+static void
+_e_comp_screen_gl_init(E_Comp_Screen *e_comp_screen)
+{
+ Evas *evas = NULL;
+ Evas_GL *evasgl = NULL;
+ Evas_GL_API *glapi = NULL;
+ Evas_GL_Context *ctx = NULL;
+ Evas_GL_Surface *sfc = NULL;
+ Evas_GL_Config *cfg = NULL;
+ Eina_Bool res;
+ E_Comp_Wl_Evas_Gl *evas_gl = NULL;
+ E_Comp *comp;
+
+ evas_gl = E_NEW(E_Comp_Wl_Evas_Gl, 1);
+ EINA_SAFETY_ON_NULL_RETURN(evas_gl);
+
+ /* create dummy evas gl to bind wayland display of enlightenment to egl display */
+ e_main_ts_begin("\tE_Comp_Wl_GL Init");
+
+ /* if wl_drm module doesn't call e_comp_canvas_init yet,
+ * then we should get evas from ecore_evas.
+ */
+ comp = e_comp_get();
+ if (comp->evas)
+ evas = comp->evas;
+ else
+ evas = ecore_evas_get(comp->ee);
+
+ evasgl = evas_gl_new(evas);
+ EINA_SAFETY_ON_NULL_GOTO(evasgl, err);
+
+ glapi = evas_gl_api_get(evasgl);
+ EINA_SAFETY_ON_NULL_GOTO(glapi, err);
+
+ if (!glapi->evasglBindWaylandDisplay)
+ {
+ evas_gl_free(evasgl);
+ free(evas_gl);
+ comp->gl = 1;
+ e_main_ts_end("\tE_Comp_Wl_GL Init Done");
+ return;
+ }
+
+ cfg = evas_gl_config_new();
+ EINA_SAFETY_ON_NULL_GOTO(cfg, err);
+
+ sfc = evas_gl_surface_create(evasgl, cfg, 1, 1);
+ EINA_SAFETY_ON_NULL_GOTO(sfc, err);
+
+ ctx = evas_gl_context_create(evasgl, NULL);
+ EINA_SAFETY_ON_NULL_GOTO(ctx, err);
+
+ res = evas_gl_make_current(evasgl, sfc, ctx);
+ EINA_SAFETY_ON_FALSE_GOTO(res, err);
+
+ res = glapi->evasglBindWaylandDisplay(evasgl, e_comp_screen->wl_display);
+ EINA_SAFETY_ON_FALSE_GOTO(res, err);
+
+ evas_gl_config_free(cfg);
+
+ evas_gl->gl = evasgl;
+ evas_gl->glapi = glapi;
+ evas_gl->glsfc = sfc;
+ evas_gl->glctx = ctx;
+
+ e_comp_screen->evas_gl = evas_gl;
+
+ /* for native surface */
+ comp->gl = 1;
+
+ e_main_ts_end("\tE_Comp_Wl_GL Init Done");
+
+ return;
+
+err:
+ evas_gl_config_free(cfg);
+ evas_gl_make_current(evasgl, NULL, NULL);
+ evas_gl_context_destroy(evasgl, ctx);
+ evas_gl_surface_destroy(evasgl, sfc);
+ evas_gl_free(evasgl);
+ free(evas_gl);
+}
static Eldbus_Message *
_e_comp_screen_dbus_get_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
}
e_main_ts_end("\tE_Server Init Done");
+ comp_wl = e_comp_wl_get();
+ e_comp_screen->wl_display = comp_wl->wl.disp;
+
+ if (e_comp_gl_get())
+ _e_comp_screen_gl_init(e_comp_screen);
+
/* e_comp_screen_setup */
if (!_e_comp_screen_screen_policy_setup())
{
/* pointer */
e_input_device_pointer_xy_get(NULL, &ptr_x, &ptr_y);
- comp_wl = e_comp_wl_get();
comp_wl->ptr.x = wl_fixed_from_int(ptr_x);
comp_wl->ptr.y = wl_fixed_from_int(ptr_y);
E_Comp_Screen *e_comp_screen = e_comp_screen_get();
if (!e_comp_screen) return;
+ _e_comp_screen_gl_shutdown(e_comp_screen);
+
if (e_comp_screen_iface)
{
eldbus_service_interface_unregister(e_comp_screen_iface);
#include <Eldbus.h>
typedef struct _E_Screen E_Screen;
+typedef struct _E_Comp_Wl_Evas_Gl E_Comp_Wl_Evas_Gl;
struct _E_Comp_Screen
{
Eina_Bool pp_enabled;
Eina_List *available_pp_formats;
+ E_Comp_Wl_Evas_Gl *evas_gl;
+ void *wl_display;
+
int fd;
Ecore_Fd_Handler *hdlr;
};
TRACE_DS_END();
TRACE_DS_BEGIN(MAIN:DEFERRED COMP JOB);
- /* try to do deferred job of any subsystems*/
- TSB("[DEFERRED] Compositor's deferred job");
- e_comp_deferred_job();
- TSE("[DEFERRED] Compositor's deferred job Done");
-
if (e_config->use_e_policy)
{
TSB("[DEFERRED] E_Policy's deferred job");
#include <glib.h>
#include <libds/log.h>
#include <libds/single_pixel_buffer_v1.h>
-#include <Evas_GL.h>
#include <ctype.h>
#include <sys/resource.h>
Ecore_Device *dev;
} E_Comp_Wl_Key_Data;
-struct _E_Comp_Wl_Evas_Gl
-{
- Evas_GL *gl;
- Evas_GL_Config *glcfg;
- Evas_GL_Context *glctx;
- Evas_GL_Surface *glsfc;
- Evas_GL_API *glapi;
-};
-
static Eina_List *handlers = NULL;
static E_Client *cursor_timer_ec = NULL;
static Eina_Bool need_send_released = EINA_FALSE;
_e_comp_wl_output_info_send(output, resource, pid, res_w, res_h);
}
-static void
-_e_comp_wl_gl_init(E_Comp_Wl_Data *comp_wl)
-{
- Evas *evas = NULL;
- Evas_GL *evasgl = NULL;
- Evas_GL_API *glapi = NULL;
- Evas_GL_Context *ctx = NULL;
- Evas_GL_Surface *sfc = NULL;
- Evas_GL_Config *cfg = NULL;
- Eina_Bool res;
- E_Comp_Wl_Evas_Gl *evas_gl = NULL;
- E_Comp *comp;
-
- if (!e_comp_gl_get()) return;
-
- evas_gl = E_NEW(E_Comp_Wl_Evas_Gl, 1);
- EINA_SAFETY_ON_NULL_RETURN(evas_gl);
-
- /* create dummy evas gl to bind wayland display of enlightenment to egl display */
- e_main_ts_begin("\tE_Comp_Wl_GL Init");
-
- /* if wl_drm module doesn't call e_comp_canvas_init yet,
- * then we should get evas from ecore_evas.
- */
- comp = e_comp_get();
- if (comp->evas)
- evas = comp->evas;
- else
- evas = ecore_evas_get(comp->ee);
-
- evasgl = evas_gl_new(evas);
- EINA_SAFETY_ON_NULL_GOTO(evasgl, err);
-
- glapi = evas_gl_api_get(evasgl);
- EINA_SAFETY_ON_NULL_GOTO(glapi, err);
-
- if (!glapi->evasglBindWaylandDisplay)
- {
- evas_gl_free(evasgl);
- free(evas_gl);
- comp->gl = 1;
- e_main_ts_end("\tE_Comp_Wl_GL Init Done");
- return;
- }
-
- cfg = evas_gl_config_new();
- EINA_SAFETY_ON_NULL_GOTO(cfg, err);
-
- sfc = evas_gl_surface_create(evasgl, cfg, 1, 1);
- EINA_SAFETY_ON_NULL_GOTO(sfc, err);
-
- ctx = evas_gl_context_create(evasgl, NULL);
- EINA_SAFETY_ON_NULL_GOTO(ctx, err);
-
- res = evas_gl_make_current(evasgl, sfc, ctx);
- EINA_SAFETY_ON_FALSE_GOTO(res, err);
-
- res = glapi->evasglBindWaylandDisplay(evasgl, comp_wl->wl.disp);
- EINA_SAFETY_ON_FALSE_GOTO(res, err);
-
- evas_gl_config_free(cfg);
-
- evas_gl->gl = evasgl;
- evas_gl->glapi = glapi;
- evas_gl->glsfc = sfc;
- evas_gl->glctx = ctx;
-
- comp_wl->evas_gl = evas_gl;
-
- /* for native surface */
- comp->gl = 1;
-
- e_main_ts_end("\tE_Comp_Wl_GL Init Done");
-
- return;
-
-err:
- evas_gl_config_free(cfg);
- evas_gl_make_current(evasgl, NULL, NULL);
- evas_gl_context_destroy(evasgl, ctx);
- evas_gl_surface_destroy(evasgl, sfc);
- evas_gl_free(evasgl);
- free(evas_gl);
-}
-
-static Eina_Bool
-_e_comp_wl_gl_idle(void *data)
-{
- return ECORE_CALLBACK_CANCEL;
-}
-
static void
_e_comp_wl_cb_client_created(struct wl_listener *listener, void *data)
{
comp_data->client_created.notify = _e_comp_wl_cb_client_created;
wl_display_add_client_created_listener(comp_data->base.wl.disp, &comp_data->client_created);
- // TODO: this function has to move to compmgr module
- if (e_comp_gl_get())
- _e_comp_wl_gl_init(comp_wl);
-
/* create a listener for wayland main loop events */
comp_wl->fd_hdlr =
ecore_main_fd_handler_add(fd, (ECORE_FD_READ | ECORE_FD_ERROR),
return NULL;
}
-static void
-_e_comp_wl_gl_shutdown(E_Comp_Wl_Data *comp_wl)
-{
- if (!comp_wl->evas_gl) return;
-
- if (comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay)
- comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay(comp_wl->evas_gl->gl, comp_wl->wl.disp);
-
- evas_gl_make_current(comp_wl->evas_gl->gl, NULL, NULL);
- evas_gl_context_destroy(comp_wl->evas_gl->gl, comp_wl->evas_gl->glctx);
- evas_gl_surface_destroy(comp_wl->evas_gl->gl, comp_wl->evas_gl->glsfc);
- evas_gl_free(comp_wl->evas_gl->gl);
-
- E_FREE(comp_wl->evas_gl);
-}
-
static void
_e_comp_wl_cb_input_thread_start(void *data, const char *device_name)
{
return comp_wl;
}
-EINTERN void
-e_comp_wl_deferred_job(void)
-{
- ecore_idle_enterer_add(_e_comp_wl_gl_idle, NULL);
-}
-
/* internal functions */
EINTERN void
e_comp_wl_shutdown(void)
e_input_hook_del(input_hook);
e_comp_wl_input_thread_remove_e_input_handlers();
- _e_comp_wl_gl_shutdown(e_comp_wl);
e_comp_wl_capture_shutdown();
EINTERN void e_comp_wl_shutdown(void);
EINTERN E_Comp_Wl_Data *e_comp_wl_get(void);
-EINTERN void e_comp_wl_deferred_job(void);
-
EINTERN void e_comp_wl_surface_destroy(struct wl_resource *resource);
EINTERN void e_comp_wl_surface_attach(E_Client *ec, E_Comp_Wl_Buffer *buffer);
EINTERN Eina_Bool e_comp_wl_surface_commit(E_Client *ec);
typedef struct _E_Comp_Wl_Data E_Comp_Wl_Data;
typedef struct _E_Comp_Wl_Output E_Comp_Wl_Output;
typedef struct _E_Comp_Wl_Intercept_Hook E_Comp_Wl_Intercept_Hook;
-typedef struct _E_Comp_Wl_Evas_Gl E_Comp_Wl_Evas_Gl;
typedef struct _E_Comp_Wl_Pointer_Constraint E_Comp_Wl_Pointer_Constraint;
typedef enum _E_Comp_Wl_Buffer_Type
void *drag_offer;
int drag_device_id; // Ecore_Event_Mouse_Move.multi.device
- E_Comp_Wl_Evas_Gl *evas_gl;
-
double idle_exiter_timestamp;
};