switch to libva 2.x
- support for libva 1.x has been dropped Change-Id: Ie5361b98cdd36144c9cd2a413c5fc2871655f333
This commit is contained in:
parent
c911e249f4
commit
1504d89571
|
@ -291,10 +291,12 @@ endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
pkg_check_modules(LIBVA QUIET libva)
|
pkg_check_modules(LIBVA libva>=1.0.0)
|
||||||
if(LIBVA_FOUND)
|
if(LIBVA_FOUND)
|
||||||
add_definitions(-DLIBVA)
|
include(CheckLibraryExists)
|
||||||
message(STATUS "Using libva")
|
CHECK_LIBRARY_EXISTS(va vaGetLibFunc ${LIBVA_LIBDIR} HAVE_VAGETLIBFUNC)
|
||||||
|
add_definitions(-DLIBVA ${LIBVA_CFLAGS})
|
||||||
|
message(STATUS "Using libva ")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ components:
|
||||||
branch: infra
|
branch: infra
|
||||||
clean_on_sync: true
|
clean_on_sync: true
|
||||||
dest_dir: infra
|
dest_dir: infra
|
||||||
revision: 0c42fcf3e4791d66736bc9901646686d776b6a90
|
revision: 52149a69da21a9b07558e2d6c4b79385ceeedcea
|
||||||
type: git
|
type: git
|
||||||
internal:
|
internal:
|
||||||
branch: master
|
branch: master
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, Intel Corporation
|
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
@ -27,7 +27,7 @@ namespace Os {
|
||||||
// Compiler library names
|
// Compiler library names
|
||||||
const char *frontEndDllName = "libigdfcl.so";
|
const char *frontEndDllName = "libigdfcl.so";
|
||||||
const char *igcDllName = "libigdccl.so";
|
const char *igcDllName = "libigdccl.so";
|
||||||
const char *libvaDllName = "libva.so.1";
|
const char *libvaDllName = "libva.so.2";
|
||||||
#endif //__linux__
|
#endif //__linux__
|
||||||
const char *sysFsPciPath = "/sys/bus/pci/devices/";
|
const char *sysFsPciPath = "/sys/bus/pci/devices/";
|
||||||
const char *tbxLibName = "libtbxAccess.so";
|
const char *tbxLibName = "libtbxAccess.so";
|
||||||
|
|
|
@ -31,6 +31,11 @@ set(IGDRCL_SRCS_linux_dll_tests
|
||||||
${IGDRCL_SOURCE_DIR}/runtime/os_interface/debug_settings_manager.cpp
|
${IGDRCL_SOURCE_DIR}/runtime/os_interface/debug_settings_manager.cpp
|
||||||
${IGDRCL_SOURCE_DIR}/runtime/dll/linux/drm_neo_create.cpp
|
${IGDRCL_SOURCE_DIR}/runtime/dll/linux/drm_neo_create.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(LIBVA_FOUND)
|
||||||
|
list(APPEND IGDRCL_SRCS_linux_dll_tests ${CMAKE_CURRENT_SOURCE_DIR}/va_tests.cpp)
|
||||||
|
endif(LIBVA_FOUND)
|
||||||
|
|
||||||
macro(macro_for_each_platform)
|
macro(macro_for_each_platform)
|
||||||
list(APPEND IGDRCL_SRCS_linux_dll_tests ${IGDRCL_SOURCE_DIR}/runtime/${GEN_TYPE_LOWER}/hw_info_${PLATFORM_IT_LOWER}.cpp)
|
list(APPEND IGDRCL_SRCS_linux_dll_tests ${IGDRCL_SOURCE_DIR}/runtime/${GEN_TYPE_LOWER}/hw_info_${PLATFORM_IT_LOWER}.cpp)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2018, Intel Corporation
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "test.h"
|
||||||
|
#include "runtime/sharings/va/va_sharing_functions.h"
|
||||||
|
#include "unit_tests/helpers/variable_backup.h"
|
||||||
|
|
||||||
|
using namespace OCLRT;
|
||||||
|
|
||||||
|
TEST(VaTests, whenLibvaSo2IsNotInstalledThenFail) {
|
||||||
|
VariableBackup<decltype(VASharingFunctions::fdlopen)> dlopenBackup(&VASharingFunctions::fdlopen);
|
||||||
|
VariableBackup<decltype(VASharingFunctions::fdlclose)> dlcloseBackup(&VASharingFunctions::fdlclose);
|
||||||
|
VariableBackup<decltype(VASharingFunctions::fdlsym)> dlsymBackup(&VASharingFunctions::fdlsym);
|
||||||
|
|
||||||
|
VASharingFunctions::fdlopen = [&](const char *filename, int flag) -> void * {
|
||||||
|
if (!strncmp(filename, "libva.so.2", 10)) {
|
||||||
|
return (void *)0xdeadbeef;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
VASharingFunctions::fdlclose = [&](void *handle) -> int {
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
VASharingFunctions::fdlsym = [&](void *handle, const char *symbol) -> void * {
|
||||||
|
return nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
VADisplay vaDisplay = nullptr;
|
||||||
|
VASharingFunctions va(vaDisplay);
|
||||||
|
|
||||||
|
EXPECT_EQ(true, va.isVaLibraryAvailable());
|
||||||
|
}
|
Loading…
Reference in New Issue