mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Fix crash caused by missing residency data.
Change-Id: Ib615e3b13382950ec8ecc128bea0032a126666e0
This commit is contained in:
committed by
sys_ocldev
parent
e0e25d28c6
commit
ad65477868
@@ -120,6 +120,7 @@ void OsAgnosticMemoryManager::addAllocationToHostPtrManager(GraphicsAllocation *
|
||||
fragment.fragmentCpuPointer = gfxAllocation->getUnderlyingBuffer();
|
||||
fragment.fragmentSize = alignUp(gfxAllocation->getUnderlyingBufferSize(), MemoryConstants::pageSize);
|
||||
fragment.osInternalStorage = new OsHandle();
|
||||
fragment.residency = new ResidencyData();
|
||||
hostPtrManager.storeFragment(fragment);
|
||||
}
|
||||
|
||||
@@ -128,8 +129,10 @@ void OsAgnosticMemoryManager::removeAllocationFromHostPtrManager(GraphicsAllocat
|
||||
auto fragment = hostPtrManager.getFragment(buffer);
|
||||
if (fragment && fragment->driverAllocation) {
|
||||
OsHandle *osStorageToRelease = fragment->osInternalStorage;
|
||||
ResidencyData *residencyDataToRelease = fragment->residency;
|
||||
if (hostPtrManager.releaseHostPtr(buffer)) {
|
||||
delete osStorageToRelease;
|
||||
delete residencyDataToRelease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,6 +429,7 @@ void DrmMemoryManager::addAllocationToHostPtrManager(GraphicsAllocation *gfxAllo
|
||||
fragment.fragmentCpuPointer = gfxAllocation->getUnderlyingBuffer();
|
||||
fragment.fragmentSize = alignUp(gfxAllocation->getUnderlyingBufferSize(), MemoryConstants::pageSize);
|
||||
fragment.osInternalStorage = new OsHandle();
|
||||
fragment.residency = new ResidencyData();
|
||||
fragment.osInternalStorage->bo = drmMemory->getBO();
|
||||
hostPtrManager.storeFragment(fragment);
|
||||
}
|
||||
@@ -438,8 +439,10 @@ void DrmMemoryManager::removeAllocationFromHostPtrManager(GraphicsAllocation *gf
|
||||
auto fragment = hostPtrManager.getFragment(buffer);
|
||||
if (fragment && fragment->driverAllocation) {
|
||||
OsHandle *osStorageToRelease = fragment->osInternalStorage;
|
||||
ResidencyData *residencyDataToRelease = fragment->residency;
|
||||
if (hostPtrManager.releaseHostPtr(buffer)) {
|
||||
delete osStorageToRelease;
|
||||
delete residencyDataToRelease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user