[4/n] Improve indirect allocations handling.

Add memory manager interfaces to obtain the status.
Only support when VmBind is supported.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2022-01-26 13:27:58 +00:00
committed by Compute-Runtime-Automation
parent af7a475cb0
commit 592eb4607e
3 changed files with 13 additions and 0 deletions

View File

@@ -228,6 +228,10 @@ class MemoryManager {
latestContextId = std::numeric_limits<uint32_t>::max();
}
virtual bool allowIndirectAllocationsAsPack(uint32_t rootDeviceIndex) {
return false;
}
protected:
bool getAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const void *hostPtr, const StorageInfo &storageInfo);
static void overrideAllocationData(AllocationData &allocationData, const AllocationProperties &properties);

View File

@@ -80,6 +80,9 @@ class DrmMemoryManager : public MemoryManager {
DrmAllocation *createUSMHostAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool hasMappedPtr);
void releaseDeviceSpecificMemResources(uint32_t rootDeviceIndex) override;
void createDeviceSpecificMemResources(uint32_t rootDeviceIndex) override;
bool allowIndirectAllocationsAsPack(uint32_t rootDeviceIndex) override {
return this->getDrm(rootDeviceIndex).isVmBindAvailable();
}
protected:
BufferObject *findAndReferenceSharedBufferObject(int boHandle, uint32_t rootDeviceIndex);