AC_DEFINE_UNQUOTED([HAVE_WAYLAND],[1],[enable wayland support])
fi
+AC_MSG_CHECKING([for OpenMP])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-fopenmp $mflag_primary -Werror"
+
+AC_LINK_IFELSE([AC_LANG_SOURCE([
+#include <omp.h>
+int main(int argc, char** argv)
+{
+ omp_set_dynamic(0);
+ return 0;
+}
+])],
+[
+ have_libgomp=yes
+ AC_MSG_RESULT([yes])
+], [
+ have_libgomp=no
+ AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+if test "x$have_libgomp" != "xno"; then
+AC_DEFINE([HAVE_LIBGOMP], [1], [Enable libgomp])
+ have_libgomp=yes
+else
+AC_DEFINE([HAVE_LIBGOMP], [0], [Disable libgomp])
+ have_libgomp=no
+fi
+AM_CONDITIONAL([HAVE_LIBGOMP], [test "x${have_libgomp}" = "xyes"])
+
dnl =======================================================================
release=$(pkg-config --variable=release enlightenment)
Group: Graphics & UI Framework/Other
Source0: %{name}-%{version}.tar.gz
License: BSD-2-Clause
+
+%ifarch %{arm}
+%define LIBGOMP use
+%endif
+
BuildRequires: pkgconfig(enlightenment)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(wayland-server)
BuildRequires: libopenssl11
BuildRequires: libopenssl1.1-devel
+%if "%{LIBGOMP}" == "use"
+Requires: libgomp
+%endif
+
%description
This package is a enlightenment rdp module for Tizen.
module_la_LDFLAGS = -module -avoid-version @ENLIGHTENMENT_LIBS@
module_la_DEPENDENCIES = $(top_builddir)/config.h
+if HAVE_LIBGOMP
+module_la_CFLAGS += -fopenmp
+module_la_LDFLAGS += -fopenmp
+endif
+
#uninstall:
# rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
#include <tbm_surface_internal.h>
#include <e_info_server_input.h>
+#if HAVE_LIBGOMP
+#include <omp.h>
+#endif
+
#include "e_mod_main.h"
#include "e_mod_rdp.h"
static void
_e_rdp_tbm_surface_copy(tbm_surface_h src_tbm_surface, tbm_surface_info_s *src_info, tbm_surface_h dst_tbm_surface, tbm_surface_info_s *dst_info)
{
+#if HAVE_LIBGOMP
+# define LIBGOMP_COPY_THREAD_NUM 4
+# define LIBGOMP_COPY_PAGE_SIZE getpagesize()
+# define PAGE_ALIGN(addr) ((addr)&(~((LIBGOMP_COPY_PAGE_SIZE)-1)))
+ if (src_info->planes[0].size > (LIBGOMP_COPY_THREAD_NUM * LIBGOMP_COPY_PAGE_SIZE))
+ {
+ size_t step[2];
+ step[0] = PAGE_ALIGN(src_info->planes[0].size / LIBGOMP_COPY_THREAD_NUM);
+ step[1] = src_info->planes[0].size - (step[0] * (LIBGOMP_COPY_THREAD_NUM - 1));
+
+ omp_set_num_threads(LIBGOMP_COPY_THREAD_NUM);
+ #pragma omp parallel
+ #pragma omp sections
+ {
+ #pragma omp section
+ {
+ memcpy(dst_info->planes[0].ptr,
+ src_info->planes[0].ptr,
+ step[0]);
+ }
+ #pragma omp section
+ {
+ memcpy(dst_info->planes[0].ptr + step[0],
+ src_info->planes[0].ptr + step[0],
+ step[0]);
+ }
+ #pragma omp section
+ {
+ memcpy(dst_info->planes[0].ptr + (step[0] * 2),
+ src_info->planes[0].ptr + (step[0] * 2),
+ step[0]);
+ }
+ #pragma omp section
+ {
+ memcpy(dst_info->planes[0].ptr + (step[0] * 3),
+ src_info->planes[0].ptr + (step[0] * 3),
+ step[1]);
+ }
+ }
+ }
+ else
+ {
+ memcpy(dst_info->planes[0].ptr, src_info->planes[0].ptr, src_info->planes[0].size);
+ }
+
+#else /* HAVE_LIBGOMP */
memcpy(dst_info->planes[0].ptr, src_info->planes[0].ptr, src_info->planes[0].size);
+#endif /* end of HAVE_LIBGOMP */
}
static void