Rename HardwareInfo members

Change-Id: I85f56b677bafdd75dd958b488522393fc18b68af
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-05-08 16:00:24 +02:00
parent de988d067c
commit 0f87e9aa1a
193 changed files with 1793 additions and 1793 deletions

View File

@@ -27,9 +27,9 @@ bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, Execu
auto hardwareInfo = executionEnvironment.getMutableHardwareInfo();
*hardwareInfo = *hwInfoConst;
hardwareInfoSetup[hwInfoConst->pPlatform.eProductFamily](hardwareInfo, true, hwInfoConfig);
hardwareInfoSetup[hwInfoConst->platform.eProductFamily](hardwareInfo, true, hwInfoConfig);
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->pPlatform.eProductFamily);
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily);
hwConfig->configureHardwareCustom(hardwareInfo, nullptr);
numDevices = totalDeviceCount;

View File

@@ -40,7 +40,7 @@ bool DeviceFactory::getDevices(size_t &numDevices, ExecutionEnvironment &executi
auto hardwareInfo = executionEnvironment.getMutableHardwareInfo();
const HardwareInfo *pCurrDevice = platformDevices[devNum];
HwInfoConfig *hwConfig = HwInfoConfig::get(pCurrDevice->pPlatform.eProductFamily);
HwInfoConfig *hwConfig = HwInfoConfig::get(pCurrDevice->platform.eProductFamily);
if (hwConfig->configureHwInfo(pCurrDevice, hardwareInfo, executionEnvironment.osInterface.get())) {
return false;
}

View File

@@ -29,7 +29,7 @@ uint32_t bitExact(uint32_t value, uint32_t highBit, uint32_t lowBit) {
}
int configureCacheInfo(HardwareInfo *hwInfo) {
GT_SYSTEM_INFO *pSysInfo = &hwInfo->pSysInfo;
GT_SYSTEM_INFO *gtSystemInfo = &hwInfo->gtSystemInfo;
uint32_t type = 0;
uint32_t subleaf = 0;
@@ -57,7 +57,7 @@ int configureCacheInfo(HardwareInfo *hwInfo) {
size = sets * ways * partitions * linesize / 1024;
if (cachelevel == 3) {
pSysInfo->LLCCacheSizeInKb = size;
gtSystemInfo->LLCCacheSizeInKb = size;
}
subleaf++;
}
@@ -71,9 +71,9 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
Drm *drm = osIface->get()->getDrm();
*outHwInfo = *inHwInfo;
auto pPlatform = &outHwInfo->pPlatform;
auto pSysInfo = &outHwInfo->pSysInfo;
auto pSkuTable = &outHwInfo->pSkuTable;
auto platform = &outHwInfo->platform;
auto gtSystemInfo = &outHwInfo->gtSystemInfo;
auto featureTable = &outHwInfo->featureTable;
int val = 0;
ret = drm->getDeviceID(val);
@@ -81,13 +81,13 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
*outHwInfo = {};
return (ret == 0) ? -1 : ret;
}
pPlatform->usDeviceID = static_cast<unsigned short>(val);
platform->usDeviceID = static_cast<unsigned short>(val);
ret = drm->getDeviceRevID(val);
if (ret != 0) {
*outHwInfo = {};
return ret;
}
pPlatform->usRevId = static_cast<unsigned short>(val);
platform->usRevId = static_cast<unsigned short>(val);
int euCount;
ret = drm->getEuTotal(euCount);
@@ -95,9 +95,9 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
*outHwInfo = {};
return ret;
}
pSysInfo->EUCount = static_cast<uint32_t>(euCount);
gtSystemInfo->EUCount = static_cast<uint32_t>(euCount);
pSysInfo->ThreadCount = this->threadsPerEu * pSysInfo->EUCount;
gtSystemInfo->ThreadCount = this->threadsPerEu * gtSystemInfo->EUCount;
int subSliceCount;
ret = drm->getSubsliceTotal(subSliceCount);
@@ -105,9 +105,9 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
*outHwInfo = {};
return ret;
}
pSysInfo->SubSliceCount = static_cast<uint32_t>(subSliceCount);
gtSystemInfo->SubSliceCount = static_cast<uint32_t>(subSliceCount);
pSkuTable->ftrSVM = drm->is48BitAddressRangeSupported();
featureTable->ftrSVM = drm->is48BitAddressRangeSupported();
int maxGpuFreq = 0;
drm->getMaxGpuFrequency(maxGpuFreq);
@@ -117,16 +117,16 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
*outHwInfo = {};
return -1;
}
pPlatform->eGTType = gtType;
pSkuTable->ftrGTA = (gtType == GTTYPE_GTA) ? 1 : 0;
pSkuTable->ftrGTC = (gtType == GTTYPE_GTC) ? 1 : 0;
pSkuTable->ftrGTX = (gtType == GTTYPE_GTX) ? 1 : 0;
pSkuTable->ftrGT1 = (gtType == GTTYPE_GT1) ? 1 : 0;
pSkuTable->ftrGT1_5 = (gtType == GTTYPE_GT1_5) ? 1 : 0;
pSkuTable->ftrGT2 = (gtType == GTTYPE_GT2) ? 1 : 0;
pSkuTable->ftrGT2_5 = (gtType == GTTYPE_GT2_5) ? 1 : 0;
pSkuTable->ftrGT3 = (gtType == GTTYPE_GT3) ? 1 : 0;
pSkuTable->ftrGT4 = (gtType == GTTYPE_GT4) ? 1 : 0;
platform->eGTType = gtType;
featureTable->ftrGTA = (gtType == GTTYPE_GTA) ? 1 : 0;
featureTable->ftrGTC = (gtType == GTTYPE_GTC) ? 1 : 0;
featureTable->ftrGTX = (gtType == GTTYPE_GTX) ? 1 : 0;
featureTable->ftrGT1 = (gtType == GTTYPE_GT1) ? 1 : 0;
featureTable->ftrGT1_5 = (gtType == GTTYPE_GT1_5) ? 1 : 0;
featureTable->ftrGT2 = (gtType == GTTYPE_GT2) ? 1 : 0;
featureTable->ftrGT2_5 = (gtType == GTTYPE_GT2_5) ? 1 : 0;
featureTable->ftrGT3 = (gtType == GTTYPE_GT3) ? 1 : 0;
featureTable->ftrGT4 = (gtType == GTTYPE_GT4) ? 1 : 0;
ret = configureHardwareCustom(outHwInfo, osIface);
if (ret != 0) {
@@ -134,12 +134,12 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
return ret;
}
configureCacheInfo(outHwInfo);
pSkuTable->ftrEDram = (pSysInfo->EdramSizeInKb != 0) ? 1 : 0;
featureTable->ftrEDram = (gtSystemInfo->EdramSizeInKb != 0) ? 1 : 0;
outHwInfo->capabilityTable.maxRenderFrequency = maxGpuFreq;
outHwInfo->capabilityTable.ftrSvm = pSkuTable->ftrSVM;
outHwInfo->capabilityTable.ftrSvm = featureTable->ftrSVM;
HwHelper &hwHelper = HwHelper::get(pPlatform->eRenderCoreFamily);
HwHelper &hwHelper = HwHelper::get(platform->eRenderCoreFamily);
outHwInfo->capabilityTable.ftrSupportsCoherency = false;
hwHelper.adjustDefaultEngineType(outHwInfo);
@@ -153,10 +153,10 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
bool preemption = drm->isPreemptionSupported();
preemption = hwHelper.setupPreemptionRegisters(outHwInfo, preemption);
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
static_cast<bool>(outHwInfo->pSkuTable.ftrGpGpuMidThreadLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->pSkuTable.ftrGpGpuThreadGroupLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->pSkuTable.ftrGpGpuMidBatchPreempt) && preemption);
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->pSysInfo.CsrSizeInMb * MemoryConstants::megaByte;
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt) && preemption);
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte;
auto &kmdNotifyProperties = outHwInfo->capabilityTable.kmdNotifyProperties;
KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideEnableKmdNotify.get(), kmdNotifyProperties.enableKmdNotify);

