Apply the temporal replacement of memcpy to get a performance improvement 18/76018/5
authorSung-Jin Park <sj76.park@samsung.com>
Wed, 22 Jun 2016 10:43:55 +0000 (19:43 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Thu, 23 Jun 2016 08:46:38 +0000 (01:46 -0700)
Change-Id: Ieca0d8f3cdb6473c0f9d5348f3843898bfa92fc8
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
configure.ac
packaging/enlightenment.spec
src/bin/Makefile.mk
src/bin/e_comp_hwc.c
src/bin/libmemcpy_swc.so [new file with mode: 0644]
src/bin/libmemcpy_swc.so.0 [new symlink]

index ea63548..0d5ff97 100755 (executable)
@@ -422,6 +422,23 @@ if test "x${have_wayland}" = "xyes"; then
   fi
 fi
 
+memcpy_swc=no
+AC_ARG_ENABLE([memcpy_swc],
+  AS_HELP_STRING([--enable-memcpy_swc], [enable memcpy_swc  @<:@default=enabled@:>@]),
+  [memcpy_swc=$enableval],
+  [memcpy_swc=no])
+AC_MSG_CHECKING([whether memcpy_swc is enabled])
+AC_MSG_RESULT([${memcpy_swc}])
+
+if test "x$memcpy_swc" != "xno";then
+    AC_DEFINE([HAVE_MEMCPY_SWC], [1], [Enable memcpy_swc])
+    have_memcpy_swc=yes
+else
+    AC_DEFINE([HAVE_MEMCPY_SWC], [0], [Disable memcpy_swc])
+    have_memcpy_swc=no
+fi
+AM_CONDITIONAL([HAVE_MEMCPY_SWC], [test "x${have_memcpy_swc}" = "xyes"])
+
 # Check for ttrace header files
 PKG_CHECK_MODULES(TTRACE,
                [ttrace],
index 234a1eb..dced820 100644 (file)
@@ -48,6 +48,18 @@ Requires:       pkgconfig(tizen-extension-server)
 %description devel
 Development files for enlightenment
 
+#use memcpy_swc only in arm 32bit mobile/wearable
+%ifarch %{arm}
+%if "%{?profile}" == "wearable"
+%define MEMCPY_SWC use
+%endif
+%if "%{?profile}" == "mobile"
+%define MEMCPY_SWC use
+%endif
+%else
+%define MEMCPY_SWC nouse
+%endif
+
 %prep
 %setup -q -n %{name}-%{version}
 cp %{SOURCE1001} .
@@ -59,18 +71,27 @@ export LDFLAGS+=" -pie "
 %autogen \
       --enable-function-trace \
       --enable-wayland \
+%if %{?MEMCPY_SWC} == use
+      --enable-memcpy_swc \
+%endif
       --enable-quick-init
 
 make %{?_smp_mflags}
 
 %install
 %make_install
+%if %{?MEMCPY_SWC} == use
+cp -af %{_builddir}/%{buildsubdir}/src/bin/libmemcpy_swc.so* %{buildroot}/%{_libdir}/
+%endif
 
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
 %license COPYING
 %attr(750,root,root) %{_bindir}/enlightenment*
+%if %{?MEMCPY_SWC} == use
+%{_libdir}/libmemcpy_swc.so*
+%endif
 %{_libdir}/enlightenment/*
 %{_datadir}/enlightenment/*
 %{_sysconfdir}/dbus-1/system.d/org.enlightenment.wm.conf
index b33539a..19f5513 100644 (file)
@@ -184,6 +184,9 @@ endif
 if HAVE_HWC
 src_bin_enlightenment_LDADD += @HWC_LIBS@
 endif
+if HAVE_MEMCPY_SWC
+src_bin_enlightenment_LDADD += -L$(top_srcdir)/src/bin -lmemcpy_swc
+endif
 
 src_bin_enlightenment_info_SOURCES = \
 src/bin/e.h \
index 396b7cb..e077622 100644 (file)
@@ -133,6 +133,10 @@ static Eina_Bool _e_comp_hwc_output_commit(E_Comp_Hwc_Output *hwc_output, E_Comp
 
 /* local subsystem functions */
 
+#if HAVE_MEMCPY_SWC
+extern void *memcpy_swc(void *dest, const void *src, size_t n);
+#endif
+
 static tbm_surface_h
 _e_comp_hwc_create_copied_surface(E_Client *ec, Eina_Bool refresh)
 {
@@ -162,7 +166,11 @@ _e_comp_hwc_create_copied_surface(E_Client *ec, Eina_Bool refresh)
    tbm_surface_unmap(new_tsurface);
 
    /* copy from src to dst */
+#if HAVE_MEMCPY_SWC
+   memcpy_swc(dst_info.planes[0].ptr, src_info.planes[0].ptr, src_info.planes[0].size);
+#else
    memcpy(dst_info.planes[0].ptr, src_info.planes[0].ptr, src_info.planes[0].size);
+#endif
 
    return new_tsurface;
 }
diff --git a/src/bin/libmemcpy_swc.so b/src/bin/libmemcpy_swc.so
new file mode 100644 (file)
index 0000000..4134c70
Binary files /dev/null and b/src/bin/libmemcpy_swc.so differ
diff --git a/src/bin/libmemcpy_swc.so.0 b/src/bin/libmemcpy_swc.so.0
new file mode 120000 (symlink)
index 0000000..56c53aa
--- /dev/null
@@ -0,0 +1 @@
+libmemcpy_swc.so
\ No newline at end of file