Improve ftr/wa flags packing

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-11-25 09:31:14 +00:00
committed by Compute-Runtime-Automation
parent 1da896bee0
commit 995cb88bfa
160 changed files with 1777 additions and 1765 deletions

View File

@ -21,8 +21,8 @@ uint64_t HwInfoConfigHw<gfxProduct>::getCrossDeviceSharedMemCapabilities() {
template <PRODUCT_FAMILY gfxProduct>
void HwInfoConfigHw<gfxProduct>::enableRenderCompression(HardwareInfo *hwInfo) {
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression;
}
template <PRODUCT_FAMILY gfxProduct>

View File

@ -20,8 +20,8 @@ uint64_t HwInfoConfigHw<gfxProduct>::getCrossDeviceSharedMemCapabilities() {
template <PRODUCT_FAMILY gfxProduct>
void HwInfoConfigHw<gfxProduct>::enableRenderCompression(HardwareInfo *hwInfo) {
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression;
}
template <PRODUCT_FAMILY gfxProduct>

View File

@ -127,12 +127,12 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
gtSystemInfo->MaxSlicesSupported = topologyData.maxSliceCount;
uint64_t gttSizeQuery = 0;
featureTable->ftrSVM = true;
featureTable->flags.ftrSVM = true;
ret = drm->queryGttSize(gttSizeQuery);
if (ret == 0) {
featureTable->ftrSVM = (gttSizeQuery > MemoryConstants::max64BitAppAddress);
featureTable->flags.ftrSVM = (gttSizeQuery > MemoryConstants::max64BitAppAddress);
outHwInfo->capabilityTable.gpuAddressSpace = gttSizeQuery - 1; // gttSizeQuery = (1 << bits)
}
@ -145,15 +145,15 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
return -1;
}
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;
featureTable->flags.ftrGTA = (gtType == GTTYPE_GTA) ? 1 : 0;
featureTable->flags.ftrGTC = (gtType == GTTYPE_GTC) ? 1 : 0;
featureTable->flags.ftrGTX = (gtType == GTTYPE_GTX) ? 1 : 0;
featureTable->flags.ftrGT1 = (gtType == GTTYPE_GT1) ? 1 : 0;
featureTable->flags.ftrGT1_5 = (gtType == GTTYPE_GT1_5) ? 1 : 0;
featureTable->flags.ftrGT2 = (gtType == GTTYPE_GT2) ? 1 : 0;
featureTable->flags.ftrGT2_5 = (gtType == GTTYPE_GT2_5) ? 1 : 0;
featureTable->flags.ftrGT3 = (gtType == GTTYPE_GT3) ? 1 : 0;
featureTable->flags.ftrGT4 = (gtType == GTTYPE_GT4) ? 1 : 0;
ret = configureHardwareCustom(outHwInfo, osIface);
if (ret != 0) {
@ -161,10 +161,10 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
return ret;
}
configureCacheInfo(outHwInfo);
featureTable->ftrEDram = (gtSystemInfo->EdramSizeInKb != 0) ? 1 : 0;
featureTable->flags.ftrEDram = (gtSystemInfo->EdramSizeInKb != 0) ? 1 : 0;
outHwInfo->capabilityTable.maxRenderFrequency = maxGpuFreq;
outHwInfo->capabilityTable.ftrSvm = featureTable->ftrSVM;
outHwInfo->capabilityTable.ftrSvm = featureTable->flags.ftrSVM;
HwHelper &hwHelper = HwHelper::get(platform->eRenderCoreFamily);
outHwInfo->capabilityTable.ftrSupportsCoherency = false;
@ -179,8 +179,8 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(outHwInfo->platform.eProductFamily);
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
compilerHwInfoConfig->isMidThreadPreemptionSupported(*outHwInfo) && preemption,
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt) && preemption);
static_cast<bool>(outHwInfo->featureTable.flags.ftrGpGpuThreadGroupLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->featureTable.flags.ftrGpGpuMidBatchPreempt) && preemption);
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte;
hwHelper.adjustPreemptionSurfaceSize(outHwInfo->capabilityTable.requiredPreemptionSurfaceSize);

View File