View File

@@ -36,7 +36,7 @@ void PerformanceCountersLinux::initialize(const HardwareInfo *hwInfo) {
if (mdLibHandle) {
perfmonLoadConfigFunc = reinterpret_cast<perfmonLoadConfig_t>(dlsymFunc(mdLibHandle, "drm_intel_perfmon_load_config"));
}
setPlatformInfoFunc(hwInfo->pPlatform.eProductFamily, (void *)(&hwInfo->pSkuTable));
setPlatformInfoFunc(hwInfo->platform.eProductFamily, (void *)(&hwInfo->featureTable));
}
void PerformanceCountersLinux::enableImpl() {

View File

@@ -58,8 +58,8 @@ void PerformanceCounters::shutdown() {
}
void PerformanceCounters::initialize(const HardwareInfo *hwInfo) {
useMIRPC = !(hwInfo->pWaTable.waDoNotUseMIReportPerfCount);
gfxFamily = hwInfo->pPlatform.eRenderCoreFamily;
useMIRPC = !(hwInfo->workaroundTable.waDoNotUseMIReportPerfCount);
gfxFamily = hwInfo->platform.eRenderCoreFamily;
if (getPerfCountersQueryDataFactory[gfxFamily] != nullptr) {
getPerfCountersQueryDataFunc = getPerfCountersQueryDataFactory[gfxFamily];

View File

@@ -36,7 +36,7 @@ bool DeviceFactory::getDevices(size_t &numDevices, ExecutionEnvironment &executi
executionEnvironment.osInterface.reset(new OSInterface());
executionEnvironment.osInterface->get()->setWddm(wddm.release());
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->pPlatform.eProductFamily);
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily);
if (hwConfig->configureHwInfo(hardwareInfo, hardwareInfo, nullptr)) {
return false;
}

View File

@@ -21,21 +21,21 @@ namespace NEO {
HwInfoConfig *hwInfoConfigFactory[IGFX_MAX_PRODUCT] = {};
int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *outHwInfo, OSInterface *osIface) {
HwHelper &hwHelper = HwHelper::get(outHwInfo->pPlatform.eRenderCoreFamily);
HwHelper &hwHelper = HwHelper::get(outHwInfo->platform.eRenderCoreFamily);
outHwInfo->capabilityTable.ftrSvm = outHwInfo->pSkuTable.ftrSVM;
outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.ftrSVM;
hwHelper.adjustDefaultEngineType(outHwInfo);
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
hwHelper.setCapabilityCoherencyFlag(outHwInfo, outHwInfo->capabilityTable.ftrSupportsCoherency);
hwHelper.setupPreemptionRegisters(outHwInfo, outHwInfo->pWaTable.waEnablePreemptionGranularityControlByUMD);
hwHelper.setupPreemptionRegisters(outHwInfo, outHwInfo->workaroundTable.waEnablePreemptionGranularityControlByUMD);
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
static_cast<bool>(outHwInfo->pSkuTable.ftrGpGpuMidThreadLevelPreempt),
static_cast<bool>(outHwInfo->pSkuTable.ftrGpGpuThreadGroupLevelPreempt),
static_cast<bool>(outHwInfo->pSkuTable.ftrGpGpuMidBatchPreempt));
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->pSysInfo.CsrSizeInMb * MemoryConstants::megaByte;
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt),
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt),
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt));
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte;
outHwInfo->capabilityTable.instrumentationEnabled &= haveInstrumentation;

