mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
fix: clear residency container when failed to make resident
Related-To: NEO-14143 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c741628b00
commit
577c99fe9c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -107,6 +107,8 @@ bool WddmResidencyController::makeResidentResidencyAllocations(ResidencyContaine
|
||||
residencyData->updateCompletionData(currentFence, this->osContextId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
allocationsForResidency.clear();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -862,6 +862,23 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin
|
||||
EXPECT_EQ(2u, wddm->makeResidentResult.called);
|
||||
}
|
||||
|
||||
TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallingMakeResidentResidencyAllocationsThenResidencyContainerIsCleared) {
|
||||
MockWddmAllocation allocation1(gmmHelper);
|
||||
MockWddmAllocation allocation2(gmmHelper);
|
||||
MockWddmAllocation allocation3(gmmHelper);
|
||||
MockWddmAllocation allocation4(gmmHelper);
|
||||
|
||||
wddm->makeResidentNumberOfBytesToTrim = 4 * 4096;
|
||||
wddm->makeResidentStatus = false;
|
||||
|
||||
ResidencyContainer residencyPack{&allocation1, &allocation2, &allocation3, &allocation4};
|
||||
bool requiresBlockingResidencyHandling = true;
|
||||
bool result = residencyController->makeResidentResidencyAllocations(residencyPack, requiresBlockingResidencyHandling);
|
||||
|
||||
EXPECT_FALSE(result);
|
||||
EXPECT_EQ(residencyPack.size(), 0u);
|
||||
}
|
||||
|
||||
TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallingMakeResidentResidencyAllocationsThenDontMarkTripleAllocationsAsResident) {
|
||||
MockWddmAllocation allocation1(gmmHelper);
|
||||
MockWddmAllocation allocation2(gmmHelper);
|
||||
|
||||
Reference in New Issue
Block a user