feature: enable xe drm detection by default

driver is built with xe drm support by default

added cmake flag to control xe eu debug API support
NEO_ENABLE_XE_EU_DEBUG_SUPPORT

This flag is disabled by default and uapi-eu-debug headers are not
needed for driver compilation as these headers are not a part of
upstream kernel yet.

Related-To: NEO-10780

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-03-18 14:29:33 +00:00
committed by Compute-Runtime-Automation
parent fb838afe42
commit a2742492ab
17 changed files with 129 additions and 81 deletions

View File

@@ -40,7 +40,6 @@ set(NEO_CORE_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_operations_handler_default.h
${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_operations_handler_with_aub_dump.h
${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_manager_create_multi_host_allocation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_version.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers_checks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers.h
@@ -134,11 +133,5 @@ if("${BRANCH_TYPE}" STREQUAL "")
endif()
endif()
if(NEO_ENABLE_XE_DRM_DETECTION)
list(REMOVE_ITEM NEO_CORE_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/drm_version.cpp
)
endif()
set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX})
add_subdirectories()

View File

@@ -1,20 +0,0 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/drm_neo.h"
namespace NEO {
bool Drm::isDrmSupported(int fileDescriptor) {
auto drmVersion = Drm::getDrmVersion(fileDescriptor);
return "i915" == drmVersion;
}
bool Drm::queryDeviceIdAndRevision() {
return queryI915DeviceIdAndRevision();
}
} // namespace NEO

View File

@@ -4,17 +4,24 @@
# SPDX-License-Identifier: MIT
#
if(NEO_ENABLE_XE_DRM_DETECTION)
set(NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/drm_version_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_debugger.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_xe_string_value_getter.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_xe_vm_export.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_xe_perf.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.h
)
set(NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/drm_version_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_xe_string_value_getter.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_xe_vm_export.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_xe_perf.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.h
)
set_property(GLOBAL APPEND PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX_XE})
if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT)
list(APPEND NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_debugger.cpp
)
else()
list(APPEND NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_debugger_stubs.cpp
)
endif()
set_property(GLOBAL APPEND PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX_XE})

View File

@@ -0,0 +1,71 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
namespace NEO {
unsigned int IoctlHelperXe::getIoctlRequestValueDebugger(DrmIoctl ioctlRequest) const {
UNRECOVERABLE_IF(true);
return 0;
}
int IoctlHelperXe::debuggerOpenIoctl(DrmIoctl request, void *arg) {
UNRECOVERABLE_IF(true);
return 0;
}
int IoctlHelperXe::debuggerMetadataCreateIoctl(DrmIoctl request, void *arg) {
UNRECOVERABLE_IF(true);
return 0;
}
int IoctlHelperXe::debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg) {
UNRECOVERABLE_IF(true);
return 0;
}
void *IoctlHelperXe::allocateDebugMetadata() {
UNRECOVERABLE_IF(true);
return nullptr;
}
void *IoctlHelperXe::freeDebugMetadata(void *metadata) {
UNRECOVERABLE_IF(true);
return nullptr;
}
void IoctlHelperXe::addDebugMetadataCookie(uint64_t cookie) {
}
void IoctlHelperXe::addDebugMetadata(DrmResourceClass type, uint64_t *offset, uint64_t size) {
}
int IoctlHelperXe::getRunaloneExtProperty() {
UNRECOVERABLE_IF(true);
return 0;
}
int IoctlHelperXe::getEuDebugSysFsEnable() {
UNRECOVERABLE_IF(true);
return 0;
}
uint32_t IoctlHelperXe::registerResource(DrmResourceClass classType, const void *data, size_t size) {
UNRECOVERABLE_IF(true);
return 0;
}
void IoctlHelperXe::unregisterResource(uint32_t handle) {
UNRECOVERABLE_IF(true);
}
std::unique_ptr<uint8_t[]> IoctlHelperXe::prepareVmBindExt(const StackVec<uint32_t, 2> &bindExtHandles) {
return {};
}
} // namespace NEO