wl_tbm:bind wl display to bufmgr
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 22 Mar 2016 10:16:47 +0000 (19:16 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 23 Mar 2016 12:48:10 +0000 (21:48 +0900)
Change-Id: I039a24cfd897723a0c0c8aa646c1764918bf9e40

src/bin/e_comp_wl_tbm.c

index 94e13c5c035cac9e00b830b5bc1a87a5730fa818..fb2bd88f5c5ea6e1fd8484ead0c6b31d092de283 100644 (file)
@@ -2,6 +2,24 @@
 #include "e.h"
 #include <Ecore_Drm.h>
 #include <wayland-tbm-server.h>
+#include <tbm_bufmgr.h>
+
+static int
+_e_comp_wl_tbm_bind_wl_display(struct wayland_tbm_server *tbm_server, struct wl_display *display)
+{
+   tbm_bufmgr bufmgr = NULL;
+
+   bufmgr = wayland_tbm_server_get_bufmgr(tbm_server);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(bufmgr, EINA_FALSE);
+
+   if (!tbm_bufmgr_bind_native_display(bufmgr, (void *)display))
+     {
+        e_error_message_show(_("Enlightenment cannot bind native Display TBM!\n"));
+        return EINA_FALSE;
+     }
+
+   return EINA_TRUE;
+}
 
 EINTERN Eina_Bool
 e_comp_wl_tbm_init(void)
@@ -44,6 +62,8 @@ e_comp_wl_tbm_init(void)
 
    e_comp->wl_comp_data->tbm.server = (void *)tbm_server;
 
+   _e_comp_wl_tbm_bind_wl_display(tbm_server, e_comp->wl_comp_data->wl.disp);
+
    return EINA_TRUE;
 }
 
@@ -64,4 +84,3 @@ e_comp_wl_tbm_shutdown(void)
    e_comp->wl_comp_data->tbm.server = NULL;
 }
 
-