View File

@@ -38,7 +38,7 @@ Wddm::VirtualFreeFcn Wddm::virtualFreeFnc = getVirtualFree();
Wddm::Wddm() {
featureTable.reset(new FeatureTable());
waTable.reset(new WorkaroundTable());
workaroundTable.reset(new WorkaroundTable());
gtSystemInfo.reset(new GT_SYSTEM_INFO);
gfxPlatform.reset(new PLATFORM);
memset(gtSystemInfo.get(), 0, sizeof(*gtSystemInfo));
@@ -74,10 +74,10 @@ bool Wddm::enumAdapters(HardwareInfo &outHardwareInfo) {
return false;
}
outHardwareInfo.pPlatform = *gfxPlatform;
outHardwareInfo.pSkuTable = *featureTable;
outHardwareInfo.pWaTable = *waTable;
outHardwareInfo.pSysInfo = *gtSystemInfo;
outHardwareInfo.platform = *gfxPlatform;
outHardwareInfo.featureTable = *featureTable;
outHardwareInfo.workaroundTable = *workaroundTable;
outHardwareInfo.gtSystemInfo = *gtSystemInfo;
outHardwareInfo.capabilityTable = hardwareInfoTable[productFamily]->capabilityTable;
outHardwareInfo.capabilityTable.maxRenderFrequency = maxRenderFrequency;
@@ -107,7 +107,7 @@ bool Wddm::queryAdapterInfo() {
memcpy_s(gfxPlatform.get(), sizeof(PLATFORM), &adapterInfo.GfxPlatform, sizeof(PLATFORM));
SkuInfoReceiver::receiveFtrTableFromAdapterInfo(featureTable.get(), &adapterInfo);
SkuInfoReceiver::receiveWaTableFromAdapterInfo(waTable.get(), &adapterInfo);
SkuInfoReceiver::receiveWaTableFromAdapterInfo(workaroundTable.get(), &adapterInfo);
memcpy_s(&gfxPartition, sizeof(gfxPartition), &adapterInfo.GfxPartition, sizeof(GMM_GFX_PARTITIONING));

View File

@@ -167,7 +167,7 @@ class Wddm {
std::unique_ptr<PLATFORM> gfxPlatform;
std::unique_ptr<GT_SYSTEM_INFO> gtSystemInfo;
std::unique_ptr<FeatureTable> featureTable;
std::unique_ptr<WorkaroundTable> waTable;
std::unique_ptr<WorkaroundTable> workaroundTable;
GMM_GFX_PARTITIONING gfxPartition;
uint64_t systemSharedMemory = 0;
uint32_t maxRenderFrequency = 0;