mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
Revert "feature: support SVM heap in reserveVirtualMem"
This reverts commit bfaeeb01d6.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8154ce71ea
commit
41df1a6f47
@@ -27,6 +27,8 @@
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/gfx_partition.h"
|
||||
#include "shared/source/memory_manager/host_ptr_manager.h"
|
||||
#include "shared/source/memory_manager/local_memory_usage.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/memory_manager/memory_pool.h"
|
||||
#include "shared/source/memory_manager/multi_graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/residency.h"
|
||||
@@ -45,6 +47,7 @@
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
@@ -92,7 +95,6 @@ DrmMemoryManager::DrmMemoryManager(GemCloseWorkerMode mode,
|
||||
const auto heapIndex = customAlignment >= MemoryConstants::pageSize2M ? HeapIndex::heapStandard2MB : HeapIndex::heapStandard64KB;
|
||||
alignmentSelector.addCandidateAlignment(customAlignment, true, AlignmentSelector::anyWastage, heapIndex);
|
||||
}
|
||||
osMemory = OSMemory::create();
|
||||
|
||||
initialize(mode);
|
||||
}
|
||||
@@ -1525,18 +1527,6 @@ void DrmMemoryManager::freeGpuAddress(AddressRange addressRange, uint32_t rootDe
|
||||
releaseGpuRange(reinterpret_cast<void *>(addressRange.address), addressRange.size, rootDeviceIndex);
|
||||
}
|
||||
|
||||
AddressRange DrmMemoryManager::reserveCpuAddress(const uint64_t requiredStartAddress, size_t size) {
|
||||
void *ptr = osMemory->osReserveCpuAddressRange(addrToPtr(requiredStartAddress), size, false);
|
||||
if (ptr == MAP_FAILED) {
|
||||
ptr = nullptr;
|
||||
}
|
||||
return {castToUint64(ptr), size};
|
||||
}
|
||||
|
||||
void DrmMemoryManager::freeCpuAddress(AddressRange addressRange) {
|
||||
osMemory->osReleaseCpuAddressRange(addrToPtr(addressRange.address), addressRange.size);
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> DrmMemoryManager::acquireAllocLock() {
|
||||
return std::unique_lock<std::mutex>(this->allocMutex);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "shared/source/command_stream/submission_status.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/os_interface/linux/drm_buffer_object.h"
|
||||
#include "shared/source/os_interface/os_memory.h"
|
||||
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
@@ -77,8 +77,6 @@ class DrmMemoryManager : public MemoryManager {
|
||||
AddressRange reserveGpuAddressOnHeap(const uint64_t requiredStartAddress, size_t size, RootDeviceIndicesContainer rootDeviceIndices, uint32_t *reservedOnRootDeviceIndex, HeapIndex heap, size_t alignment) override;
|
||||
size_t selectAlignmentAndHeap(size_t size, HeapIndex *heap) override;
|
||||
void freeGpuAddress(AddressRange addressRange, uint32_t rootDeviceIndex) override;
|
||||
AddressRange reserveCpuAddress(const uint64_t requiredStartAddress, size_t size) override;
|
||||
void freeCpuAddress(AddressRange addressRange) override;
|
||||
MOCKABLE_VIRTUAL BufferObject *createBufferObjectInMemoryRegion(uint32_t rootDeviceIndex, Gmm *gmm, AllocationType allocationType, uint64_t gpuAddress, size_t size,
|
||||
DeviceBitfield memoryBanks, size_t maxOsContextCount, int32_t pairHandle, bool isSystemMemoryPool, bool isUsmHostAllocation);
|
||||
|
||||
@@ -188,7 +186,6 @@ class DrmMemoryManager : public MemoryManager {
|
||||
bool forcePinEnabled = false;
|
||||
const bool validateHostPtrMemory;
|
||||
std::unique_ptr<DrmGemCloseWorker> gemCloseWorker;
|
||||
std::unique_ptr<OSMemory> osMemory;
|
||||
decltype(&mmap) mmapFunction = mmap;
|
||||
decltype(&munmap) munmapFunction = munmap;
|
||||
decltype(&close) closeFunction = close;
|
||||
|
||||
Reference in New Issue
Block a user