diff --git a/shared/source/os_interface/linux/drm_memory_manager.h b/shared/source/os_interface/linux/drm_memory_manager.h index 767510e914..335fe13d92 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.h +++ b/shared/source/os_interface/linux/drm_memory_manager.h @@ -84,7 +84,7 @@ class DrmMemoryManager : public MemoryManager { DrmAllocation *allocateGraphicsMemoryForNonSvmHostPtr(const AllocationData &allocationData) override; DrmAllocation *allocateGraphicsMemoryWithAlignment(const AllocationData &allocationData) override; DrmAllocation *createAllocWithAlignmentFromUserptr(const AllocationData &allocationData, size_t size, size_t alignment, size_t alignedSVMSize, uint64_t gpuAddress); - DrmAllocation *createAllocWithAlignment(const AllocationData &allocationData, size_t size, size_t alignment, size_t alignedSVMSize, uint64_t gpuAddress); + DrmAllocation *createAllocWithAlignment(const AllocationData &allocationData, size_t size, size_t alignment, size_t alignedSize, uint64_t gpuAddress); void obtainGpuAddress(const AllocationData &allocationData, BufferObject *bo, uint64_t gpuAddress); DrmAllocation *allocateUSMHostGraphicsMemory(const AllocationData &allocationData) override; DrmAllocation *allocateGraphicsMemoryWithHostPtr(const AllocationData &allocationData) override; diff --git a/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool.cpp b/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool.cpp index 8e78e954df..a8617658ba 100644 --- a/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool.cpp @@ -17,8 +17,8 @@ BufferObject *DrmMemoryManager::createBufferObjectInMemoryRegion(Drm *drm, uint6 return nullptr; } -DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData &allocationData, size_t size, size_t alignment, size_t alignedSVMSize, uint64_t gpuAddress) { - return createAllocWithAlignmentFromUserptr(allocationData, size, alignment, alignedSVMSize, gpuAddress); +DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData &allocationData, size_t size, size_t alignment, size_t alignedSize, uint64_t gpuAddress) { + return createAllocWithAlignmentFromUserptr(allocationData, size, alignment, alignedSize, gpuAddress); } GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) { diff --git a/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp b/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp index e5b4f0ff64..3856f3f91c 100644 --- a/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp @@ -65,7 +65,7 @@ BufferObject *DrmMemoryManager::createBufferObjectInMemoryRegion(Drm *drm, return bo; } -DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData &allocationData, size_t size, size_t alignment, size_t alignedSVMSize, uint64_t gpuAddress) { +DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData &allocationData, size_t size, size_t alignment, size_t alignedSize, uint64_t gpuAddress) { bool useBooMmap = this->getDrm(allocationData.rootDeviceIndex).getMemoryInfo() != nullptr; if (DebugManager.flags.EnableBOMmapCreate.get() != -1) { @@ -73,13 +73,13 @@ DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData & } if (useBooMmap) { - auto totalSizeToAlloc = alignedSVMSize + alignment; + auto totalSizeToAlloc = alignedSize + alignment; auto cpuPointer = this->mmapFunction(0, totalSizeToAlloc, PROT_NONE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); auto cpuBasePointer = cpuPointer; cpuPointer = alignUp(cpuPointer, alignment); - std::unique_ptr bo(this->createBufferObjectInMemoryRegion(&this->getDrm(allocationData.rootDeviceIndex), reinterpret_cast(cpuPointer), alignedSVMSize, 0u, maxOsContextCount)); + std::unique_ptr bo(this->createBufferObjectInMemoryRegion(&this->getDrm(allocationData.rootDeviceIndex), reinterpret_cast(cpuPointer), alignedSize, 0u, maxOsContextCount)); if (!bo) { this->munmapFunction(cpuBasePointer, totalSizeToAlloc); @@ -96,21 +96,21 @@ DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData & return nullptr; } - this->mmapFunction(cpuPointer, alignedSVMSize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, getDrm(allocationData.rootDeviceIndex).getFileDescriptor(), static_cast(gemMmap.offset)); + this->mmapFunction(cpuPointer, alignedSize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, getDrm(allocationData.rootDeviceIndex).getFileDescriptor(), static_cast(gemMmap.offset)); obtainGpuAddress(allocationData, bo.get(), gpuAddress); emitPinningRequest(bo.get(), allocationData); - auto allocation = new DrmAllocation(allocationData.rootDeviceIndex, allocationData.type, bo.get(), cpuPointer, bo->gpuAddress, alignedSVMSize, MemoryPool::System4KBPages); + auto allocation = new DrmAllocation(allocationData.rootDeviceIndex, allocationData.type, bo.get(), cpuPointer, bo->gpuAddress, alignedSize, MemoryPool::System4KBPages); allocation->setMmapPtr(cpuBasePointer); allocation->setMmapSize(totalSizeToAlloc); - allocation->setReservedAddressRange(reinterpret_cast(gpuAddress), alignedSVMSize); + allocation->setReservedAddressRange(reinterpret_cast(gpuAddress), alignedSize); bo.release(); return allocation; } else { - return createAllocWithAlignmentFromUserptr(allocationData, size, alignment, alignedSVMSize, gpuAddress); + return createAllocWithAlignmentFromUserptr(allocationData, size, alignment, alignedSize, gpuAddress); } }