Merge branch 'features/brillcodec_2i' into 'tizen_next'
[sdk/emulator/qemu.git] / configure
index 20925ef..a88fa73 100755 (executable)
--- a/configure
+++ b/configure
@@ -325,6 +325,8 @@ maru="no"
 shm="no"
 libav="no"
 libpng="no"
+dxva2="no"
+vaapi="no"
 #
 glusterfs=""
 glusterfs_discard="no"
@@ -1105,6 +1107,10 @@ for opt do
   ;;
   --enable-libpng) libpng="yes"
   ;;
+  --enable-dxva2) dxva2="yes"
+  ;;
+  --enable-vaapi) vaapi="yes"
+  ;;
 #
   --disable-glusterfs) glusterfs="no"
   ;;
@@ -1421,6 +1427,8 @@ TIZEN-maru options:
   --enable-libav           enable libav library
   --disable-libav          disable libav library
   --enable-libpng          enable png library
+  --enable-dxva2           enable dxva2 support
+  --enable-vaapi           enable vaapi support
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -3976,6 +3984,53 @@ if compile_prog "" "" ; then
     getauxval=yes
 fi
 
+########################################
+# check if dxva2 is available.
+
+if test "$dxva2" = "yes" ; then
+    dxva2="no"
+if test "$mingw32" = "yes" ; then
+cat > $TMPC << EOF
+#include <d3d9.h>
+#include <dxva2api.h>
+int main(void) {
+#if !defined(IDirect3D9_CreateDevice) || \
+    !defined(IDirect3DDeviceManager9_ResetDevice)
+#error No DXVA2 support
+#endif
+    return 0;
+}
+EOF
+if compile_prog "" "" ; then
+    dxva2="yes"
+fi
+else
+    error_exit "DXVA2 is supported only on Windows"
+fi
+fi
+
+########################################
+# check if vaapi is available.
+
+if test "$vaapi" = "yes" ; then
+    vaapi="no"
+if test "$linux" = "yes" ; then
+    if $pkg_config libva --exists; then
+    if $pkg_config libva-x11 --exists; then
+        libva_cflags=`$pkg_config --cflags libva`
+        libva_libs=`$pkg_config --libs libva`
+        libva_x11_cflags=`$pkg_config --cflags libva-x11`
+        libva_x11_libs=`$pkg_config --libs libva-x11`
+
+        libs_softmmu="$libva_libs $libva_x11_libs $libs_softmmu"
+        vaapi="yes"
+    fi
+    fi
+else
+    error_exit "VAAPI is supported only on Linux"
+fi
+fi
+
 ##########################################
 # libav probe
 
@@ -4354,6 +4409,8 @@ echo "TIZEN-maru support $maru"
 echo "TIZEN-maru shared framebuffer support $shm"
 echo "TIZEN-maru libav support $libav"
 echo "TIZEN-maru libpng support $libpng"
+echo "TIZEN-maru DXVA2 support $dxva2"
+echo "TIZEN-maru vaapi support $vaapi"
 #
 
 if test "$sdl_too_old" = "yes"; then
@@ -4848,6 +4905,13 @@ if test "$libpng" = "yes" ; then
   echo "CONFIG_PNG=y" >> $config_host_mak
   echo "LIBPNG_CFLAGS=$libpng_cflags" >> $config_host_mak
 fi
+if test "$dxva2" = "yes" ; then
+  echo "CONFIG_DXVA2=y" >> $config_host_mak
+fi
+if test "$vaapi" = "yes" ; then
+  echo "CONFIG_VAAPI=y" >> $config_host_mak
+  echo "LIBVA_CFLAGS=$libva_cflags $libva_x11_cflags" >> $config_host_mak
+fi
 
 # TPM passthrough support?
 if test "$tpm" = "yes"; then