971.1.4
by Chad Miller
Testing 34.0.1820.2 . |
1 |
Description: GYP assumes ARMv7 always wants NEON, even if compile flags disable. |
768
by Chad Miller
debian/patches/arm-neon.patch added to get ARM w/o Neon support. |
2 |
Origin: http://code.google.com/p/chromium/issues/detail?id=154107 |
800
by Chad Miller
* debian/patches/arm-neon.patch |
3 |
Author: Chad Miller <chad.miller@canonical.com> |
971.1.4
by Chad Miller
Testing 34.0.1820.2 . |
4 |
Bug-Chromium: 154107 |
5 |
Bug-Ubuntu: 1084852 |
|
768
by Chad Miller
debian/patches/arm-neon.patch added to get ARM w/o Neon support. |
6 |
|
985
by Chad Miller
Remove "src/" from patch destinations. |
7 |
--- a/third_party/webrtc/system_wrappers/source/cpu_features.cc
|
8 |
+++ b/third_party/webrtc/system_wrappers/source/cpu_features.cc
|
|
971.1.4
by Chad Miller
Testing 34.0.1820.2 . |
9 |
@@ -18,6 +18,47 @@
|
10 |
||
11 |
#include "webrtc/typedefs.h" |
|
12 |
||
13 |
+#include <elf.h>
|
|
14 |
+#ifdef __arm__
|
|
15 |
+#include <fcntl.h>
|
|
16 |
+#include <unistd.h>
|
|
17 |
+#include <linux/auxvec.h>
|
|
18 |
+#include <asm/hwcap.h>
|
|
19 |
+#endif
|
|
20 |
+
|
|
21 |
+#ifdef __arm__
|
|
22 |
+uint64_t WebRtc_GetCPUFeaturesARM() {
|
|
23 |
+ static bool detected = false;
|
|
24 |
+ static uint64_t have_neon = 0;
|
|
25 |
+
|
|
26 |
+ int fd;
|
|
27 |
+ Elf32_auxv_t auxv;
|
|
28 |
+ unsigned int hwcaps;
|
|
29 |
+
|
|
30 |
+ if (!detected) {
|
|
31 |
+ int fd;
|
|
32 |
+ Elf32_auxv_t auxv;
|
|
33 |
+ unsigned int hwcaps;
|
|
34 |
+
|
|
35 |
+ fd = open("/proc/self/auxv", O_RDONLY);
|
|
36 |
+ if (fd >= 0) {
|
|
37 |
+ while (read(fd, &auxv, sizeof(Elf32_auxv_t)) == sizeof(Elf32_auxv_t)) {
|
|
38 |
+ if (auxv.a_type == AT_HWCAP) {
|
|
39 |
+ have_neon = (auxv.a_un.a_val & HWCAP_NEON) ? kCPUFeatureNEON : 0;
|
|
40 |
+ break;
|
|
41 |
+ }
|
|
42 |
+ }
|
|
43 |
+ close (fd);
|
|
44 |
+ } else {
|
|
45 |
+ have_neon = 0;
|
|
46 |
+ }
|
|
47 |
+ detected = true;
|
|
48 |
+ }
|
|
49 |
+
|
|
50 |
+ return 0 | have_neon; // others here as we need them
|
|
897
by Chad Miller
- Return to using no explicity NEON fpu, and instead try to detect at |
51 |
+}
|
971.1.4
by Chad Miller
Testing 34.0.1820.2 . |
52 |
+#endif
|
897
by Chad Miller
- Return to using no explicity NEON fpu, and instead try to detect at |
53 |
+
|
971.1.4
by Chad Miller
Testing 34.0.1820.2 . |
54 |
// No CPU feature is available => straight C path. |
55 |
int GetCPUInfoNoASM(CPUFeature feature) { |
|
56 |
(void)feature; |