fi
fi
+have_wayland_tbm=no
+AC_ARG_ENABLE([wayland-tbm],
+ AS_HELP_STRING([--enable-wayland-tbm],[enable wayland-tbm @<:@default=enabled@:>@]),
+ [e_cv_want_wayland_tbm=$enableval],
+ [e_cv_want_wayland_tbm=yes])
+AC_MSG_CHECKING([whether wayland TBM support is enabled])
+AC_MSG_RESULT([${e_cv_want_wayland_tbm}])
+
+if test "x$e_cv_want_wayland_tbm" != "xno";then
+ PKG_CHECK_MODULES([WAYLAND_TBM], [wayland-tbm-server],
+ [
+ have_wayland_tbm=yes
+ AC_DEFINE_UNQUOTED([HAVE_WAYLAND_TBM],[1],[enable wayland-tbm support])
+ ])
+
+ PKG_CHECK_MODULES([ECORE_DRM], [ecore-drm >= ${efl_version}])
+else
+ have_wayland_tbm=no
+fi
+
AM_CONDITIONAL([HAVE_WAYLAND], [test "x${have_wayland}" = "xyes"])
AM_CONDITIONAL([HAVE_WAYLAND_ONLY], [test "x${have_wayland_only}" = "xyes"])
AM_CONDITIONAL([HAVE_WAYLAND_CLIENTS], [test "x${have_wayland_clients}" = "xyes"])
AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "x${have_wayland_egl}" = "xyes"])
+AM_CONDITIONAL([HAVE_WAYLAND_TBM], [test "x${have_wayland_tbm}" = "xyes"])
if test "x${have_wayland_only}" != "xyes"; then
PKG_CHECK_MODULES([ECORE_X], [ecore-x >= ${efl_version}])
BuildRequires: pkgconfig(screenshooter-server)
BuildRequires: pkgconfig(screenshooter-client)
BuildRequires: pkgconfig(tizen-extension-server)
+BuildRequires: pkgconfig(wayland-tbm-server)
+BuildRequires: pkgconfig(ecore-drm)
Requires: libwayland-extension-server
%endif
@EDJE_DEF@ \
@WAYLAND_CFLAGS@ \
@WAYLAND_EGL_CFLAGS@ \
+@WAYLAND_TBM_CFLAGS@ \
-DE_BINDIR=\"$(bindir)\" \
-DPACKAGE_BIN_DIR=\"@PACKAGE_BIN_DIR@\" \
-DPACKAGE_LIB_DIR=\"@PACKAGE_LIB_DIR@\" \
src/bin/e_comp_wl_data.h \
src/bin/e_comp_wl_input.h \
src/bin/e_comp_wl.h
+
+if HAVE_WAYLAND_TBM
+ENLIGHTENMENTHEADERS += \
+src/bin/e_comp_wl_tbm.h
+endif
+
endif
src/bin/e_comp_wl_data.c \
src/bin/e_comp_wl_input.c \
src/bin/e_comp_wl.c
+
+if HAVE_WAYLAND_TBM
+enlightenment_src += \
+src/bin/e_comp_wl_tbm.c
+endif
+
endif
src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT -DE_LOGGING=1 @WAYLAND_CFLAGS@ @WAYLAND_EGL_CFLAGS@ -DNEED_WL
if ! HAVE_WAYLAND_ONLY
src_bin_enlightenment_CPPFLAGS += @ECORE_X_CFLAGS@ -DNEED_X=1
endif
+if HAVE_WAYLAND_TBM
+src_bin_enlightenment_CPPFLAGS += @WAYLAND_TBM_CFLAGS@ @ECORE_DRM_CFLAGS@
+endif
src_bin_enlightenment_SOURCES = \
src/bin/e_main.c \
$(enlightenment_src)
if ! HAVE_WAYLAND_ONLY
src_bin_enlightenment_LDADD += @ECORE_X_LIBS@
endif
+if HAVE_WAYLAND_TBM
+src_bin_enlightenment_LDADD += @WAYLAND_TBM_LIBS@ @ECORE_DRM_LIBS@
+endif
src_bin_enlightenment_imc_SOURCES = \
src/bin/e.h \
/* clients_win_hash = eina_hash_int64_new(NULL); */
clients_buffer_hash = eina_hash_pointer_new(NULL);
+#ifdef HAVE_WAYLAND_TBM
+ e_comp_wl_tbm_init();
+#endif
+
/* add event handlers to catch E events */
#ifndef HAVE_WAYLAND_ONLY
E_LIST_HANDLER_APPEND(handlers, E_EVENT_RANDR_CHANGE,
/* free handlers */
E_FREE_LIST(handlers, ecore_event_handler_del);
+#ifdef HAVE_WAYLAND_TBM
+ e_comp_wl_tbm_shutdown();
+#endif
+
/* shutdown ecore_wayland */
ecore_wl_shutdown();
}
Eina_Bool scaler;
} available_hw_accel;
+ struct
+ {
+ void *server;
+ } tbm;
+
Eina_List *outputs;
Ecore_Fd_Handler *fd_hdlr;
--- /dev/null
+#define E_COMP_WL
+#include "e.h"
+#include <Ecore_Drm.h>
+#include <wayland-tbm-server.h>
+
+EINTERN Eina_Bool
+e_comp_wl_tbm_init(void)
+{
+ struct wayland_tbm_server *tbm_server = NULL;
+ Eina_List *devs;
+ Ecore_Drm_Device *dev;
+ int drm_fd = -1;
+ const char *dev_name;
+
+ if (!e_comp)
+ {
+ e_error_message_show(_("Enlightenment cannot has no e_comp at Wayland TBM!\n"));
+ return EINA_FALSE;
+ }
+
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(e_comp->wl_comp_data->wl.disp, EINA_FALSE);
+
+ if (e_comp->wl_comp_data->tbm.server)
+ return EINA_TRUE;
+
+ devs = ecore_drm_devices_get();
+ EINA_SAFETY_ON_NULL_RETURN_VAL(devs, EINA_FALSE);
+
+ dev = eina_list_nth(devs, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
+
+ drm_fd = ecore_drm_device_fd_get(dev);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(drm_fd >= 0, EINA_FALSE);
+
+ dev_name = ecore_drm_device_name_get(dev);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(dev_name, EINA_FALSE);
+
+ tbm_server = wayland_tbm_server_init(e_comp->wl_comp_data->wl.disp, dev_name, drm_fd, 0);
+ if (!tbm_server)
+ {
+ e_error_message_show(_("Enlightenment cannot initialize a Wayland TBM!\n"));
+ return EINA_FALSE;
+ }
+
+ e_comp->wl_comp_data->tbm.server = (void *)tbm_server;
+
+ return EINA_TRUE;
+}
+
+EINTERN void
+e_comp_wl_tbm_shutdown(void)
+{
+ if (!e_comp)
+ return;
+
+ if (!e_comp->wl_comp_data)
+ return;
+
+ if (!e_comp->wl_comp_data->tbm.server)
+ return;
+
+ wayland_tbm_server_deinit((struct wayland_tbm_server *)e_comp->wl_comp_data->tbm.server);
+
+ e_comp->wl_comp_data->tbm.server = NULL;
+}
+
+
--- /dev/null
+#ifdef E_TYPEDEFS
+
+#else
+# ifndef E_COMP_WL_TBM_H
+# define E_COMP_WL_TBM_H
+
+EINTERN Eina_Bool e_comp_wl_tbm_init(void);
+EINTERN void e_comp_wl_tbm_shutdown(void);
+
+# endif
+#endif
# include "e_comp_wl_input.h"
# include "e_uuid_store.h"
# include "e_drm_buffer_pool.h"
+#ifdef HAVE_WAYLAND_TBM
+# include "e_comp_wl_tbm.h"
+#endif
#endif