Add check in allocateGraphicsMemory64kb to not use cpuPtr

when isRenderCompressed

Related-To: NEO-4532
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2020-11-04 14:55:09 +00:00
committed by Compute-Runtime-Automation
parent 4ce7c0e5f6
commit e060536a32
7 changed files with 152 additions and 8 deletions

View File

@@ -123,6 +123,18 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo) {
applyAuxFlagsForImage(imgInfo);
}
void Gmm::applyAuxFlagsForBuffer(bool preferRenderCompression) {
bool allowRenderCompression = HwHelper::renderCompressedBuffersSupported(*clientContext->getHardwareInfo()) &&
preferRenderCompression;
if (allowRenderCompression) {
resourceParams.Flags.Info.RenderCompressed = 1;
resourceParams.Flags.Gpu.CCS = 1;
resourceParams.Flags.Gpu.UnifiedAuxSurface = 1;
isRenderCompressed = true;
}
}
void Gmm::queryImageParams(ImageInfo &imgInfo) {
auto imageCount = this->gmmResourceInfo->getArraySize();
imgInfo.size = this->gmmResourceInfo->getSizeAllocation();

View File

@@ -12,6 +12,4 @@
using namespace NEO;
void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo) {}
void Gmm::applyAuxFlagsForBuffer(bool preferRenderCompression) {}
void Gmm::applyMemoryFlags(bool systemMemoryPool, StorageInfo &storageInfo) { this->useSystemMemoryPool = systemMemoryPool; }

View File

@@ -476,6 +476,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
return allocation;
}
bool use32Allocator = heapAssigner.use32BitHeap(allocationData.type);
if (use32Allocator ||
(force32bitAllocations && allocationData.flags.allow32Bit && is64bit)) {
auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHardwareInfo();

View File

@@ -115,13 +115,11 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemory64kb(const Allocati
return nullptr;
}
auto cpuPtr = lockResource(wddmAllocation.get());
auto cpuPtr = gmm->isRenderCompressed ? nullptr : lockResource(wddmAllocation.get());
// 64kb map is not needed
auto status = mapGpuVirtualAddress(wddmAllocation.get(), cpuPtr);
DEBUG_BREAK_IF(!status);
wddmAllocation->setCpuAddress(cpuPtr);
return wddmAllocation.release();
}
@@ -204,7 +202,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryWithAlignment(const
maxOsContextCount);
wddmAllocation->setDriverAllocatedCpuPtr(pSysMem);
gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), pSysMem, sizeAligned, allocationData.flags.uncacheable);
gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), pSysMem, sizeAligned, allocationData.flags.uncacheable, allocationData.flags.preferRenderCompressed, true, allocationData.storageInfo);
wddmAllocation->setDefaultGmm(gmm);
void *mapPtr = wddmAllocation->getAlignedCpuPtr();