From ebfba1dc4aa37ae83368db67478e1a6aeca4293e Mon Sep 17 00:00:00 2001 From: Artur Harasimiuk Date: Sun, 4 Nov 2018 22:56:34 +0100 Subject: [PATCH] add libva to manifest Change-Id: I13f93a57754662a5f2d94a55fe23af0082b42de6 Signed-off-by: Artur Harasimiuk --- CMakeLists.txt | 55 +++++++++++++++++++++------ manifests/build.yml | 9 ----- manifests/manifest.yml | 9 ++++- runtime/sharings/va/CMakeLists.txt | 4 +- unit_tests/linux/CMakeLists.txt | 4 +- unit_tests/sharings/va/CMakeLists.txt | 22 ++--------- 6 files changed, 60 insertions(+), 43 deletions(-) delete mode 100644 manifests/build.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index fbd24c49fc..f9e8c24341 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,6 +355,50 @@ else() message(STATUS "Instrumentation library name: ${INSTRUMENTATION_LIB_NAME}") endif() +# LibVA detection +if(UNIX) + set(IGDRCL__LIBVA_IS_REQUIRED "") + if(IGDRCL_FORCE_USE_LIBVA) + set(IGDRCL__LIBVA_IS_REQUIRED "REQUIRED") + endif() + + if(DEFINED LIBVA_SOURCE_DIR) + get_filename_component(LIBVA_SOURCE_DIR "${LIBVA_SOURCE_DIR}" ABSOLUTE) + else() + get_filename_component(LIBVA_SOURCE_DIR_tmp "${CMAKE_SOURCE_DIR}/../libva" ABSOLUTE) + if(IS_DIRECTORY "${LIBVA_SOURCE_DIR_tmp}") + set(LIBVA_SOURCE_DIR "${LIBVA_SOURCE_DIR_tmp}") + endif() + endif() + + find_package(PkgConfig) + if(DEFINED LIBVA_SOURCE_DIR AND IS_DIRECTORY "${LIBVA_SOURCE_DIR}/lib/pkgconfig/") + set(OLD_PKG_CONFIG_PATH $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${LIBVA_SOURCE_DIR}/lib/pkgconfig/") + endif() + pkg_check_modules(IGDRCL__LIBVA ${IGDRCL__LIBVA_IS_REQUIRED} libva>=1.0.0) + include(CheckLibraryExists) + CHECK_LIBRARY_EXISTS(va vaGetLibFunc ${IGDRCL__LIBVA_LIBDIR} HAVE_VAGETLIBFUNC) + if(DEFINED LIBVA_SOURCE_DIR AND IS_DIRECTORY "${LIBVA_SOURCE_DIR}/lib/pkgconfig/") + set(ENV{PKG_CONFIG_PATH} ${OLD_PKG_CONFIG_PATH}) + endif() + + if(IGDRCL__LIBVA_FOUND) + add_definitions(-DLIBVA) + message(STATUS "Using libva ") + + if(DEFINED LIBVA_SOURCE_DIR AND IS_DIRECTORY "${LIBVA_SOURCE_DIR}/lib/pkgconfig/") + string(REPLACE "${IGDRCL__LIBVA_INCLUDEDIR}" "${LIBVA_SOURCE_DIR}/include" IGDRCL__LIBVA_INCLUDE_DIRS "${IGDRCL__LIBVA_INCLUDE_DIRS}") + string(REPLACE "${IGDRCL__LIBVA_LIBDIR}" "${LIBVA_SOURCE_DIR}/lib" IGDRCL__LIBVA_LIBDIR "${IGDRCL__LIBVA_LIBDIR}") + set(IGDRCL__LIBVA_LIBRARY_PATH "${IGDRCL__LIBVA_LIBDIR}") + endif() + + set(IGDRCL__LIBVA_INCLUDE_DIR ${IGDRCL__LIBVA_INCLUDE_DIRS}) + message(STATUS "LibVA include dirs: ${IGDRCL__LIBVA_INCLUDE_DIR}") + include_directories("${IGDRCL__LIBVA_INCLUDE_DIR}") + endif() +endif() + set(SLD_LIBRARY_NAME "igfxdbgxchg") if(NEO_BITS STREQUAL "64") set(SLD_LIBRARY_NAME "${SLD_LIBRARY_NAME}${NEO_BITS}") @@ -398,17 +442,6 @@ if(CCACHE_EXE_FOUND AND CCACHE_ALLOWED) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() -if(UNIX) - find_package(PkgConfig) - pkg_check_modules(LIBVA libva>=1.0.0) - if(LIBVA_FOUND) - include(CheckLibraryExists) - CHECK_LIBRARY_EXISTS(va vaGetLibFunc ${LIBVA_LIBDIR} HAVE_VAGETLIBFUNC) - add_definitions(-DLIBVA ${LIBVA_CFLAGS}) - message(STATUS "Using libva ") - endif() -endif() - # Miscs options option(IGDRCL_GCOV "generate gcov report" OFF) option(HAVE_TBX_SERVER "Compile TBX server from TbxAccess library" OFF) diff --git a/manifests/build.yml b/manifests/build.yml deleted file mode 100644 index df96baa7bf..0000000000 --- a/manifests/build.yml +++ /dev/null @@ -1,9 +0,0 @@ -components: - libva: - branch: libva - revision: c9bb65b - clean_on_sync: true - dest_dir: libva - type: git -converter: 1 -version: '1' diff --git a/manifests/manifest.yml b/manifests/manifest.yml index fd90229645..a72ce974ea 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -17,7 +17,7 @@ components: branch: infra clean_on_sync: true dest_dir: infra - revision: 2086eef58c8fd828e10667e546c58467f87a76a3 + revision: d427f430b72c723ff0ed922d0c16765470e0c68a type: git internal: branch: master @@ -30,6 +30,13 @@ components: dest_dir: kmdaf revision: 41563bc133da6e2fc81dc4c59468e050897d4654 type: git + libva: + branch: libva + clean_on_sync: true + dest_dir: libva + repository: https://github.com/intel/libva.git + revision: c9bb65b + type: git wdk: branch: wdk clean_on_sync: true diff --git a/runtime/sharings/va/CMakeLists.txt b/runtime/sharings/va/CMakeLists.txt index b5d43893f8..c4a2607083 100644 --- a/runtime/sharings/va/CMakeLists.txt +++ b/runtime/sharings/va/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -if(LIBVA_FOUND) +if(IGDRCL__LIBVA_FOUND) set(RUNTIME_SRCS_SHARINGS_VA ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cl_va_api.cpp @@ -17,4 +17,4 @@ if(LIBVA_FOUND) ${CMAKE_CURRENT_SOURCE_DIR}/va_surface.h ) target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_SHARINGS_VA}) -endif(LIBVA_FOUND) +endif(IGDRCL__LIBVA_FOUND) diff --git a/unit_tests/linux/CMakeLists.txt b/unit_tests/linux/CMakeLists.txt index dcd8ae545b..8cbf41c67a 100644 --- a/unit_tests/linux/CMakeLists.txt +++ b/unit_tests/linux/CMakeLists.txt @@ -23,9 +23,9 @@ set(IGDRCL_SRCS_linux_dll_tests ${IGDRCL_SOURCE_DIR}/runtime/dll/linux/options.cpp ) -if(LIBVA_FOUND) +if(IGDRCL__LIBVA_FOUND) list(APPEND IGDRCL_SRCS_linux_dll_tests ${CMAKE_CURRENT_SOURCE_DIR}/va_tests.cpp) -endif(LIBVA_FOUND) +endif(IGDRCL__LIBVA_FOUND) macro(macro_for_each_platform) list(APPEND IGDRCL_SRCS_linux_dll_tests ${IGDRCL_SOURCE_DIR}/runtime/${GEN_TYPE_LOWER}/hw_info_${PLATFORM_IT_LOWER}.inl) diff --git a/unit_tests/sharings/va/CMakeLists.txt b/unit_tests/sharings/va/CMakeLists.txt index 604676c57c..311edf4783 100644 --- a/unit_tests/sharings/va/CMakeLists.txt +++ b/unit_tests/sharings/va/CMakeLists.txt @@ -1,24 +1,10 @@ -# Copyright (c) 2017, 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: +# Copyright (C) 2017-2018 Intel Corporation # -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. +# SPDX-License-Identifier: MIT # -# 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. -if(LIBVA_FOUND) +if(IGDRCL__LIBVA_FOUND) set(IGDRCL_SRCS_tests_sharings_va ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cl_create_from_va_media_surface_tests.cpp @@ -34,4 +20,4 @@ if(LIBVA_FOUND) ${CMAKE_CURRENT_SOURCE_DIR}/va_sharing_tests.cpp ) target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_sharings_va}) -endif(LIBVA_FOUND) +endif(IGDRCL__LIBVA_FOUND)