diff --git a/CMakeLists.txt b/CMakeLists.txt index d0410c98e4..0dfdefd397 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -754,6 +754,13 @@ else() set(NEO_EXTRA_LIBS dl pthread rt) endif() +if(UNIX) + # prelim headers detection + if((NOT DEFINED NEO_ENABLE_i915_PRELIM_DETECTION) OR NOT ("${BRANCH_TYPE}" STREQUAL "")) + set(NEO_ENABLE_i915_PRELIM_DETECTION TRUE) + endif() + message(STATUS "i915 prelim headers detection: ${NEO_ENABLE_i915_PRELIM_DETECTION}") +endif() add_subdirectory_unique(shared) if(NEO_BUILD_WITH_OCL) diff --git a/opencl/test/unit_test/os_interface/linux/CMakeLists.txt b/opencl/test/unit_test/os_interface/linux/CMakeLists.txt index 7fd59d5d95..f98d041fcc 100644 --- a/opencl/test/unit_test/os_interface/linux/CMakeLists.txt +++ b/opencl/test/unit_test/os_interface/linux/CMakeLists.txt @@ -34,8 +34,6 @@ set(IGDRCL_SRCS_tests_os_interface_linux ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_linux_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_linux_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/linux_create_command_queue_with_properties_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_prelim.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/prelim_helper_func.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_os_time_linux.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_linux.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_linux.h @@ -52,11 +50,18 @@ if(NEO__LIBVA_FOUND) ) endif() -if(TESTS_DG1 AND "${BRANCH_TYPE}" STREQUAL "") +if(NEO_ENABLE_i915_PRELIM_DETECTION) list(APPEND IGDRCL_SRCS_tests_os_interface_linux - ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_dg1.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/drm_mock_prod_dg1.h + ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_prelim.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/prelim_helper_func.cpp ) + + if(TESTS_DG1 AND "${BRANCH_TYPE}" STREQUAL "") + list(APPEND IGDRCL_SRCS_tests_os_interface_linux + ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_dg1.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/drm_mock_prod_dg1.h + ) + endif() endif() if("${BRANCH_TYPE}" STREQUAL "") diff --git a/shared/source/os_interface/linux/CMakeLists.txt b/shared/source/os_interface/linux/CMakeLists.txt index 93ff0b8017..67d9f067fe 100644 --- a/shared/source/os_interface/linux/CMakeLists.txt +++ b/shared/source/os_interface/linux/CMakeLists.txt @@ -88,6 +88,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/pmt_util.cpp ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/system_info_extended.cpp ) + if(SUPPORT_XEHP_AND_LATER) list(APPEND NEO_CORE_OS_INTERFACE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/drm_command_stream_xehp_and_later.inl @@ -110,6 +111,14 @@ if("${BRANCH_TYPE}" STREQUAL "") list(APPEND NEO_CORE_OS_INTERFACE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_upstream.cpp ) + if(NOT NEO_ENABLE_i915_PRELIM_DETECTION) + list(APPEND NEO_CORE_OS_INTERFACE_LINUX + ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_getter_upstream.cpp + ) + list(REMOVE_ITEM NEO_CORE_OS_INTERFACE_LINUX + ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_getter.cpp + ) + endif() endif() set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX}) diff --git a/shared/source/os_interface/linux/ioctl_helper_getter_upstream.cpp b/shared/source/os_interface/linux/ioctl_helper_getter_upstream.cpp new file mode 100644 index 0000000000..853286db91 --- /dev/null +++ b/shared/source/os_interface/linux/ioctl_helper_getter_upstream.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/linux/ioctl_helper.h" + +#include + +namespace NEO { +IoctlHelper *ioctlHelperFactory[IGFX_MAX_PRODUCT] = {}; +static auto ioctlHelper = std::make_unique(); +IoctlHelper *IoctlHelper::get(Drm *drm) { + return ioctlHelper.get(); +} + +} // namespace NEO