Skip to content

Commit f45fadf

Browse files
Add cmake flag to disable i915 prelim headers detection
Related-To: NEO-6625 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
1 parent 9d8ce7a commit f45fadf

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,13 @@ else()
754754
set(NEO_EXTRA_LIBS dl pthread rt)
755755
endif()
756756

757+
if(UNIX)
758+
# prelim headers detection
759+
if((NOT DEFINED NEO_ENABLE_i915_PRELIM_DETECTION) OR NOT ("${BRANCH_TYPE}" STREQUAL ""))
760+
set(NEO_ENABLE_i915_PRELIM_DETECTION TRUE)
761+
endif()
762+
message(STATUS "i915 prelim headers detection: ${NEO_ENABLE_i915_PRELIM_DETECTION}")
763+
endif()
757764
add_subdirectory_unique(shared)
758765

759766
if(NEO_BUILD_WITH_OCL)

opencl/test/unit_test/os_interface/linux/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ set(IGDRCL_SRCS_tests_os_interface_linux
3434
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_linux_tests.cpp
3535
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_linux_tests.h
3636
${CMAKE_CURRENT_SOURCE_DIR}/linux_create_command_queue_with_properties_tests.cpp
37-
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_prelim.cpp
38-
${CMAKE_CURRENT_SOURCE_DIR}/prelim_helper_func.cpp
3937
${CMAKE_CURRENT_SOURCE_DIR}/mock_os_time_linux.h
4038
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_linux.cpp
4139
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_linux.h
@@ -52,11 +50,18 @@ if(NEO__LIBVA_FOUND)
5250
)
5351
endif()
5452

55-
if(TESTS_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
53+
if(NEO_ENABLE_i915_PRELIM_DETECTION)
5654
list(APPEND IGDRCL_SRCS_tests_os_interface_linux
57-
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_dg1.cpp
58-
${CMAKE_CURRENT_SOURCE_DIR}/drm_mock_prod_dg1.h
55+
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_prelim.cpp
56+
${CMAKE_CURRENT_SOURCE_DIR}/prelim_helper_func.cpp
5957
)
58+
59+
if(TESTS_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
60+
list(APPEND IGDRCL_SRCS_tests_os_interface_linux
61+
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_dg1.cpp
62+
${CMAKE_CURRENT_SOURCE_DIR}/drm_mock_prod_dg1.h
63+
)
64+
endif()
6065
endif()
6166

6267
if("${BRANCH_TYPE}" STREQUAL "")

shared/source/os_interface/linux/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX
8888
${CMAKE_CURRENT_SOURCE_DIR}/pmt_util.cpp
8989
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/system_info_extended.cpp
9090
)
91+
9192
if(SUPPORT_XEHP_AND_LATER)
9293
list(APPEND NEO_CORE_OS_INTERFACE_LINUX
9394
${CMAKE_CURRENT_SOURCE_DIR}/drm_command_stream_xehp_and_later.inl
@@ -110,6 +111,14 @@ if("${BRANCH_TYPE}" STREQUAL "")
110111
list(APPEND NEO_CORE_OS_INTERFACE_LINUX
111112
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_upstream.cpp
112113
)
114+
if(NOT NEO_ENABLE_i915_PRELIM_DETECTION)
115+
list(APPEND NEO_CORE_OS_INTERFACE_LINUX
116+
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_getter_upstream.cpp
117+
)
118+
list(REMOVE_ITEM NEO_CORE_OS_INTERFACE_LINUX
119+
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_getter.cpp
120+
)
121+
endif()
113122
endif()
114123

115124
set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX})
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (C) 2022 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/os_interface/linux/ioctl_helper.h"
9+
10+
#include <memory>
11+
12+
namespace NEO {
13+
IoctlHelper *ioctlHelperFactory[IGFX_MAX_PRODUCT] = {};
14+
static auto ioctlHelper = std::make_unique<IoctlHelperUpstream>();
15+
IoctlHelper *IoctlHelper::get(Drm *drm) {
16+
return ioctlHelper.get();
17+
}
18+
19+
} // namespace NEO

0 commit comments

Comments
 (0)