mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
fix: setup ipVersion in linux paths
Get ipVersion from productHelper function on xe and upstream. On prelim first try to query ipVersion from kmd, if it fails, get ipVersion from productHelper function. Related-To: NEO-7786 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
103ad120ec
commit
4be9b7e609
@@ -437,6 +437,7 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
|
||||
|
||||
const auto productFamily = hwInfo->platform.eProductFamily;
|
||||
setupIoctlHelper(productFamily);
|
||||
ioctlHelper->setupIpVersion();
|
||||
|
||||
Drm::QueryTopologyData topologyData = {};
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "shared/source/os_interface/linux/i915.h"
|
||||
#include "shared/source/os_interface/linux/memory_info.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sstream>
|
||||
@@ -54,6 +55,13 @@ void IoctlHelper::fillExecObject(ExecObject &execObject, uint32_t handle, uint64
|
||||
}
|
||||
}
|
||||
|
||||
void IoctlHelper::setupIpVersion() {
|
||||
auto &rootDeviceEnvironment = drm.getRootDeviceEnvironment();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
hwInfo.ipVersion.value = productHelper.getProductConfigFromHwInfo(hwInfo);
|
||||
}
|
||||
|
||||
void IoctlHelper::logExecObject(const ExecObject &execObject, std::stringstream &logger, size_t size) {
|
||||
auto &drmExecObject = *reinterpret_cast<const drm_i915_gem_exec_object2 *>(execObject.data);
|
||||
logger << "Buffer Object = { handle: BO-" << drmExecObject.handle
|
||||
@@ -458,5 +466,4 @@ std::unique_ptr<EngineInfo> IoctlHelper::createEngineInfo(bool isSysmanEnabled)
|
||||
|
||||
return std::make_unique<EngineInfo>(&drm, tileCount, distanceInfos, queryItems, engines);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -29,6 +29,7 @@ struct HardwareInfo;
|
||||
struct HardwareIpVersion;
|
||||
struct EngineInfo;
|
||||
class MemoryInfo;
|
||||
struct RootDeviceEnvironment;
|
||||
|
||||
struct MemoryRegion {
|
||||
MemoryClassInstance region;
|
||||
@@ -143,6 +144,7 @@ class IoctlHelper {
|
||||
virtual bool getFabricLatency(uint32_t fabricId, uint32_t &latency, uint32_t &bandwidth) = 0;
|
||||
virtual bool isWaitBeforeBindRequired(bool bind) const = 0;
|
||||
virtual void *pciBarrierMmap() { return nullptr; };
|
||||
virtual void setupIpVersion();
|
||||
|
||||
uint32_t getFlagsForPrimeHandleToFd() const;
|
||||
virtual std::unique_ptr<MemoryInfo> createMemoryInfo();
|
||||
@@ -274,6 +276,7 @@ class IoctlHelperPrelim20 : public IoctlHelper {
|
||||
bool getFabricLatency(uint32_t fabricId, uint32_t &latency, uint32_t &bandwidth) override;
|
||||
bool isWaitBeforeBindRequired(bool bind) const override;
|
||||
void *pciBarrierMmap() override;
|
||||
void setupIpVersion() override;
|
||||
|
||||
protected:
|
||||
bool queryHwIpVersion(EngineClassInstance &engineInfo, HardwareIpVersion &ipVersion, int &ret);
|
||||
|
||||
@@ -781,7 +781,12 @@ bool IoctlHelperPrelim20::queryHwIpVersion(EngineClassInstance &engineInfo, Hard
|
||||
}
|
||||
|
||||
bool IoctlHelperPrelim20::initialize() {
|
||||
auto hwInfo = drm.getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
return true;
|
||||
}
|
||||
|
||||
void IoctlHelperPrelim20::setupIpVersion() {
|
||||
auto &rootDeviceEnvironment = drm.getRootDeviceEnvironment();
|
||||
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
EngineClassInstance engineInfo = {static_cast<uint16_t>(getDrmParamValue(DrmParam::EngineClassRender)), 0};
|
||||
int ret = 0;
|
||||
bool result = queryHwIpVersion(engineInfo, hwInfo->ipVersion, ret);
|
||||
@@ -793,7 +798,9 @@ bool IoctlHelperPrelim20::initialize() {
|
||||
"ioctl(PRELIM_DRM_I915_QUERY_HW_IP_VERSION) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
|
||||
}
|
||||
|
||||
return result;
|
||||
if (result == false) {
|
||||
IoctlHelper::setupIpVersion();
|
||||
}
|
||||
}
|
||||
|
||||
static_assert(sizeof(MemoryClassInstance) == sizeof(prelim_drm_i915_gem_memory_class_instance));
|
||||
|
||||
Reference in New Issue
Block a user