From b7a97522aa4ffef96acb9181a8f18fec6df4fc11 Mon Sep 17 00:00:00 2001 From: "gunsoo83.kim" Date: Fri, 12 Sep 2014 17:06:22 +0900 Subject: [PATCH] configure: check vaapi/DXVA availability. - disable vaapi feature to verify Change-Id: I82937441c7e989d5c526677cacdb02bde4f431a7 Signed-off-by: gunsoo83.kim --- configure | 64 +++++++++++++++++++++++ tizen/emulator_configure.sh | 1 + tizen/src/hw/pci/Makefile.objs | 8 ++- tizen/src/hw/pci/maru_brillcodec_device.c | 1 - 4 files changed, 72 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8e06cf8986..b4feed2ca8 100755 --- 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 +#include +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 diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index e8730a3f7d..b56cff0f78 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -222,6 +222,7 @@ exec ./configure \ --audio-drv-list=winwave \ --enable-hax \ --disable-vnc \ + --enable-dxva2 \ $CONFIGURE_APPEND \ ;; Darwin*) diff --git a/tizen/src/hw/pci/Makefile.objs b/tizen/src/hw/pci/Makefile.objs index 0d2d6b3b76..511f6ae641 100644 --- a/tizen/src/hw/pci/Makefile.objs +++ b/tizen/src/hw/pci/Makefile.objs @@ -3,6 +3,8 @@ ifdef CONFIG_LINUX LIBS += -ldl endif obj-y += maru_brillcodec.o +obj-$(CONFIG_DXVA2) += maru_dxva2_plugin.o +obj-$(CONFIG_VAAPI) += maru_brillcodec_vaapi.o obj-y += maru_brightness.o @@ -12,7 +14,6 @@ obj-y += maru_camera_linux_pci.o LIBS += -lv4l2 -lv4lconvert endif ifdef CONFIG_WIN32 -obj-y += maru_dxva2_plugin.o obj-y += maru_camera_win32_pci.o LIBS += -lole32 -loleaut32 -luuid -lstrmiids endif @@ -26,4 +27,9 @@ endif maru_brillcodec.o-cflags := $(LIBAV_CFLAGS) maru_brillcodec_device.o-cflags := $(LIBAV_CFLAGS) +ifdef CONFIG_DXVA2 maru_dxva2_plugin.o-cflags := $(LIBAV_CFLAGS) +endif +ifdef CONFIG_VAAPI +maru_brillcodec_vaapi.o-cflags := $(LIBAV_CFLAGS) $(LIBVA_CFLAGS) +endif diff --git a/tizen/src/hw/pci/maru_brillcodec_device.c b/tizen/src/hw/pci/maru_brillcodec_device.c index 21ee8811c7..8e28171e19 100644 --- a/tizen/src/hw/pci/maru_brillcodec_device.c +++ b/tizen/src/hw/pci/maru_brillcodec_device.c @@ -30,7 +30,6 @@ //FIXME //#define CONFIG_VAAPI -//#define CONFIG_DXVA2 #ifdef CONFIG_VAAPI #include "dlfcn.h" -- 2.34.1