Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRDP/FreeRDP-old.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Moreau <marcandre.moreau@gmail.com>2011-06-15 04:15:39 +0400
committerMarc-André Moreau <marcandre.moreau@gmail.com>2011-06-15 04:15:39 +0400
commitd97abb85400db528b88bfc63426ed07babe1bbba (patch)
tree289f2ac05761b3e0d52868096cb531a6f452d419
parent6d5ef1413373ce380d7168974a42503053c097cb (diff)
libfreerdp-gdi: add SSE/NEON stubs
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac6
-rw-r--r--libfreerdp-gdi/Makefile.am15
-rw-r--r--libfreerdp-gdi/gdi.c3
-rw-r--r--libfreerdp-gdi/libgdi.c21
-rw-r--r--libfreerdp-gdi/libgdi.h35
-rw-r--r--libfreerdp-gdi/neon/Makefile.am25
-rw-r--r--libfreerdp-gdi/neon/gdi_neon.c32
-rw-r--r--libfreerdp-gdi/neon/gdi_neon.h31
-rw-r--r--libfreerdp-gdi/sse/Makefile.am25
-rw-r--r--libfreerdp-gdi/sse/gdi_sse.c32
-rw-r--r--libfreerdp-gdi/sse/gdi_sse.h31
-rw-r--r--libfreerdp-rfx/neon/rfx_neon.c2
-rw-r--r--libfreerdp-rfx/sse/rfx_sse.c9
14 files changed, 255 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index da6f4b7..551d18b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,8 +1,8 @@
## Process this file with automake to produce Makefile.in
REQUIRED_SUBDIRS = \
libfreerdp-asn1 \
- libfreerdp-gdi \
libfreerdp-rfx \
+ libfreerdp-gdi \
libfreerdp-utils \
libfreerdp-core \
docs \
diff --git a/configure.ac b/configure.ac
index 1f8cd1f..f3dcee4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1071,7 +1071,7 @@ AC_ARG_WITH(neon,
then
AM_CONDITIONAL(WITH_NEON, true)
AC_DEFINE(WITH_NEON,1)
- CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mfpu=neon"
fi
])
@@ -1169,10 +1169,12 @@ AC_CONFIG_FILES([
Makefile
freerdp.pc
libfreerdp-asn1/Makefile
-libfreerdp-gdi/Makefile
libfreerdp-rfx/Makefile
libfreerdp-rfx/sse/Makefile
libfreerdp-rfx/neon/Makefile
+libfreerdp-gdi/Makefile
+libfreerdp-gdi/sse/Makefile
+libfreerdp-gdi/neon/Makefile
libfreerdp-utils/Makefile
libfreerdp-core/Makefile
docs/Makefile
diff --git a/libfreerdp-gdi/Makefile.am b/libfreerdp-gdi/Makefile.am
index bda50bc..1725aa2 100644
--- a/libfreerdp-gdi/Makefile.am
+++ b/libfreerdp-gdi/Makefile.am
@@ -21,6 +21,7 @@ libfreerdp_gdi_la_SOURCES = \
gdi_8bpp.c gdi_8bpp.h \
color.c color.h \
decode.c decode.h \
+ libgdi.c libgdi.h \
gdi.c gdi.h
libfreerdp_gdi_la_CFLAGS = \
@@ -30,9 +31,21 @@ libfreerdp_gdi_la_CFLAGS = \
libfreerdp_gdi_la_LDFLAGS =
-libfreerdp_gdi_la_LIBDADD = \
+libfreerdp_gdi_la_LIBADD = \
../libfreerdp-rfx/libfreerdp-rfx.la
+if WITH_SSE
+SUBDIRS = sse
+libfreerdp_gdi_la_CFLAGS += -I./sse
+libfreerdp_gdi_la_LIBADD += ./sse/libfreerdp-gdi-sse.la
+endif
+
+if WITH_NEON
+SUBDIRS = neon
+libfreerdp_gdi_la_CFLAGS += -I./neon
+libfreerdp_gdi_la_LIBADD += ./neon/libfreerdp-gdi-neon.la
+endif
+
# extra
EXTRA_DIST =
diff --git a/libfreerdp-gdi/gdi.c b/libfreerdp-gdi/gdi.c
index 5dabee1..77ed1a1 100644
--- a/libfreerdp-gdi/gdi.c
+++ b/libfreerdp-gdi/gdi.c
@@ -26,6 +26,7 @@
#include "color.h"
#include "decode.h"
+#include "libgdi.h"
#include "gdi_dc.h"
#include "gdi_pen.h"
#include "gdi_line.h"
@@ -1204,6 +1205,8 @@ gdi_init(rdpInst * inst, uint32 flags)
gdi_register_callbacks(inst);
+ GDI_INIT_SIMD(gdi);
+
return 0;
}
diff --git a/libfreerdp-gdi/libgdi.c b/libfreerdp-gdi/libgdi.c
new file mode 100644
index 0000000..f5ce018
--- /dev/null
+++ b/libfreerdp-gdi/libgdi.c
@@ -0,0 +1,21 @@
+/*
+ FreeRDP: A Remote Desktop Protocol client.
+ GDI Library
+
+ Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#include "libgdi.h"
+
diff --git a/libfreerdp-gdi/libgdi.h b/libfreerdp-gdi/libgdi.h
new file mode 100644
index 0000000..22f48f1
--- /dev/null
+++ b/libfreerdp-gdi/libgdi.h
@@ -0,0 +1,35 @@
+/*
+ FreeRDP: A Remote Desktop Protocol client.
+ GDI Library
+
+ Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef __LIBGDI_H
+#define __LIBGDI_H
+
+#ifdef WITH_SSE
+#include "gdi_sse.h"
+#endif
+
+#ifdef WITH_NEON
+#include "gdi_neon.h"
+#endif
+
+#ifndef GDI_INIT_SIMD
+#define GDI_INIT_SIMD(_gdi) do { } while (0)
+#endif
+
+#endif /* __LIBGDI_H */
diff --git a/libfreerdp-gdi/neon/Makefile.am b/libfreerdp-gdi/neon/Makefile.am
new file mode 100644
index 0000000..27aee48
--- /dev/null
+++ b/libfreerdp-gdi/neon/Makefile.am
@@ -0,0 +1,25 @@
+## Process this file with automake to produce Makefile.in
+
+# libfreerdp-gdi-neon
+noinst_LTLIBRARIES = libfreerdp-gdi-neon.la
+
+libfreerdp_gdi_neon_la_SOURCES =
+
+if WITH_NEON
+libfreerdp_gdi_neon_la_SOURCES += \
+ gdi_neon.c gdi_neon.h
+endif
+
+libfreerdp_gdi_neon_la_CFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/include \
+ -I..
+
+libfreerdp_gdi_neon_la_LDFLAGS =
+
+libfreerdp_gdi_neon_la_LIBDADD =
+
+# extra
+EXTRA_DIST =
+
+DISTCLEANFILES =
diff --git a/libfreerdp-gdi/neon/gdi_neon.c b/libfreerdp-gdi/neon/gdi_neon.c
new file mode 100644
index 0000000..a0a92b7
--- /dev/null
+++ b/libfreerdp-gdi/neon/gdi_neon.c
@@ -0,0 +1,32 @@
+/*
+ FreeRDP: A Remote Desktop Protocol client.
+ GDI NEON Optimizations
+
+ Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <freerdp/freerdp.h>
+#include "gdi.h"
+
+#include "gdi_neon.h"
+
+void gdi_init_neon(GDI* gdi)
+{
+
+}
diff --git a/libfreerdp-gdi/neon/gdi_neon.h b/libfreerdp-gdi/neon/gdi_neon.h
new file mode 100644
index 0000000..ef94d46
--- /dev/null
+++ b/libfreerdp-gdi/neon/gdi_neon.h
@@ -0,0 +1,31 @@
+/*
+ FreeRDP: A Remote Desktop Protocol client.
+ GDI NEON Optimizations
+
+ Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef __GDI_NEON_H
+#define __GDI_NEON_H
+
+#include "gdi.h"
+
+void gdi_init_neon(GDI* gdi);
+
+#ifndef GDI_INIT_SIMD
+#define GDI_INIT_SIMD(_gdi) gdi_init_neon(_gdi)
+#endif
+
+#endif /* __GDI_NEON_H */
diff --git a/libfreerdp-gdi/sse/Makefile.am b/libfreerdp-gdi/sse/Makefile.am
new file mode 100644
index 0000000..23f6e27
--- /dev/null
+++ b/libfreerdp-gdi/sse/Makefile.am
@@ -0,0 +1,25 @@
+## Process this file with automake to produce Makefile.in
+
+# libfreerdp-gdi-sse
+noinst_LTLIBRARIES = libfreerdp-gdi-sse.la
+
+libfreerdp_gdi_sse_la_SOURCES =
+
+if WITH_SSE
+libfreerdp_gdi_sse_la_SOURCES += \
+ gdi_sse.c gdi_sse.h
+endif
+
+libfreerdp_gdi_sse_la_CFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/include \
+ -I..
+
+libfreerdp_gdi_sse_la_LDFLAGS =
+
+libfreerdp_gdi_sse_la_LIBDADD =
+
+# extra
+EXTRA_DIST =
+
+DISTCLEANFILES =
diff --git a/libfreerdp-gdi/sse/gdi_sse.c b/libfreerdp-gdi/sse/gdi_sse.c
new file mode 100644
index 0000000..fb0cc8a
--- /dev/null
+++ b/libfreerdp-gdi/sse/gdi_sse.c
@@ -0,0 +1,32 @@
+/*
+ FreeRDP: A Remote Desktop Protocol client.
+ GDI SSE Optimizations
+
+ Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <freerdp/freerdp.h>
+#include "gdi.h"
+
+#include "gdi_sse.h"
+
+void gdi_init_sse(GDI* gdi)
+{
+
+}
diff --git a/libfreerdp-gdi/sse/gdi_sse.h b/libfreerdp-gdi/sse/gdi_sse.h
new file mode 100644
index 0000000..e326503
--- /dev/null
+++ b/libfreerdp-gdi/sse/gdi_sse.h
@@ -0,0 +1,31 @@
+/*
+ FreeRDP: A Remote Desktop Protocol client.
+ GDI SSE Optimizations
+
+ Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef __GDI_SSE_H
+#define __GDI_SSE_H
+
+#include "gdi.h"
+
+void gdi_init_sse(GDI* gdi);
+
+#ifndef GDI_INIT_SIMD
+#define GDI_INIT_SIMD(_gdi) gdi_init_sse(_gdi)
+#endif
+
+#endif /* __GDI_SSE_H */
diff --git a/libfreerdp-rfx/neon/rfx_neon.c b/libfreerdp-rfx/neon/rfx_neon.c
index 48709b1..ff3fc5b 100644
--- a/libfreerdp-rfx/neon/rfx_neon.c
+++ b/libfreerdp-rfx/neon/rfx_neon.c
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
-#include "rfx_sse.h"
+#include "rfx_neon.h"
void rfx_init_neon(RFX_CONTEXT * context)
{
diff --git a/libfreerdp-rfx/sse/rfx_sse.c b/libfreerdp-rfx/sse/rfx_sse.c
index efd1cc3..3ccc9bf 100644
--- a/libfreerdp-rfx/sse/rfx_sse.c
+++ b/libfreerdp-rfx/sse/rfx_sse.c
@@ -21,19 +21,11 @@
#include <stdlib.h>
#include <string.h>
-#include "cpuid.h"
#include "rfx_sse2.h"
#include "rfx_sse.h"
-#define SFF_SSE 25
-#define SFF_SSE2 26
-
void rfx_init_sse(RFX_CONTEXT * context)
{
- int a,b,c,d;
- __cpuid(1,a,b,c,d);
- if (d & (1 << SFF_SSE2))
- {
DEBUG_RFX("Using SSE2 optimizations");
IF_PROFILER(context->prof_rfx_decode_YCbCr_to_RGB->name = "rfx_decode_YCbCr_to_RGB_SSE2");
@@ -43,5 +35,4 @@ void rfx_init_sse(RFX_CONTEXT * context)
context->decode_YCbCr_to_RGB = rfx_decode_YCbCr_to_RGB_SSE2;
context->quantization_decode = rfx_quantization_decode_SSE2;
context->dwt_2d_decode = rfx_dwt_2d_decode_SSE2;
- }
}