SWDEV-383856 - Remove mmap function for SVM buffer

For large bar platform, it's not necessary to mmap
memory allocated on VRAM to cpu again

Change-Id: I0701680476829d4058b3e7b643e8df657d0c6168
Signed-off-by: Ruili Ji <ruiliji2@amd.com>
This commit is contained in:
Ruili Ji
2023-03-14 15:37:44 +08:00
committato da Maneesh Gupta
parent 37849a0726
commit 25fe45bb2a
2 ha cambiato i file con 6 aggiunte e 1 eliminazioni
+5 -1
Vedi File
@@ -285,6 +285,9 @@ bool Memory::create(void* initFrom, bool sysMemAlloc, bool skipAlloc, bool force
}
const std::vector<Device*>& devices = context_().devices();
if (devices.size() == 1 && devices[0]->info().largeBar_) {
largeBarSystem_ = 1;
}
// Forces system memory allocation on the device,
// instead of device memory
@@ -500,7 +503,8 @@ bool Memory::usesSvmPointer() const {
void Memory::commitSvmMemory() {
ScopedLock lock(lockMemoryOps_);
if (!svmPtrCommited_) {
// if VRAM is visible for host, it is not necessary to mmap again
if (!svmPtrCommited_ && !largeBarSystem_) {
amd::Os::commitMemory(svmHostAddress_, size_, amd::Os::MEM_PROT_RW);
svmPtrCommited_ = true;
}