mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Simplify memory manager API [1/n]
pass struct with properties to allocate graphics memory methods: for protected methods use AllocationData for public methods use AllocationProperties Change-Id: Ie1c3cb6b5e330bc4adac2ca8b0bf02d30ec76065 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
ace20aba5b
commit
c8748b77a0
@@ -31,13 +31,14 @@ class DrmMemoryManager : public MemoryManager {
|
||||
void addAllocationToHostPtrManager(GraphicsAllocation *gfxAllocation) override;
|
||||
void removeAllocationFromHostPtrManager(GraphicsAllocation *gfxAllocation) override;
|
||||
void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) override;
|
||||
DrmAllocation *allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin, bool uncacheable) override;
|
||||
DrmAllocation *allocateGraphicsMemory64kb(size_t size, size_t alignment, bool forcePin, bool preferRenderCompressed) override;
|
||||
DrmAllocation *allocateGraphicsMemoryForNonSvmHostPtr(size_t size, void *cpuPtr) override;
|
||||
DrmAllocation *allocateGraphicsMemory(size_t size, const void *ptr) override {
|
||||
return allocateGraphicsMemory(size, ptr, false);
|
||||
AllocationData allocationData;
|
||||
allocationData.hostPtr = ptr;
|
||||
allocationData.size = size;
|
||||
return allocateGraphicsMemoryWithHostPtr(allocationData);
|
||||
}
|
||||
DrmAllocation *allocateGraphicsMemory(size_t size, const void *ptr, bool forcePin) override;
|
||||
GraphicsAllocation *allocateGraphicsMemoryForImage(ImageInfo &imgInfo, Gmm *gmm) override;
|
||||
DrmAllocation *allocate32BitGraphicsMemory(size_t size, const void *ptr, AllocationOrigin allocationOrigin) override;
|
||||
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override;
|
||||
@@ -74,6 +75,9 @@ class DrmMemoryManager : public MemoryManager {
|
||||
void releaseGpuRange(void *address, size_t unmapSize, StorageAllocatorType allocatorType);
|
||||
void initInternalRangeAllocator(size_t range);
|
||||
|
||||
DrmAllocation *allocateGraphicsMemoryWithAlignment(const AllocationData &allocationData) override;
|
||||
DrmAllocation *allocateGraphicsMemoryWithHostPtr(const AllocationData &allocationData) override;
|
||||
|
||||
Drm *drm;
|
||||
BufferObject *pinBB;
|
||||
size_t pinThreshold = 8 * 1024 * 1024;
|
||||
|
||||
Reference in New Issue
Block a user