Bug 1536538 - Enable libdav1d on Linux on beta. r=TD-Linux a=pascalc
authorAlex Chronopoulos <achronop@gmail.com>
Tue, 02 Apr 2019 15:37:27 +0300
changeset 525873 704467f7c23219aa77151371afb2e9f5460310a2
parent 525872 8184308efa35edc61ed6b187a5da0d683c85df77
child 525874 aef15903ef09c0aff907a19285891b017d4d87c5
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersTD-Linux, pascalc
bugs1536538
milestone67.0
Bug 1536538 - Enable libdav1d on Linux on beta. r=TD-Linux a=pascalc Reviewers: TD-Linux Subscribers: jya Bug #: 1536538 Differential Revision: https://phabricator.services.mozilla.com/D25359
media/libdav1d/asm/moz.build
media/libdav1d/config.h
media/libdav1d/moz.build
modules/libpref/init/all.js
--- a/media/libdav1d/asm/moz.build
+++ b/media/libdav1d/asm/moz.build
@@ -20,18 +20,16 @@ LOCAL_INCLUDES += [
 # see: third_party/dav1d/include/dav1d/common.h
 DEFINES['DAV1D_API'] = ''
 
 CFLAGS += [
     # find the config.h file.
     '-I%s/dist/include/dav1d/' % TOPOBJDIR,
 ]
 
-# This code is only built on Windows and Linux for now.
-
 # Attaching config.asm file
 if CONFIG['CPU_ARCH'] == 'x86':
     if CONFIG['OS_TARGET'] == 'WINNT':
         ASFLAGS += ['-I%s/media/libdav1d/asm/x86_32/win/' % TOPSRCDIR]
     else:
         ASFLAGS += ['-I%s/media/libdav1d/asm/x86_32/' % TOPSRCDIR]
 
 if CONFIG['CPU_ARCH'] == 'x86_64':
@@ -40,17 +38,17 @@ if CONFIG['CPU_ARCH'] == 'x86_64':
     elif CONFIG['OS_TARGET'] == 'Darwin':
         ASFLAGS += ['-I%s/media/libdav1d/asm/x86_64/osx/' % TOPSRCDIR]
     elif CONFIG['OS_TARGET'] == 'WINNT':
         ASFLAGS += ['-I%s/media/libdav1d/asm/x86_64/' % TOPSRCDIR]
     else:
         error('Platform %s is not expected' % CONFIG['OS_TARGET'])
 
     if CONFIG['OS_TARGET'] in ('Darwin', 'WINNT'):
-        # Change the default stack aligment (16) to 32
+        # Change the default stack alignment (16) to 32
         if CONFIG['CC_TYPE'] == 'clang':
             CFLAGS += ['-mstack-alignment=32']
         elif CONFIG['CC_TYPE'] == 'gcc':
             CFLAGS += ['-mpreferred-stack-boundary=5']
 
 if CONFIG['CPU_ARCH'] in ('x86', 'x86_64'):
     SOURCES += [
         '../../../third_party/dav1d/src/x86/cpu.c',
--- a/media/libdav1d/config.h
+++ b/media/libdav1d/config.h
@@ -47,18 +47,18 @@
 // (HAVE_MEMALIGN | HAVE_ALIGNED_MALLOC | HAVE_POSIX_MEMALIGN)
 // HAVE_UNISTD_H
 
 // Important when asm is enabled
 #if defined(__APPLE__) || (ARCH_x86_32 == 1 && defined(_WIN32))
 #  define PREFIX 1
 #endif
 
-#if (ARCH_x86_32 == 1 || ARCH_X86_64 == 1) && defined(__linux__) && \
-    !defined(__ANDROID__)
+#if ARCH_x86_32 == 1 || \
+    (ARCH_X86_64 == 1 && defined(__linux__) && !defined(__ANDROID__))
 #  define STACK_ALIGNMENT 16
 #else
 #  define STACK_ALIGNMENT 32
 #endif
 
 #if defined(_WIN32) || defined(__CYGWIN__)
 // _WIN32_WINNT 0x0601 is set in global macros
 #  define UNICODE 1
--- a/media/libdav1d/moz.build
+++ b/media/libdav1d/moz.build
@@ -25,20 +25,20 @@ entrypoint_source_files = [
 ]
 SOURCES += [f for f in entrypoint_source_files]
 
 # Don't export DAV1D_API symbols from libxul
 # see: third_party/dav1d/include/dav1d/common.h
 DEFINES['DAV1D_API'] = ''
 
 if CONFIG['MOZ_DAV1D_ASM']:
-    # Default stack aligment is 16 bytes
+    # Default stack alignment is 16 bytes
     DIRS += ['asm']
     if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin') and CONFIG['CPU_ARCH'] == 'x86_64':
-         # Update stack aligment to 32 bytes
+         # Update stack alignment to 32 bytes
          if CONFIG['CC_TYPE'] == 'clang':
              CFLAGS += ['-mstack-alignment=32']
              for ep in entrypoint_source_files:
                  SOURCES[ep].flags += ['-mstackrealign']
          elif CONFIG['CC_TYPE'] == 'gcc':
              CFLAGS += ['-mpreferred-stack-boundary=5']
              for ep in entrypoint_source_files:
                  SOURCES[ep].flags += ['-mincoming-stack-boundary=4']
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -660,17 +660,17 @@ pref("media.cubeb.sandbox", false);
 #if defined(XP_WIN) && !defined(_ARM64_)
 pref("media.av1.enabled", true);
 pref("media.av1.use-dav1d", true);
 #elif defined(XP_MACOSX)
 pref("media.av1.enabled", true);
 pref("media.av1.use-dav1d", true);
 #elif defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)
 pref("media.av1.enabled", true);
-pref("media.av1.use-dav1d", false);
+pref("media.av1.use-dav1d", true);
 #else
 pref("media.av1.enabled", false);
 pref("media.av1.use-dav1d", false);
 #endif
 #endif
 
 pref("media.webaudio.audiocontextoptions-samplerate.enabled", true);