feature: add setupIpVersion for Xe

Related-To: NEO-10773

Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
Maciej Bielski
2024-03-27 16:55:20 +00:00
committed by Compute-Runtime-Automation
parent e09424f8b2
commit 8bef74133f
4 changed files with 40 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/drm_version_xe.cpp
${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
)
if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT)

View File

@@ -209,6 +209,8 @@ std::vector<DataType> IoctlHelperXe::queryData(uint32_t queryId) {
return retVal;
}
template std::vector<uint8_t> IoctlHelperXe::queryData(uint32_t queryId);
template std::vector<uint64_t> IoctlHelperXe::queryData(uint32_t queryId);
std::unique_ptr<EngineInfo> IoctlHelperXe::createEngineInfo(bool isSysmanEnabled) {
auto enginesData = queryData<uint64_t>(DRM_XE_DEVICE_QUERY_ENGINES);
@@ -331,6 +333,20 @@ size_t IoctlHelperXe::getLocalMemoryRegionsSize(const MemoryInfo *memoryInfo, ui
return size;
}
void IoctlHelperXe::setupIpVersion() {
auto &rootDeviceEnvironment = drm.getRootDeviceEnvironment();
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
if (auto hwIpVersion = GtIpVersion{}; queryHwIpVersion(hwIpVersion)) {
hwInfo->ipVersion.architecture = hwIpVersion.major;
hwInfo->ipVersion.release = hwIpVersion.minor;
hwInfo->ipVersion.revision = hwIpVersion.revision;
} else {
xeLog("No HW IP version received from drm_xe_gt. Falling back to default value.");
IoctlHelper::setupIpVersion();
}
}
bool IoctlHelperXe::setGpuCpuTimes(TimeStampData *pGpuCpuTime, OSTime *osTime) {
if (pGpuCpuTime == nullptr || osTime == nullptr) {
return false;

View File

@@ -106,6 +106,7 @@ class IoctlHelperXe : public IoctlHelper {
std::unique_ptr<EngineInfo> createEngineInfo(bool isSysmanEnabled) override;
std::unique_ptr<MemoryInfo> createMemoryInfo() override;
size_t getLocalMemoryRegionsSize(const MemoryInfo *memoryInfo, uint32_t subDevicesCount, uint32_t deviceBitfield) const override;
void setupIpVersion() override;
void getTopologyData(size_t nTiles, std::vector<std::bitset<8>> *geomDss, std::vector<std::bitset<8>> *computeDss, std::vector<std::bitset<8>> *euDss, DrmQueryTopologyData &topologyData, bool &isComputeDssEmpty);
void getTopologyMap(size_t nTiles, std::vector<std::bitset<8>> *dssInfo, TopologyMap &topologyMap);
@@ -159,6 +160,13 @@ class IoctlHelperXe : public IoctlHelper {
uint16_t getDefaultEngineClass(const aub_stream::EngineType &defaultEngineType);
virtual void setContextProperties(const OsContextLinux &osContext, void *extProperties, uint32_t &extIndexInOut);
struct GtIpVersion {
uint16_t major;
uint16_t minor;
uint16_t revision;
};
bool queryHwIpVersion(GtIpVersion &gtIpVersion);
int maxExecQueuePriority = 0;
std::mutex xeLock;
std::vector<BindInfo> bindInfo;

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
namespace NEO {
bool IoctlHelperXe::queryHwIpVersion(GtIpVersion &gtIpVersion) {
return false;
}
} // namespace NEO