performance: don't call evict with empty handle list
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
e55aa958b7
commit
974e8ae63f
|
@ -493,6 +493,9 @@ std::vector<std::unique_ptr<HwDeviceId>> Wddm::discoverDevices(ExecutionEnvironm
|
|||
}
|
||||
|
||||
bool Wddm::evict(const D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim, bool evictNeeded) {
|
||||
if (numOfHandles == 0) {
|
||||
return true;
|
||||
}
|
||||
NTSTATUS status = STATUS_SUCCESS;
|
||||
D3DKMT_EVICT evict = {};
|
||||
evict.AllocationList = handleList;
|
||||
|
|
|
@ -681,7 +681,10 @@ NTSTATUS __stdcall mockD3DKMTSubmitCommand(IN CONST D3DKMT_SUBMITCOMMAND *) {
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS __stdcall mockD3DKMTEvict(IN OUT D3DKMT_EVICT *) {
|
||||
NTSTATUS __stdcall mockD3DKMTEvict(IN OUT D3DKMT_EVICT *evict) {
|
||||
if (evict->NumAllocations == 0) {
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -571,6 +571,14 @@ TEST_F(WddmTests, GivenPlatformNotSupportEvictIfNecessaryWhenAdjustingEvictNeede
|
|||
EXPECT_TRUE(value);
|
||||
}
|
||||
|
||||
TEST_F(WddmTests, whenCallingEvictWithNoAllocationsThenDontCallGdi) {
|
||||
uint64_t sizeToTrim = 0;
|
||||
wddm->callBaseEvict = true;
|
||||
EXPECT_TRUE(wddm->evict(nullptr, 0, sizeToTrim, false));
|
||||
bool value = wddm->adjustEvictNeededParameter(false);
|
||||
EXPECT_TRUE(value);
|
||||
}
|
||||
|
||||
TEST_F(WddmTests, GivenWddmWhenMapGpuVaCalledThenGmmClientCallsMapGpuVa) {
|
||||
NEO::AllocationData allocData = {};
|
||||
allocData.type = NEO::AllocationType::buffer;
|
||||
|
|
Loading…
Reference in New Issue