2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2024-05-24 01:12:14 +00:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/direct_submission/direct_submission_properties.h"
|
2022-12-06 15:59:36 +00:00
|
|
|
#include "shared/source/helpers/hw_ip_version.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/kmd_notify_properties.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
#include "gtsysinfo.h"
|
2018-07-18 14:11:05 +02:00
|
|
|
#include "igfxfmid.h"
|
2018-01-09 14:08:34 +01:00
|
|
|
#include "sku_info.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2023-09-12 09:23:51 +00:00
|
|
|
|
2022-11-25 15:04:24 +00:00
|
|
|
enum PreemptionMode : uint32_t;
|
2023-11-16 14:24:12 +00:00
|
|
|
class ReleaseHelper;
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
struct RuntimeCapabilityTable {
|
2020-01-15 17:02:47 +01:00
|
|
|
DirectSubmissionProperyEngines directSubmissionEngines;
|
2018-12-06 15:33:02 +01:00
|
|
|
KmdNotifyProperties kmdNotifyProperties;
|
|
|
|
|
uint64_t gpuAddressSpace;
|
2021-11-17 11:26:26 +00:00
|
|
|
uint64_t sharedSystemMemCapabilities;
|
2017-12-21 00:45:38 +01:00
|
|
|
double defaultProfilingTimerResolution;
|
2018-12-06 15:33:02 +01:00
|
|
|
size_t requiredPreemptionSurfaceSize;
|
2021-12-17 18:42:13 +00:00
|
|
|
const char *deviceName;
|
2023-09-12 09:23:51 +00:00
|
|
|
const char *preferredPlatformName;
|
2018-12-06 15:33:02 +01:00
|
|
|
PreemptionMode defaultPreemptionMode;
|
2019-03-27 10:06:29 +01:00
|
|
|
aub_stream::EngineType defaultEngineType;
|
2018-12-06 15:33:02 +01:00
|
|
|
uint32_t maxRenderFrequency;
|
2017-12-21 00:45:38 +01:00
|
|
|
unsigned int clVersionSupport;
|
2018-12-06 15:33:02 +01:00
|
|
|
uint32_t aubDeviceId;
|
|
|
|
|
uint32_t extraQuantityThreadsPerEU;
|
|
|
|
|
uint32_t slmSize;
|
2019-12-17 08:55:09 +01:00
|
|
|
uint32_t grfSize;
|
2020-09-29 23:00:00 -07:00
|
|
|
uint32_t timestampValidBits;
|
|
|
|
|
uint32_t kernelTimestampValidBits;
|
2019-04-16 09:06:37 +02:00
|
|
|
bool blitterOperationsSupported;
|
2019-08-20 15:17:10 +02:00
|
|
|
bool ftrSupportsInteger64BitAtomics;
|
2017-12-21 00:45:38 +01:00
|
|
|
bool ftrSupportsFP64;
|
2023-02-27 16:53:08 +00:00
|
|
|
bool ftrSupportsFP64Emulation;
|
2017-12-21 00:45:38 +01:00
|
|
|
bool ftrSupports64BitMath;
|
|
|
|
|
bool ftrSvm;
|
|
|
|
|
bool ftrSupportsCoherency;
|
|
|
|
|
bool ftrSupportsVmeAvcTextureSampler;
|
|
|
|
|
bool ftrSupportsVmeAvcPreemption;
|
2018-07-18 14:11:05 +02:00
|
|
|
bool ftrRenderCompressedBuffers;
|
|
|
|
|
bool ftrRenderCompressedImages;
|
2018-12-06 15:33:02 +01:00
|
|
|
bool ftr64KBpages;
|
2017-12-21 00:45:38 +01:00
|
|
|
bool instrumentationEnabled;
|
2018-10-24 06:59:36 -07:00
|
|
|
bool supportsVme;
|
2018-12-06 15:33:02 +01:00
|
|
|
bool supportCacheFlushAfterWalker;
|
2019-07-01 11:29:15 +02:00
|
|
|
bool supportsImages;
|
2019-07-15 15:08:42 +02:00
|
|
|
bool supportsDeviceEnqueue;
|
2020-04-29 14:51:40 +02:00
|
|
|
bool supportsPipes;
|
2020-04-30 15:47:43 +02:00
|
|
|
bool supportsOcl21Features;
|
2020-06-05 01:32:00 -07:00
|
|
|
bool supportsOnDemandPageFaults;
|
2020-06-18 15:07:58 +02:00
|
|
|
bool supportsIndependentForwardProgress;
|
2019-12-04 13:42:41 +01:00
|
|
|
bool hostPtrTrackingEnabled;
|
2020-04-11 16:07:22 -07:00
|
|
|
bool levelZeroSupported;
|
2020-08-10 22:33:58 -07:00
|
|
|
bool isIntegratedDevice;
|
2021-05-13 14:58:26 +00:00
|
|
|
bool supportsMediaBlock;
|
2022-02-01 01:46:54 +00:00
|
|
|
bool p2pAccessSupported;
|
|
|
|
|
bool p2pAtomicAccessSupported;
|
2021-06-18 15:23:10 +00:00
|
|
|
bool fusedEuEnabled;
|
2022-02-18 17:01:54 +00:00
|
|
|
bool l0DebuggerSupported;
|
2023-02-17 19:00:29 +00:00
|
|
|
bool supportsFloatAtomics;
|
2024-05-24 01:12:14 +00:00
|
|
|
uint32_t cxlType;
|
2017-12-21 00:45:38 +01:00
|
|
|
};
|
|
|
|
|
|
2021-10-22 12:01:47 +02:00
|
|
|
inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilityTable &rhs) {
|
|
|
|
|
bool result = 1;
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < (sizeof(lhs.directSubmissionEngines.data) / sizeof(*lhs.directSubmissionEngines.data)); ++i) {
|
|
|
|
|
result &= (lhs.directSubmissionEngines.data[i].engineSupported == rhs.directSubmissionEngines.data[i].engineSupported);
|
|
|
|
|
result &= (lhs.directSubmissionEngines.data[i].submitOnInit == rhs.directSubmissionEngines.data[i].submitOnInit);
|
|
|
|
|
result &= (lhs.directSubmissionEngines.data[i].useNonDefault == rhs.directSubmissionEngines.data[i].useNonDefault);
|
|
|
|
|
result &= (lhs.directSubmissionEngines.data[i].useRootDevice == rhs.directSubmissionEngines.data[i].useRootDevice);
|
|
|
|
|
result &= (lhs.directSubmissionEngines.data[i].useInternal == rhs.directSubmissionEngines.data[i].useInternal);
|
|
|
|
|
result &= (lhs.directSubmissionEngines.data[i].useLowPriority == rhs.directSubmissionEngines.data[i].useLowPriority);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result &= (lhs.kmdNotifyProperties.delayKmdNotifyMicroseconds == rhs.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
|
|
|
|
result &= (lhs.kmdNotifyProperties.delayQuickKmdSleepMicroseconds == rhs.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
|
|
|
|
result &= (lhs.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds == rhs.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
|
2021-12-17 18:42:13 +00:00
|
|
|
result &= (lhs.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission == rhs.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
|
|
|
|
result &= (lhs.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds == rhs.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
|
2021-10-22 12:01:47 +02:00
|
|
|
result &= (lhs.kmdNotifyProperties.enableKmdNotify == rhs.kmdNotifyProperties.enableKmdNotify);
|
|
|
|
|
result &= (lhs.kmdNotifyProperties.enableQuickKmdSleep == rhs.kmdNotifyProperties.enableQuickKmdSleep);
|
|
|
|
|
result &= (lhs.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits == rhs.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
|
|
|
|
result &= (lhs.gpuAddressSpace == rhs.gpuAddressSpace);
|
|
|
|
|
result &= (lhs.sharedSystemMemCapabilities == rhs.sharedSystemMemCapabilities);
|
|
|
|
|
result &= (lhs.defaultProfilingTimerResolution == rhs.defaultProfilingTimerResolution);
|
|
|
|
|
result &= (lhs.requiredPreemptionSurfaceSize == rhs.requiredPreemptionSurfaceSize);
|
|
|
|
|
result &= (lhs.defaultPreemptionMode == rhs.defaultPreemptionMode);
|
|
|
|
|
result &= (lhs.defaultEngineType == rhs.defaultEngineType);
|
|
|
|
|
result &= (lhs.maxRenderFrequency == rhs.maxRenderFrequency);
|
|
|
|
|
result &= (lhs.clVersionSupport == rhs.clVersionSupport);
|
|
|
|
|
result &= (lhs.aubDeviceId == rhs.aubDeviceId);
|
|
|
|
|
result &= (lhs.extraQuantityThreadsPerEU == rhs.extraQuantityThreadsPerEU);
|
|
|
|
|
result &= (lhs.slmSize == rhs.slmSize);
|
|
|
|
|
result &= (lhs.grfSize == rhs.grfSize);
|
|
|
|
|
result &= (lhs.timestampValidBits == rhs.timestampValidBits);
|
|
|
|
|
result &= (lhs.kernelTimestampValidBits == rhs.kernelTimestampValidBits);
|
|
|
|
|
result &= (lhs.blitterOperationsSupported == rhs.blitterOperationsSupported);
|
|
|
|
|
result &= (lhs.ftrSupportsInteger64BitAtomics == rhs.ftrSupportsInteger64BitAtomics);
|
|
|
|
|
result &= (lhs.ftrSupportsFP64 == rhs.ftrSupportsFP64);
|
2023-02-27 16:53:08 +00:00
|
|
|
result &= (lhs.ftrSupportsFP64Emulation == rhs.ftrSupportsFP64Emulation);
|
2021-10-22 12:01:47 +02:00
|
|
|
result &= (lhs.ftrSupports64BitMath == rhs.ftrSupports64BitMath);
|
|
|
|
|
result &= (lhs.ftrSvm == rhs.ftrSvm);
|
|
|
|
|
result &= (lhs.ftrSupportsCoherency == rhs.ftrSupportsCoherency);
|
|
|
|
|
result &= (lhs.ftrSupportsVmeAvcTextureSampler == rhs.ftrSupportsVmeAvcTextureSampler);
|
|
|
|
|
result &= (lhs.ftrSupportsVmeAvcPreemption == rhs.ftrSupportsVmeAvcPreemption);
|
|
|
|
|
result &= (lhs.ftrRenderCompressedBuffers == rhs.ftrRenderCompressedBuffers);
|
|
|
|
|
result &= (lhs.ftrRenderCompressedImages == rhs.ftrRenderCompressedImages);
|
|
|
|
|
result &= (lhs.ftr64KBpages == rhs.ftr64KBpages);
|
|
|
|
|
result &= (lhs.instrumentationEnabled == rhs.instrumentationEnabled);
|
|
|
|
|
result &= (lhs.deviceName == rhs.deviceName);
|
|
|
|
|
result &= (lhs.supportsVme == rhs.supportsVme);
|
|
|
|
|
result &= (lhs.supportCacheFlushAfterWalker == rhs.supportCacheFlushAfterWalker);
|
|
|
|
|
result &= (lhs.supportsImages == rhs.supportsImages);
|
|
|
|
|
result &= (lhs.supportsDeviceEnqueue == rhs.supportsDeviceEnqueue);
|
|
|
|
|
result &= (lhs.supportsPipes == rhs.supportsPipes);
|
|
|
|
|
result &= (lhs.supportsOcl21Features == rhs.supportsOcl21Features);
|
|
|
|
|
result &= (lhs.supportsOnDemandPageFaults == rhs.supportsOnDemandPageFaults);
|
|
|
|
|
result &= (lhs.supportsIndependentForwardProgress == rhs.supportsIndependentForwardProgress);
|
|
|
|
|
result &= (lhs.hostPtrTrackingEnabled == rhs.hostPtrTrackingEnabled);
|
|
|
|
|
result &= (lhs.levelZeroSupported == rhs.levelZeroSupported);
|
|
|
|
|
result &= (lhs.isIntegratedDevice == rhs.isIntegratedDevice);
|
|
|
|
|
result &= (lhs.supportsMediaBlock == rhs.supportsMediaBlock);
|
|
|
|
|
result &= (lhs.fusedEuEnabled == rhs.fusedEuEnabled);
|
2022-02-18 17:01:54 +00:00
|
|
|
result &= (lhs.l0DebuggerSupported == rhs.l0DebuggerSupported);
|
2023-02-17 19:00:29 +00:00
|
|
|
result &= (lhs.supportsFloatAtomics == rhs.supportsFloatAtomics);
|
2021-10-22 12:01:47 +02:00
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-13 11:13:33 +00:00
|
|
|
struct HardwareInfo { // NOLINT(clang-analyzer-optin.performance.Padding)
|
2018-06-12 09:42:47 +02:00
|
|
|
HardwareInfo() = default;
|
2019-05-08 16:00:24 +02:00
|
|
|
HardwareInfo(const PLATFORM *platform, const FeatureTable *featureTable, const WorkaroundTable *workaroundTable,
|
2023-07-31 12:48:31 +00:00
|
|
|
const GT_SYSTEM_INFO *gtSystemInfo, const RuntimeCapabilityTable &capabilityTable);
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2022-10-31 13:57:24 +00:00
|
|
|
PLATFORM platform{};
|
|
|
|
|
FeatureTable featureTable{};
|
|
|
|
|
WorkaroundTable workaroundTable{};
|
|
|
|
|
alignas(4) GT_SYSTEM_INFO gtSystemInfo{};
|
|
|
|
|
alignas(8) RuntimeCapabilityTable capabilityTable{};
|
2022-11-04 09:25:49 +00:00
|
|
|
alignas(8) HardwareIpVersion ipVersion{};
|
2017-12-21 00:45:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Global table of hardware prefixes
|
|
|
|
|
extern bool familyEnabled[IGFX_MAX_CORE];
|
2019-10-18 10:15:09 +02:00
|
|
|
extern const char *hardwarePrefix[IGFX_MAX_PRODUCT];
|
2017-12-21 00:45:38 +01:00
|
|
|
extern const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT];
|
2023-11-16 14:24:12 +00:00
|
|
|
extern void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
|
|
|
|
|
extern void (*hardwareInfoBaseSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
template <GFXCORE_FAMILY gfxFamily>
|
|
|
|
|
struct EnableGfxFamilyHw {
|
|
|
|
|
EnableGfxFamilyHw() {
|
|
|
|
|
familyEnabled[gfxFamily] = true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2019-07-18 11:58:30 +02:00
|
|
|
bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwInfoIn);
|
2020-01-24 17:19:06 +01:00
|
|
|
void setHwInfoValuesFromConfig(const uint64_t hwInfoConfig, HardwareInfo &hwInfoIn);
|
|
|
|
|
bool parseHwInfoConfigString(const std::string &hwInfoConfigStr, uint64_t &hwInfoConfig);
|
2019-03-27 10:06:29 +01:00
|
|
|
aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo);
|
2024-06-25 09:37:08 +00:00
|
|
|
void setupDefaultGtSysInfo(HardwareInfo *hwInfo, const ReleaseHelper *releaseHelper);
|
2024-06-27 09:58:09 +00:00
|
|
|
void setupDefaultFeatureTableAndWorkaroundTable(HardwareInfo *hwInfo);
|
2019-11-28 15:39:30 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|