mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Move isMemoryBudgetExhausted to WddmResidencyController
Change-Id: Ic9da29ab954835e93cfbcd6690c1764d99939613 Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
630a7e1c26
commit
b0acc5ecde
@@ -342,6 +342,15 @@ bool WddmMemoryManager::tryDeferDeletions(D3DKMT_HANDLE *handles, uint32_t alloc
|
||||
return status;
|
||||
}
|
||||
|
||||
bool WddmMemoryManager::isMemoryBudgetExhausted() const {
|
||||
for (auto osContext : this->registeredOsContexts) {
|
||||
if (osContext != nullptr && osContext->get()->getResidencyController().isMemoryBudgetExhausted()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WddmMemoryManager::validateAllocation(WddmAllocation *alloc) {
|
||||
if (alloc == nullptr)
|
||||
return false;
|
||||
@@ -491,7 +500,7 @@ bool WddmMemoryManager::makeResidentResidencyAllocations(ResidencyContainer &all
|
||||
if (totalHandlesCount) {
|
||||
uint64_t bytesToTrim = 0;
|
||||
while ((result = wddm->makeResident(handlesForResidency.get(), totalHandlesCount, false, &bytesToTrim)) == false) {
|
||||
this->memoryBudgetExhausted = true;
|
||||
osContext.get()->getResidencyController().setMemoryBudgetExhausted();
|
||||
bool trimmingDone = this->getRegisteredOsContext(0u)->get()->getResidencyController().trimResidencyToBudget(bytesToTrim);
|
||||
bool cantTrimFurther = !trimmingDone;
|
||||
if (cantTrimFurther) {
|
||||
|
||||
Reference in New Issue
Block a user