mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 17:39:51 +08:00
Do not execute trim callback if there are no registered contexts.
Change-Id: I9a274281a085cdbeb98a1d495ce9ef9ab897d08a
This commit is contained in:
committed by
sys_ocldev
parent
56f67748fd
commit
77b00fa749
@@ -57,6 +57,10 @@ void APIENTRY WddmMemoryManager::trimCallback(_Inout_ D3DKMT_TRIMNOTIFICATION *t
|
||||
WddmMemoryManager *wddmMemMngr = (WddmMemoryManager *)trimNotification->Context;
|
||||
DEBUG_BREAK_IF(wddmMemMngr == nullptr);
|
||||
|
||||
if (wddmMemMngr->getOsContextCount() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
wddmMemMngr->getRegisteredOsContext(0)->get()->getResidencyController().acquireTrimCallbackLock();
|
||||
wddmMemMngr->trimResidency(trimNotification->Flags, trimNotification->NumBytesToTrim);
|
||||
wddmMemMngr->getRegisteredOsContext(0)->get()->getResidencyController().releaseTrimCallbackLock();
|
||||
|
||||
Reference in New Issue
Block a user