@ -21,18 +21,18 @@ int HwInfoConfig::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo
auto &hwHelper = HwHelper::get(outHwInfo->platform.eRenderCoreFamily);
auto &hwInfoConfig = *HwInfoConfig::get(outHwInfo->platform.eProductFamily);
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(outHwInfo->platform.eProductFamily);
outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.ftrSVM;
outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.flags.ftrSVM;
hwHelper.adjustDefaultEngineType(outHwInfo);
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
hwInfoConfig.setCapabilityCoherencyFlag(*outHwInfo, outHwInfo->capabilityTable.ftrSupportsCoherency);
outHwInfo->capabilityTable.ftrSupportsCoherency &= inHwInfo->featureTable.ftrL3IACoherency;
outHwInfo->capabilityTable.ftrSupportsCoherency &= inHwInfo->featureTable.flags.ftrL3IACoherency;
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
compilerHwInfoConfig->isMidThreadPreemptionSupported(*outHwInfo),
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt),
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt));
static_cast<bool>(outHwInfo->featureTable.flags.ftrGpGpuThreadGroupLevelPreempt),
static_cast<bool>(outHwInfo->featureTable.flags.ftrGpGpuMidBatchPreempt));
if (DebugManager.flags.OverridePreemptionSurfaceSizeInMb.get() >= 0) {
outHwInfo->gtSystemInfo.CsrSizeInMb = static_cast<uint32_t>(DebugManager.flags.OverridePreemptionSurfaceSizeInMb.get());

View File

@ -83,7 +83,7 @@ bool tryWritePartitionLayoutWithinProcess(Wddm &wddm, GMM_GFX_PARTITIONING &part
}
bool adjustGfxPartitionLayout(GMM_GFX_PARTITIONING &partitionLayout, uint64_t gpuAddressSpace, uintptr_t minAllowedAddress, Wddm &wddm) {
bool requiresRepartitioning = (gpuAddressSpace == maxNBitValue(47)) && wddm.getFeatureTable().ftrCCSRing;
bool requiresRepartitioning = (gpuAddressSpace == maxNBitValue(47)) && wddm.getFeatureTable().flags.ftrCCSRing;
if (false == requiresRepartitioning) {
return true;
}
@ -221,7 +221,7 @@ bool Wddm::configureDeviceAddressSpace() {
}
uintptr_t addr = 0;
auto ret = gmmMemory->configureDevice(getAdapter(), device, getGdi()->escape, maxUsmSize, featureTable->ftrL3IACoherency, addr, false);
auto ret = gmmMemory->configureDevice(getAdapter(), device, getGdi()->escape, maxUsmSize, featureTable->flags.ftrL3IACoherency, addr, false);
return ret;
}

View File

@ -65,7 +65,7 @@ bool Wddm::configureDeviceAddressSpace() {
: 0u;
bool obtainMinAddress = rootDeviceEnvironment.getHardwareInfo()->platform.eRenderCoreFamily == IGFX_GEN12LP_CORE;
return gmmMemory->configureDevice(getAdapter(), device, getGdi()->escape, svmSize, featureTable->ftrL3IACoherency, minAddress, obtainMinAddress);
return gmmMemory->configureDevice(getAdapter(), device, getGdi()->escape, svmSize, featureTable->flags.ftrL3IACoherency, minAddress, obtainMinAddress);
}
} // namespace NEO

View File

