feature: introduce mechanism for detecting new vm bind flags support in xe path

https://github.com/intel/compute-runtime/pull/717

Related-To: NEO-10958
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-05-22 18:20:20 +00:00
committed by Compute-Runtime-Automation
parent 78bd3da078
commit 134702b38c
5 changed files with 39 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.h
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_query_hw_ip_version.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_vm_bind_flags.cpp
)
if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT)

View File

@@ -172,6 +172,7 @@ bool IoctlHelperXe::initialize() {
tileIdToGtId[gt.tile_id] = gt.gt_id;
}
}
querySupportedFeatures();
return true;
}
@@ -784,6 +785,7 @@ uint64_t IoctlHelperXe::getFlagsForVmBind(bool bindCapture, bool bindImmediate,
if (bindCapture) {
ret |= DRM_XE_VM_BIND_FLAG_DUMPABLE;
}
ret |= getAdditionalFlagsForVmBind(bindImmediate, readOnlyResource);
return ret;
}

View File

@@ -204,6 +204,21 @@ class IoctlHelperXe : public IoctlHelper {
uint64_t startOffset;
uint32_t drmContextId;
};
struct SupportedFeatures {
union {
struct {
uint32_t vmBindReadOnly : 1;
uint32_t vmBindImmediate : 1;
uint32_t reserved : 30;
} flags;
uint32_t allFlags = 0;
};
} supportedFeatures{};
static_assert(sizeof(SupportedFeatures::flags) == sizeof(SupportedFeatures::allFlags), "");
void querySupportedFeatures();
uint64_t getAdditionalFlagsForVmBind(bool bindImmediate, bool readOnlyResource);
};
template <typename... XeLogArgs>

View File

@@ -0,0 +1,16 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
namespace NEO {
void IoctlHelperXe::querySupportedFeatures(){};
uint64_t IoctlHelperXe::getAdditionalFlagsForVmBind(bool bindImmediate, bool readOnlyResource) {
return 0;
}
} // namespace NEO

View File

@@ -38,6 +38,7 @@ struct MockIoctlHelperXe : IoctlHelperXe {
using IoctlHelperXe::maxExecQueuePriority;
using IoctlHelperXe::queryGtListData;
using IoctlHelperXe::setContextProperties;
using IoctlHelperXe::supportedFeatures;
using IoctlHelperXe::UserFenceExtension;
using IoctlHelperXe::xeGetBindFlagsName;
using IoctlHelperXe::xeGetBindOperationName;
@@ -260,10 +261,10 @@ class DrmMockXe : public DrmMockCustom {
auto vmBindInput = static_cast<drm_xe_vm_bind *>(arg);
vmBindInputs.push_back(*vmBindInput);
EXPECT_EQ(1u, vmBindInput->num_syncs);
auto &syncInput = reinterpret_cast<drm_xe_sync *>(vmBindInput->syncs)[0];
syncInputs.push_back(syncInput);
if (vmBindInput->num_syncs == 1) {
auto &syncInput = reinterpret_cast<drm_xe_sync *>(vmBindInput->syncs)[0];
syncInputs.push_back(syncInput);
}
} break;
case DrmIoctl::gemWaitUserFence: {