mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Remove virtual padding support
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
70cf43fd6e
commit
39c1c4d530
@@ -129,10 +129,6 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo, bool preferCompressed) {
|
||||
resourceParams.ArraySize = imageCount;
|
||||
resourceParams.Flags.Wa.__ForceOtherHVALIGN4 = hwHelper.hvAlign4Required();
|
||||
resourceParams.MaxLod = imgInfo.baseMipLevel + imgInfo.mipCount;
|
||||
if (imgInfo.imgDesc.imageRowPitch && imgInfo.imgDesc.fromParent) {
|
||||
resourceParams.OverridePitch = (uint32_t)imgInfo.imgDesc.imageRowPitch;
|
||||
resourceParams.Flags.Info.AllowVirtualPadding = true;
|
||||
}
|
||||
|
||||
applyAuxFlagsForImage(imgInfo, preferCompressed);
|
||||
}
|
||||
|
||||
@@ -139,14 +139,6 @@ void MemoryManager::cleanGraphicsMemoryCreatedFromHostPtr(GraphicsAllocation *gr
|
||||
cleanOsHandles(graphicsAllocation->fragmentsStorage, graphicsAllocation->getRootDeviceIndex());
|
||||
}
|
||||
|
||||
GraphicsAllocation *MemoryManager::createGraphicsAllocationWithPadding(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding) {
|
||||
return createPaddedAllocation(inputGraphicsAllocation, sizeWithPadding);
|
||||
}
|
||||
|
||||
GraphicsAllocation *MemoryManager::createPaddedAllocation(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding) {
|
||||
return allocateGraphicsMemoryWithProperties({inputGraphicsAllocation->getRootDeviceIndex(), sizeWithPadding, AllocationType::INTERNAL_HOST_MEMORY, systemMemoryBitfield});
|
||||
}
|
||||
|
||||
void *MemoryManager::createMultiGraphicsAllocationInSystemMemoryPool(RootDeviceIndicesContainer &rootDeviceIndices, AllocationProperties &properties, MultiGraphicsAllocation &multiGraphicsAllocation, void *ptr) {
|
||||
properties.flags.forceSystemMemory = true;
|
||||
for (auto &rootDeviceIndex : rootDeviceIndices) {
|
||||
|
||||
@@ -114,8 +114,6 @@ class MemoryManager {
|
||||
}
|
||||
|
||||
void cleanGraphicsMemoryCreatedFromHostPtr(GraphicsAllocation *);
|
||||
GraphicsAllocation *createGraphicsAllocationWithPadding(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding);
|
||||
virtual GraphicsAllocation *createPaddedAllocation(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding);
|
||||
|
||||
MOCKABLE_VIRTUAL void *createMultiGraphicsAllocationInSystemMemoryPool(RootDeviceIndicesContainer &rootDeviceIndices, AllocationProperties &properties, MultiGraphicsAllocation &multiGraphicsAllocation, void *ptr);
|
||||
MOCKABLE_VIRTUAL void *createMultiGraphicsAllocationInSystemMemoryPool(RootDeviceIndicesContainer &rootDeviceIndices, AllocationProperties &properties, MultiGraphicsAllocation &multiGraphicsAllocation) {
|
||||
@@ -150,9 +148,6 @@ class MemoryManager {
|
||||
bool peekForce32BitAllocations() const { return force32bitAllocations; }
|
||||
void setForce32BitAllocations(bool newValue) { force32bitAllocations = newValue; }
|
||||
|
||||
bool peekVirtualPaddingSupport() const { return virtualPaddingAvailable; }
|
||||
void setVirtualPaddingSupport(bool virtualPaddingSupport) { virtualPaddingAvailable = virtualPaddingSupport; }
|
||||
|
||||
DeferredDeleter *getDeferredDeleter() const {
|
||||
return deferredDeleter.get();
|
||||
}
|
||||
@@ -302,7 +297,6 @@ class MemoryManager {
|
||||
bool initialized = false;
|
||||
bool forceNonSvmForExternalHostPtr = false;
|
||||
bool force32bitAllocations = false;
|
||||
bool virtualPaddingAvailable = false;
|
||||
std::unique_ptr<DeferredDeleter> deferredDeleter;
|
||||
bool asyncDeleterEnabled = false;
|
||||
std::vector<bool> enable64kbpages;
|
||||
|
||||
@@ -848,48 +848,6 @@ void DrmMemoryManager::closeSharedHandle(GraphicsAllocation *gfxAllocation) {
|
||||
}
|
||||
}
|
||||
|
||||
GraphicsAllocation *DrmMemoryManager::createPaddedAllocation(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding) {
|
||||
uint64_t gpuRange = 0llu;
|
||||
|
||||
auto rootDeviceIndex = inputGraphicsAllocation->getRootDeviceIndex();
|
||||
gpuRange = acquireGpuRange(sizeWithPadding, rootDeviceIndex, HeapIndex::HEAP_STANDARD);
|
||||
|
||||
void *srcPtr = nullptr;
|
||||
auto drmInputAllocation = static_cast<DrmAllocation *>(inputGraphicsAllocation);
|
||||
if (drmInputAllocation->getMmapPtr()) {
|
||||
auto bo = drmInputAllocation->getBO();
|
||||
GemMmap mmapArg = {};
|
||||
mmapArg.handle = bo->peekHandle();
|
||||
mmapArg.size = bo->peekSize();
|
||||
if (getDrm(rootDeviceIndex).ioctl(DrmIoctl::GemMmap, &mmapArg) != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
srcPtr = addrToPtr(mmapArg.addrPtr);
|
||||
inputGraphicsAllocation->lock(srcPtr);
|
||||
} else {
|
||||
srcPtr = inputGraphicsAllocation->getUnderlyingBuffer();
|
||||
}
|
||||
auto srcSize = inputGraphicsAllocation->getUnderlyingBufferSize();
|
||||
auto alignedSrcSize = alignUp(srcSize, MemoryConstants::pageSize);
|
||||
auto alignedPtr = reinterpret_cast<uintptr_t>(alignDown(srcPtr, MemoryConstants::pageSize));
|
||||
auto offset = ptrDiff(srcPtr, alignedPtr);
|
||||
|
||||
std::unique_ptr<BufferObject, BufferObject::Deleter> bo(allocUserptr(alignedPtr, alignedSrcSize, rootDeviceIndex));
|
||||
if (!bo) {
|
||||
return nullptr;
|
||||
}
|
||||
bo->setAddress(gpuRange);
|
||||
auto gmmHelper = getGmmHelper(rootDeviceIndex);
|
||||
auto canonizedGpuAddress = gmmHelper->canonize(ptrOffset(gpuRange, offset));
|
||||
auto allocation = new DrmAllocation(rootDeviceIndex, inputGraphicsAllocation->getAllocationType(), bo.get(), srcPtr,
|
||||
canonizedGpuAddress, sizeWithPadding,
|
||||
inputGraphicsAllocation->getMemoryPool());
|
||||
|
||||
allocation->setReservedAddressRange(reinterpret_cast<void *>(gpuRange), sizeWithPadding);
|
||||
bo.release();
|
||||
return allocation;
|
||||
}
|
||||
|
||||
void DrmMemoryManager::addAllocationToHostPtrManager(GraphicsAllocation *gfxAllocation) {
|
||||
DrmAllocation *drmMemory = static_cast<DrmAllocation *>(gfxAllocation);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class DrmMemoryManager : public MemoryManager {
|
||||
GraphicsAllocation *createGraphicsAllocationFromMultipleSharedHandles(std::vector<osHandle> handles, AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override;
|
||||
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness, bool isHostIpcAllocation) override;
|
||||
void closeSharedHandle(GraphicsAllocation *gfxAllocation) override;
|
||||
GraphicsAllocation *createPaddedAllocation(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding) override;
|
||||
|
||||
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex, AllocationType allocType) override { return nullptr; }
|
||||
|
||||
uint64_t getSystemSharedMemory(uint32_t rootDeviceIndex) override;
|
||||
|
||||
Reference in New Issue
Block a user