@ -370,7 +370,7 @@ bool Wddm::evict(const D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_
sizeToTrim = Evict.NumBytesToTrim;
kmDafListener->notifyEvict(featureTable->ftrKmdDaf, getAdapter(), device, handleList, numOfHandles, getGdi()->escape);
kmDafListener->notifyEvict(featureTable->flags.ftrKmdDaf, getAdapter(), device, handleList, numOfHandles, getGdi()->escape);
return status == STATUS_SUCCESS;
}
@ -406,7 +406,7 @@ bool Wddm::makeResident(const D3DKMT_HANDLE *handles, uint32_t count, bool cantT
UNRECOVERABLE_IF(cantTrimFurther);
}
kmDafListener->notifyMakeResident(featureTable->ftrKmdDaf, getAdapter(), device, handles, count, getGdi()->escape);
kmDafListener->notifyMakeResident(featureTable->flags.ftrKmdDaf, getAdapter(), device, handles, count, getGdi()->escape);
return success;
}
@ -452,7 +452,7 @@ bool Wddm::mapGpuVirtualAddress(Gmm *gmm, D3DKMT_HANDLE handle, D3DGPU_VIRTUAL_A
return false;
}
kmDafListener->notifyMapGpuVA(featureTable->ftrKmdDaf, getAdapter(), device, handle, MapGPUVA.VirtualAddress, getGdi()->escape);
kmDafListener->notifyMapGpuVA(featureTable->flags.ftrKmdDaf, getAdapter(), device, handle, MapGPUVA.VirtualAddress, getGdi()->escape);
bool ret = true;
if (gmm->isCompressionEnabled && HwInfoConfig::get(gfxPlatform->eProductFamily)->isPageTableManagerSupported(*rootDeviceEnvironment.getHardwareInfo())) {
for (auto engine : rootDeviceEnvironment.executionEnvironment.memoryManager.get()->getRegisteredEngines()) {
@ -490,7 +490,7 @@ bool Wddm::freeGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS &gpuPtr, uint64_t size)
status = getGdi()->freeGpuVirtualAddress(&FreeGPUVA);
gpuPtr = static_cast<D3DGPU_VIRTUAL_ADDRESS>(0);
kmDafListener->notifyUnmapGpuVA(featureTable->ftrKmdDaf, getAdapter(), device, FreeGPUVA.BaseAddress, getGdi()->escape);
kmDafListener->notifyUnmapGpuVA(featureTable->flags.ftrKmdDaf, getAdapter(), device, FreeGPUVA.BaseAddress, getGdi()->escape);
return status == STATUS_SUCCESS;
}
@ -534,7 +534,7 @@ NTSTATUS Wddm::createAllocation(const void *alignedCpuPtr, const Gmm *gmm, D3DKM
}
*outSharedHandle = castToUint64(ntSharedHandle);
}
kmDafListener->notifyWriteTarget(featureTable->ftrKmdDaf, getAdapter(), device, outHandle, getGdi()->escape);
kmDafListener->notifyWriteTarget(featureTable->flags.ftrKmdDaf, getAdapter(), device, outHandle, getGdi()->escape);
return status;
}
@ -634,7 +634,7 @@ NTSTATUS Wddm::createAllocationsAndMapGpuVa(OsHandleStorage &osHandles) {
allocationIndex++;
kmDafListener->notifyWriteTarget(featureTable->ftrKmdDaf, getAdapter(), device, AllocationInfo[i].hAllocation, getGdi()->escape);
kmDafListener->notifyWriteTarget(featureTable->flags.ftrKmdDaf, getAdapter(), device, AllocationInfo[i].hAllocation, getGdi()->escape);
}
status = STATUS_SUCCESS;
@ -782,11 +782,11 @@ void Wddm::unlockResource(const D3DKMT_HANDLE &handle) {
[[maybe_unused]] NTSTATUS status = getGdi()->unlock2(&unlock2);
DEBUG_BREAK_IF(status != STATUS_SUCCESS);
kmDafListener->notifyUnlock(featureTable->ftrKmdDaf, getAdapter(), device, &handle, 1, getGdi()->escape);
kmDafListener->notifyUnlock(featureTable->flags.ftrKmdDaf, getAdapter(), device, &handle, 1, getGdi()->escape);
}
void Wddm::kmDafLock(D3DKMT_HANDLE handle) {
kmDafListener->notifyLock(featureTable->ftrKmdDaf, getAdapter(), device, handle, 0, getGdi()->escape);
kmDafListener->notifyLock(featureTable->flags.ftrKmdDaf, getAdapter(), device, handle, 0, getGdi()->escape);
}
bool Wddm::createContext(OsContextWin &osContext) {
@ -1039,7 +1039,7 @@ void Wddm::updatePagingFenceValue(uint64_t newPagingFenceValue) {
}
WddmVersion Wddm::getWddmVersion() {
if (featureTable->ftrWddmHwQueues) {
if (featureTable->flags.ftrWddmHwQueues) {
return WddmVersion::WDDM_2_3;
} else {
return WddmVersion::WDDM_2_0;

View File

@ -86,7 +86,7 @@ class Wddm : public DriverModel {
MOCKABLE_VIRTUAL void *lockResource(const D3DKMT_HANDLE &handle, bool applyMakeResidentPriorToLock, size_t size);
MOCKABLE_VIRTUAL void unlockResource(const D3DKMT_HANDLE &handle);
MOCKABLE_VIRTUAL void kmDafLock(D3DKMT_HANDLE handle);
MOCKABLE_VIRTUAL bool isKmDafEnabled() const { return featureTable->ftrKmdDaf; }
MOCKABLE_VIRTUAL bool isKmDafEnabled() const { return featureTable->flags.ftrKmdDaf; }
MOCKABLE_VIRTUAL bool setAllocationPriority(const D3DKMT_HANDLE *handles, uint32_t allocationCount, uint32_t priority);