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>
Cette révision appartient à :
Ruili Ji
2023-03-14 15:37:44 +08:00
révisé par Maneesh Gupta
Parent 37849a0726
révision 25fe45bb2a
2 fichiers modifiés avec 6 ajouts et 1 suppressions
+5 -1
Voir le fichier
@@ -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;
}
+1
Voir le fichier
@@ -201,6 +201,7 @@ class Memory : public amd::RuntimeObject {
uint32_t canBeCached_ : 1; //!< flag to if the object can be cached
uint32_t p2pAccess_ : 1; //!< Memory object allows P2P access
uint32_t ipcShared_ : 1; //!< Memory shared between processes
uint32_t largeBarSystem_ : 1; //!< VRAM is visiable for host
};
uint32_t flagsEx_;
};