mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 22:08:53 +08:00
Add /we4189 switch to CMAKE_CXX_FLAGS for MSVC.
- treat unused local variables warnings as error in Debug Change-Id: I2da08b72e0f0083d3cdf932fbf92ef4981a88615
This commit is contained in:
committed by
sys_ocldev
parent
6e0d04e25a
commit
cb37f2a779
@@ -129,7 +129,7 @@ if(NOT DEFINED AUB_STREAM_DIR AND NOT DISABLE_AUB_STREAM)
|
|||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
unset(AUB_STREAM_DIR)
|
unset(AUB_STREAM_DIR)
|
||||||
endif(NOT DEFINED AUB_STREAM_DIR)
|
endif()
|
||||||
|
|
||||||
if(LIBDRM_DIR)
|
if(LIBDRM_DIR)
|
||||||
get_filename_component(I915_INCLUDES_DIR "${LIBDRM_DIR}/include" ABSOLUTE)
|
get_filename_component(I915_INCLUDES_DIR "${LIBDRM_DIR}/include" ABSOLUTE)
|
||||||
@@ -469,7 +469,10 @@ endif()
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Force to treat warnings as errors
|
# Force to treat warnings as errors
|
||||||
if(NOT CMAKE_CXX_FLAGS MATCHES "/WX")
|
if(NOT CMAKE_CXX_FLAGS MATCHES "/WX")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||||
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4189")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Support for WUD
|
# Support for WUD
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 Intel Corporation
|
* Copyright (C) 2018-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -73,6 +73,10 @@ void SehException::getCallStack(unsigned int code, struct _EXCEPTION_POINTERS *e
|
|||||||
stack.clear();
|
stack.clear();
|
||||||
|
|
||||||
BOOL result = SymInitialize(hProcess, NULL, TRUE);
|
BOOL result = SymInitialize(hProcess, NULL, TRUE);
|
||||||
|
if (result == FALSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
STACKFRAME64 stackFrame;
|
STACKFRAME64 stackFrame;
|
||||||
memset(&stackFrame, 0, sizeof(STACKFRAME64));
|
memset(&stackFrame, 0, sizeof(STACKFRAME64));
|
||||||
const int nameSize = 255;
|
const int nameSize = 255;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2017-2018 Intel Corporation
|
* Copyright (C) 2017-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 Intel Corporation
|
* Copyright (C) 2018-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "runtime/os_interface/windows/kmdaf_listener.h"
|
#include "runtime/os_interface/windows/kmdaf_listener.h"
|
||||||
|
#pragma warning(push) // save the current state
|
||||||
|
#pragma warning(disable : 4189) // disable warning 4189 (unused local variable)
|
||||||
#include "kmdaf.h"
|
#include "kmdaf.h"
|
||||||
|
#pragma warning(pop) // restore state.
|
||||||
|
|
||||||
namespace OCLRT {
|
namespace OCLRT {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2017-2018 Intel Corporation
|
* Copyright (C) 2017-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -80,8 +80,7 @@ class ThkWrapper {
|
|||||||
SYSTEM_ENTER()
|
SYSTEM_ENTER()
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
Status = mFunc(param);
|
Status = mFunc(param);
|
||||||
unsigned int ID = getId<Param>();
|
SYSTEM_LEAVE(getId<Param>());
|
||||||
SYSTEM_LEAVE(ID);
|
|
||||||
return Status;
|
return Status;
|
||||||
} else {
|
} else {
|
||||||
return mFunc(param);
|
return mFunc(param);
|
||||||
|
|||||||
@@ -943,7 +943,7 @@ bool Wddm::init(PreemptionMode preemptionMode) {
|
|||||||
|
|
||||||
EvictionStatus Wddm::evictAllTemporaryResources() {
|
EvictionStatus Wddm::evictAllTemporaryResources() {
|
||||||
decltype(temporaryResources) resourcesToEvict;
|
decltype(temporaryResources) resourcesToEvict;
|
||||||
auto &lock = acquireLock(temporaryResourcesLock);
|
auto lock = acquireLock(temporaryResourcesLock);
|
||||||
temporaryResources.swap(resourcesToEvict);
|
temporaryResources.swap(resourcesToEvict);
|
||||||
if (resourcesToEvict.empty()) {
|
if (resourcesToEvict.empty()) {
|
||||||
return EvictionStatus::NOT_APPLIED;
|
return EvictionStatus::NOT_APPLIED;
|
||||||
@@ -959,7 +959,7 @@ EvictionStatus Wddm::evictAllTemporaryResources() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EvictionStatus Wddm::evictTemporaryResource(WddmAllocation &allocation) {
|
EvictionStatus Wddm::evictTemporaryResource(WddmAllocation &allocation) {
|
||||||
auto &lock = acquireLock(temporaryResourcesLock);
|
auto lock = acquireLock(temporaryResourcesLock);
|
||||||
auto position = std::find(temporaryResources.begin(), temporaryResources.end(), allocation.handle);
|
auto position = std::find(temporaryResources.begin(), temporaryResources.end(), allocation.handle);
|
||||||
if (position == temporaryResources.end()) {
|
if (position == temporaryResources.end()) {
|
||||||
return EvictionStatus::NOT_APPLIED;
|
return EvictionStatus::NOT_APPLIED;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2017-2018 Intel Corporation
|
* Copyright (C) 2017-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -41,8 +41,6 @@ D3DSharing<D3D>::~D3DSharing() {
|
|||||||
|
|
||||||
template <typename D3D>
|
template <typename D3D>
|
||||||
void D3DSharing<D3D>::synchronizeObject(UpdateData &updateData) {
|
void D3DSharing<D3D>::synchronizeObject(UpdateData &updateData) {
|
||||||
void *sharedHandle = nullptr;
|
|
||||||
|
|
||||||
sharingFunctions->getDeviceContext(d3dQuery);
|
sharingFunctions->getDeviceContext(d3dQuery);
|
||||||
if (!sharedResource) {
|
if (!sharedResource) {
|
||||||
sharingFunctions->copySubresourceRegion(resourceStaging, 0, resource, subresource);
|
sharingFunctions->copySubresourceRegion(resourceStaging, 0, resource, subresource);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2017-2018 Intel Corporation
|
* Copyright (C) 2017-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -22,7 +22,9 @@ TEST_F(MockOSTimeWinTest, DynamicResolution) {
|
|||||||
auto wddmMock = std::unique_ptr<WddmMock>(new WddmMock());
|
auto wddmMock = std::unique_ptr<WddmMock>(new WddmMock());
|
||||||
auto mDev = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
auto mDev = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||||
|
|
||||||
bool error = wddmMock->init(mDev->getPreemptionMode());
|
bool success = wddmMock->init(mDev->getPreemptionMode());
|
||||||
|
EXPECT_TRUE(success);
|
||||||
|
|
||||||
std::unique_ptr<MockOSTimeWin> timeWin(new MockOSTimeWin(wddmMock.get()));
|
std::unique_ptr<MockOSTimeWin> timeWin(new MockOSTimeWin(wddmMock.get()));
|
||||||
|
|
||||||
double res = 0.0;
|
double res = 0.0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2017-2018 Intel Corporation
|
* Copyright (C) 2017-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -13,7 +13,6 @@ typedef OsInterfaceTest OsInterfaceTestSkl;
|
|||||||
|
|
||||||
GEN9TEST_F(OsInterfaceTestSkl, askKmdIfPreemptionRegisterWhitelisted) {
|
GEN9TEST_F(OsInterfaceTestSkl, askKmdIfPreemptionRegisterWhitelisted) {
|
||||||
HardwareInfo *hwInfo = nullptr;
|
HardwareInfo *hwInfo = nullptr;
|
||||||
const HardwareInfo *refHwinfo = *platformDevices;
|
|
||||||
size_t numDevices = 0;
|
size_t numDevices = 0;
|
||||||
|
|
||||||
ExecutionEnvironment executionEnvironment;
|
ExecutionEnvironment executionEnvironment;
|
||||||
|
|||||||
@@ -172,13 +172,13 @@ int main(int argc, char **argv) {
|
|||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
bool useDefaultListener = false;
|
bool useDefaultListener = false;
|
||||||
bool enable_alarm = true;
|
bool enable_alarm = true;
|
||||||
bool enable_segv = true;
|
|
||||||
bool enable_abrt = true;
|
|
||||||
bool setupFeatureTable = testMode == TestMode::AubTests ? true : false;
|
bool setupFeatureTable = testMode == TestMode::AubTests ? true : false;
|
||||||
|
|
||||||
applyWorkarounds();
|
applyWorkarounds();
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
|
bool enable_segv = true;
|
||||||
|
bool enable_abrt = true;
|
||||||
if (getenv("IGDRCL_TEST_SELF_EXEC") == nullptr) {
|
if (getenv("IGDRCL_TEST_SELF_EXEC") == nullptr) {
|
||||||
std::string wd = getRunPath(argv[0]);
|
std::string wd = getRunPath(argv[0]);
|
||||||
setenv("LD_LIBRARY_PATH", wd.c_str(), 1);
|
setenv("LD_LIBRARY_PATH", wd.c_str(), 1);
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ bool WddmMock::destroyAllocation(WddmAllocation *alloc, OsContextWin *osContext)
|
|||||||
D3DKMT_HANDLE *allocationHandles = nullptr;
|
D3DKMT_HANDLE *allocationHandles = nullptr;
|
||||||
uint32_t allocationCount = 0;
|
uint32_t allocationCount = 0;
|
||||||
D3DKMT_HANDLE resourceHandle = 0;
|
D3DKMT_HANDLE resourceHandle = 0;
|
||||||
void *cpuPtr = nullptr;
|
|
||||||
void *reserveAddress = alloc->getReservedAddress();
|
void *reserveAddress = alloc->getReservedAddress();
|
||||||
if (alloc->peekSharedHandle()) {
|
if (alloc->peekSharedHandle()) {
|
||||||
resourceHandle = alloc->resourceHandle;
|
resourceHandle = alloc->resourceHandle;
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ TEST_F(WddmCommandStreamTest, givenGraphicsAllocationWithDifferentGpuAddressThen
|
|||||||
|
|
||||||
LinearStream cs(commandBuffer);
|
LinearStream cs(commandBuffer);
|
||||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
||||||
auto flushStamp = csr->flush(batchBuffer, csr->getResidencyAllocations());
|
csr->flush(batchBuffer, csr->getResidencyAllocations());
|
||||||
EXPECT_EQ(mockGpuAddres, wddm->submitResult.commandBufferSubmitted);
|
EXPECT_EQ(mockGpuAddres, wddm->submitResult.commandBufferSubmitted);
|
||||||
memoryManager->freeGraphicsMemory(commandBuffer);
|
memoryManager->freeGraphicsMemory(commandBuffer);
|
||||||
}
|
}
|
||||||
@@ -376,7 +376,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafDisabledWhenFlushIsCalledWithAll
|
|||||||
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
|
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
|
||||||
|
|
||||||
EXPECT_FALSE(wddm->isKmDafEnabled());
|
EXPECT_FALSE(wddm->isKmDafEnabled());
|
||||||
auto flushStamp = csr->flush(batchBuffer, allocationsForResidency);
|
csr->flush(batchBuffer, allocationsForResidency);
|
||||||
|
|
||||||
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
|
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
|
||||||
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
|
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
|
||||||
@@ -392,7 +392,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithoutA
|
|||||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
||||||
|
|
||||||
wddm->setKmDafEnabled(true);
|
wddm->setKmDafEnabled(true);
|
||||||
auto flushStamp = csr->flush(batchBuffer, csr->getResidencyAllocations());
|
csr->flush(batchBuffer, csr->getResidencyAllocations());
|
||||||
|
|
||||||
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
|
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
|
||||||
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
|
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
|
||||||
@@ -415,7 +415,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithResi
|
|||||||
EXPECT_EQ(linearStreamAllocation, csr->getResidencyAllocations()[0]);
|
EXPECT_EQ(linearStreamAllocation, csr->getResidencyAllocations()[0]);
|
||||||
|
|
||||||
wddm->setKmDafEnabled(true);
|
wddm->setKmDafEnabled(true);
|
||||||
auto flushStamp = csr->flush(batchBuffer, csr->getResidencyAllocations());
|
csr->flush(batchBuffer, csr->getResidencyAllocations());
|
||||||
|
|
||||||
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
|
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
|
||||||
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
|
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
|
||||||
@@ -437,7 +437,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
|
|||||||
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
|
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
|
||||||
|
|
||||||
wddm->setKmDafEnabled(true);
|
wddm->setKmDafEnabled(true);
|
||||||
auto flushStamp = csr->flush(batchBuffer, allocationsForResidency);
|
csr->flush(batchBuffer, allocationsForResidency);
|
||||||
|
|
||||||
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
|
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
|
||||||
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
|
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
|
||||||
@@ -459,7 +459,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
|
|||||||
ResidencyContainer allocationsForResidency = {fillPatternAllocation};
|
ResidencyContainer allocationsForResidency = {fillPatternAllocation};
|
||||||
|
|
||||||
wddm->setKmDafEnabled(true);
|
wddm->setKmDafEnabled(true);
|
||||||
auto flushStamp = csr->flush(batchBuffer, allocationsForResidency);
|
csr->flush(batchBuffer, allocationsForResidency);
|
||||||
|
|
||||||
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
|
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
|
||||||
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
|
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
|
||||||
@@ -480,7 +480,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
|
|||||||
ResidencyContainer allocationsForResidency = {nonLinearStreamAllocation};
|
ResidencyContainer allocationsForResidency = {nonLinearStreamAllocation};
|
||||||
|
|
||||||
wddm->setKmDafEnabled(true);
|
wddm->setKmDafEnabled(true);
|
||||||
auto flushStamp = csr->flush(batchBuffer, allocationsForResidency);
|
csr->flush(batchBuffer, allocationsForResidency);
|
||||||
|
|
||||||
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
|
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
|
||||||
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
|
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
|
||||||
@@ -490,8 +490,6 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WddmCommandStreamTest, makeResident) {
|
TEST_F(WddmCommandStreamTest, makeResident) {
|
||||||
WddmMemoryManager *wddmMM = reinterpret_cast<WddmMemoryManager *>(memoryManager);
|
|
||||||
|
|
||||||
GraphicsAllocation *commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
GraphicsAllocation *commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
ASSERT_NE(nullptr, commandBuffer);
|
ASSERT_NE(nullptr, commandBuffer);
|
||||||
LinearStream cs(commandBuffer);
|
LinearStream cs(commandBuffer);
|
||||||
@@ -506,8 +504,6 @@ TEST_F(WddmCommandStreamTest, makeResident) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WddmCommandStreamTest, makeNonResidentPutsAllocationInEvictionAllocations) {
|
TEST_F(WddmCommandStreamTest, makeNonResidentPutsAllocationInEvictionAllocations) {
|
||||||
WddmMemoryManager *wddmMM = reinterpret_cast<WddmMemoryManager *>(memoryManager);
|
|
||||||
|
|
||||||
GraphicsAllocation *commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
GraphicsAllocation *commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
ASSERT_NE(nullptr, commandBuffer);
|
ASSERT_NE(nullptr, commandBuffer);
|
||||||
LinearStream cs(commandBuffer);
|
LinearStream cs(commandBuffer);
|
||||||
@@ -522,8 +518,6 @@ TEST_F(WddmCommandStreamTest, makeNonResidentPutsAllocationInEvictionAllocations
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WddmCommandStreamTest, processEvictionPlacesAllAllocationsOnTrimCandidateList) {
|
TEST_F(WddmCommandStreamTest, processEvictionPlacesAllAllocationsOnTrimCandidateList) {
|
||||||
WddmMemoryManager *wddmMM = reinterpret_cast<WddmMemoryManager *>(memoryManager);
|
|
||||||
|
|
||||||
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
GraphicsAllocation *allocation2 = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
GraphicsAllocation *allocation2 = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
ASSERT_NE(nullptr, allocation);
|
ASSERT_NE(nullptr, allocation);
|
||||||
@@ -543,8 +537,6 @@ TEST_F(WddmCommandStreamTest, processEvictionPlacesAllAllocationsOnTrimCandidate
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WddmCommandStreamTest, processEvictionClearsEvictionAllocations) {
|
TEST_F(WddmCommandStreamTest, processEvictionClearsEvictionAllocations) {
|
||||||
WddmMemoryManager *wddmMM = reinterpret_cast<WddmMemoryManager *>(memoryManager);
|
|
||||||
|
|
||||||
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
ASSERT_NE(nullptr, allocation);
|
ASSERT_NE(nullptr, allocation);
|
||||||
|
|
||||||
@@ -562,7 +554,6 @@ TEST_F(WddmCommandStreamTest, processEvictionClearsEvictionAllocations) {
|
|||||||
TEST_F(WddmCommandStreamTest, makeResidentNonResidentMemObj) {
|
TEST_F(WddmCommandStreamTest, makeResidentNonResidentMemObj) {
|
||||||
GraphicsAllocation *gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
GraphicsAllocation *gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
Buffer *buffer = new AlignedBuffer(gfxAllocation);
|
Buffer *buffer = new AlignedBuffer(gfxAllocation);
|
||||||
WddmMemoryManager *wddmMM = reinterpret_cast<WddmMemoryManager *>(memoryManager);
|
|
||||||
|
|
||||||
csr->makeResident(*buffer->getGraphicsAllocation());
|
csr->makeResident(*buffer->getGraphicsAllocation());
|
||||||
EXPECT_EQ(0u, wddm->makeResidentResult.called);
|
EXPECT_EQ(0u, wddm->makeResidentResult.called);
|
||||||
@@ -888,7 +879,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenFlushingThenInitTra
|
|||||||
|
|
||||||
auto memoryManager = executionEnvironment->memoryManager.get();
|
auto memoryManager = executionEnvironment->memoryManager.get();
|
||||||
|
|
||||||
auto &csrCS = mockWddmCsr->getCS();
|
mockWddmCsr->getCS();
|
||||||
|
|
||||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
IndirectHeap cs(graphicsAllocation);
|
IndirectHeap cs(graphicsAllocation);
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ TEST_F(GlArbSyncEventOsTest, WhenCreateSynchronizationObjectSucceedsThenAllHAndl
|
|||||||
gdi->createSynchronizationObject.mFunc = CreateSyncObjectMock::createSynchObject;
|
gdi->createSynchronizationObject.mFunc = CreateSyncObjectMock::createSynchObject;
|
||||||
gdi->createSynchronizationObject2.mFunc = CreateSyncObjectMock::createSynchObject2;
|
gdi->createSynchronizationObject2.mFunc = CreateSyncObjectMock::createSynchObject2;
|
||||||
auto ret = setupArbSyncObject(sharing, osInterface, syncInfo);
|
auto ret = setupArbSyncObject(sharing, osInterface, syncInfo);
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
EXPECT_EQ(1U, syncInfo.serverSynchronizationObject);
|
EXPECT_EQ(1U, syncInfo.serverSynchronizationObject);
|
||||||
EXPECT_EQ(2U, syncInfo.clientSynchronizationObject);
|
EXPECT_EQ(2U, syncInfo.clientSynchronizationObject);
|
||||||
EXPECT_EQ(3U, syncInfo.submissionSynchronizationObject);
|
EXPECT_EQ(3U, syncInfo.submissionSynchronizationObject);
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenWddmAllocationWhenMappingGpuVaThenUseGmmS
|
|||||||
|
|
||||||
allocation.gmm = gmm.get();
|
allocation.gmm = gmm.get();
|
||||||
auto status = wddm->createAllocation(&allocation);
|
auto status = wddm->createAllocation(&allocation);
|
||||||
|
EXPECT_EQ(STATUS_SUCCESS, status);
|
||||||
|
|
||||||
auto mockResourceInfo = static_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get());
|
auto mockResourceInfo = static_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get());
|
||||||
mockResourceInfo->overrideReturnedSize(allocation.getAlignedSize() + (2 * MemoryConstants::pageSize));
|
mockResourceInfo->overrideReturnedSize(allocation.getAlignedSize() + (2 * MemoryConstants::pageSize));
|
||||||
@@ -646,8 +647,6 @@ TEST_F(Wddm20Tests, givenDestroyAllocationWhenItIsCalledThenAllocationIsPassedTo
|
|||||||
|
|
||||||
*osContextWin->getResidencyController().getMonitoredFence().cpuAddress = 10;
|
*osContextWin->getResidencyController().getMonitoredFence().cpuAddress = 10;
|
||||||
|
|
||||||
D3DKMT_HANDLE handle = (D3DKMT_HANDLE)0x1234;
|
|
||||||
|
|
||||||
gdi->getWaitFromCpuArg().FenceValueArray = nullptr;
|
gdi->getWaitFromCpuArg().FenceValueArray = nullptr;
|
||||||
gdi->getWaitFromCpuArg().Flags.Value = 0;
|
gdi->getWaitFromCpuArg().Flags.Value = 0;
|
||||||
gdi->getWaitFromCpuArg().hDevice = (D3DKMT_HANDLE)0;
|
gdi->getWaitFromCpuArg().hDevice = (D3DKMT_HANDLE)0;
|
||||||
|
|||||||
@@ -313,11 +313,10 @@ TEST_F(WddmMemoryManagerTest, givenDefaultMemoryManagerWhenAllocateWithSizeIsCal
|
|||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIsCalledThenNonNullGraphicsAllocationIsReturned) {
|
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIsCalledThenNonNullGraphicsAllocationIsReturned) {
|
||||||
auto osHandle = 1u;
|
auto osHandle = 1u;
|
||||||
auto size = 4096u;
|
|
||||||
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
||||||
|
|
||||||
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
||||||
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
||||||
|
|
||||||
auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false);
|
auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false);
|
||||||
auto wddmAlloc = static_cast<WddmAllocation *>(gpuAllocation);
|
auto wddmAlloc = static_cast<WddmAllocation *>(gpuAllocation);
|
||||||
@@ -329,11 +328,10 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIs
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromNTHandleIsCalledThenNonNullGraphicsAllocationIsReturned) {
|
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromNTHandleIsCalledThenNonNullGraphicsAllocationIsReturned) {
|
||||||
auto size = 4096u;
|
|
||||||
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
||||||
|
|
||||||
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
||||||
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
||||||
|
|
||||||
auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast<void *>(1));
|
auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast<void *>(1));
|
||||||
auto wddmAlloc = static_cast<WddmAllocation *>(gpuAllocation);
|
auto wddmAlloc = static_cast<WddmAllocation *>(gpuAllocation);
|
||||||
@@ -361,11 +359,10 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenLockUnlockIsCalledThenRe
|
|||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleReturns32BitAllocWhenForce32bitAddressingIsSetAndRequireSpecificBitnessIsTrue) {
|
TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleReturns32BitAllocWhenForce32bitAddressingIsSetAndRequireSpecificBitnessIsTrue) {
|
||||||
auto osHandle = 1u;
|
auto osHandle = 1u;
|
||||||
auto size = 4096u;
|
|
||||||
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
||||||
|
|
||||||
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
||||||
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
||||||
|
|
||||||
memoryManager->setForce32BitAllocations(true);
|
memoryManager->setForce32BitAllocations(true);
|
||||||
|
|
||||||
@@ -383,11 +380,10 @@ TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleReturns32BitAllocW
|
|||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleDoesNotReturn32BitAllocWhenForce32bitAddressingIsSetAndRequireSpecificBitnessIsFalse) {
|
TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleDoesNotReturn32BitAllocWhenForce32bitAddressingIsSetAndRequireSpecificBitnessIsFalse) {
|
||||||
auto osHandle = 1u;
|
auto osHandle = 1u;
|
||||||
auto size = 4096u;
|
|
||||||
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
||||||
|
|
||||||
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
||||||
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
||||||
|
|
||||||
memoryManager->setForce32BitAllocations(true);
|
memoryManager->setForce32BitAllocations(true);
|
||||||
|
|
||||||
@@ -405,11 +401,10 @@ TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleDoesNotReturn32Bit
|
|||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHandleIsCalledThenDestroyResourceHandle) {
|
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHandleIsCalledThenDestroyResourceHandle) {
|
||||||
auto osHandle = 1u;
|
auto osHandle = 1u;
|
||||||
auto size = 4096u;
|
|
||||||
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
||||||
|
|
||||||
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, 4096u, false));
|
||||||
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
||||||
|
|
||||||
auto gpuAllocation = (WddmAllocation *)memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false);
|
auto gpuAllocation = (WddmAllocation *)memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false);
|
||||||
EXPECT_NE(nullptr, gpuAllocation);
|
EXPECT_NE(nullptr, gpuAllocation);
|
||||||
@@ -430,7 +425,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerSizeZeroWhenCreateFromShared
|
|||||||
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
||||||
|
|
||||||
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, size, false));
|
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, size, false));
|
||||||
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
||||||
|
|
||||||
auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false);
|
auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false);
|
||||||
ASSERT_NE(nullptr, gpuAllocation);
|
ASSERT_NE(nullptr, gpuAllocation);
|
||||||
@@ -444,7 +439,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleFa
|
|||||||
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
void *pSysMem = reinterpret_cast<void *>(0x1000);
|
||||||
|
|
||||||
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, size, false));
|
std::unique_ptr<Gmm> gmm(new Gmm(pSysMem, size, false));
|
||||||
auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
|
||||||
|
|
||||||
wddm->failOpenSharedHandle = true;
|
wddm->failOpenSharedHandle = true;
|
||||||
|
|
||||||
@@ -597,7 +592,6 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountN
|
|||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, AllocateGpuMemHostPtrOffseted) {
|
TEST_F(WddmMemoryManagerTest, AllocateGpuMemHostPtrOffseted) {
|
||||||
MockWddmAllocation alloc, allocOffseted;
|
MockWddmAllocation alloc, allocOffseted;
|
||||||
bool success = false;
|
|
||||||
// three pages
|
// three pages
|
||||||
void *ptr = alignedMalloc(4 * 4096, 4096);
|
void *ptr = alignedMalloc(4 * 4096, 4096);
|
||||||
ASSERT_NE(nullptr, ptr);
|
ASSERT_NE(nullptr, ptr);
|
||||||
@@ -651,7 +645,6 @@ TEST_F(WddmMemoryManagerTest, AllocateGpuMemHostPtrOffseted) {
|
|||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, AllocateGpuMemCheckGmm) {
|
TEST_F(WddmMemoryManagerTest, AllocateGpuMemCheckGmm) {
|
||||||
MockWddmAllocation allocation;
|
MockWddmAllocation allocation;
|
||||||
bool success = false;
|
|
||||||
// three pages
|
// three pages
|
||||||
void *ptr = alignedMalloc(3 * 4096, 4096);
|
void *ptr = alignedMalloc(3 * 4096, 4096);
|
||||||
auto *gpuAllocation = memoryManager->allocateGraphicsMemory(MockAllocationProperties{false, 3 * MemoryConstants::pageSize}, ptr);
|
auto *gpuAllocation = memoryManager->allocateGraphicsMemory(MockAllocationProperties{false, 3 * MemoryConstants::pageSize}, ptr);
|
||||||
@@ -669,9 +662,7 @@ TEST_F(WddmMemoryManagerTest, AllocateGpuMemCheckGmm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, GivenAlignedPointerWhenAllocate32BitMemoryThenGmmCalledWithCorrectPointerAndSize) {
|
TEST_F(WddmMemoryManagerTest, GivenAlignedPointerWhenAllocate32BitMemoryThenGmmCalledWithCorrectPointerAndSize) {
|
||||||
|
|
||||||
MockWddmAllocation allocation;
|
MockWddmAllocation allocation;
|
||||||
bool success = false;
|
|
||||||
uint32_t size = 4096;
|
uint32_t size = 4096;
|
||||||
void *ptr = reinterpret_cast<void *>(4096);
|
void *ptr = reinterpret_cast<void *>(4096);
|
||||||
auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(size, ptr, AllocationOrigin::EXTERNAL_ALLOCATION);
|
auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(size, ptr, AllocationOrigin::EXTERNAL_ALLOCATION);
|
||||||
@@ -682,7 +673,6 @@ TEST_F(WddmMemoryManagerTest, GivenAlignedPointerWhenAllocate32BitMemoryThenGmmC
|
|||||||
|
|
||||||
TEST_F(WddmMemoryManagerTest, GivenUnAlignedPointerAndSizeWhenAllocate32BitMemoryThenGmmCalledWithCorrectPointerAndSize) {
|
TEST_F(WddmMemoryManagerTest, GivenUnAlignedPointerAndSizeWhenAllocate32BitMemoryThenGmmCalledWithCorrectPointerAndSize) {
|
||||||
MockWddmAllocation allocation;
|
MockWddmAllocation allocation;
|
||||||
bool success = false;
|
|
||||||
uint32_t size = 0x1001;
|
uint32_t size = 0x1001;
|
||||||
void *ptr = reinterpret_cast<void *>(0x1001);
|
void *ptr = reinterpret_cast<void *>(0x1001);
|
||||||
auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(size, ptr, AllocationOrigin::EXTERNAL_ALLOCATION);
|
auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(size, ptr, AllocationOrigin::EXTERNAL_ALLOCATION);
|
||||||
@@ -955,9 +945,6 @@ TEST_F(BufferWithWddmMemory, GivenMisalignedHostPtrAndMultiplePagesSizeWhenAsked
|
|||||||
auto reqs = MockHostPtrManager::getAllocationRequirements(ptr, size);
|
auto reqs = MockHostPtrManager::getAllocationRequirements(ptr, size);
|
||||||
|
|
||||||
for (int i = 0; i < maxFragmentsCount; i++) {
|
for (int i = 0; i < maxFragmentsCount; i++) {
|
||||||
|
|
||||||
uintptr_t GpuPtr = (uintptr_t)(graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->gpuPtr);
|
|
||||||
uintptr_t CpuPtr = (uintptr_t)(reqs.AllocationFragments[i].allocationPtr);
|
|
||||||
EXPECT_NE((D3DKMT_HANDLE) nullptr, graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->handle);
|
EXPECT_NE((D3DKMT_HANDLE) nullptr, graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->handle);
|
||||||
|
|
||||||
EXPECT_NE(nullptr, graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->gmm);
|
EXPECT_NE(nullptr, graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->gmm);
|
||||||
@@ -1519,4 +1506,4 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatNeedsMa
|
|||||||
EXPECT_FALSE(allocation->isLocked());
|
EXPECT_FALSE(allocation->isLocked());
|
||||||
memoryManager->freeGraphicsMemory(allocation);
|
memoryManager->freeGraphicsMemory(allocation);
|
||||||
EXPECT_EQ(0u, wddm->evictTemporaryResourceResult.called);
|
EXPECT_EQ(0u, wddm->evictTemporaryResourceResult.called);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,8 +364,8 @@ TEST_F(WddmResidencyControllerTest, compactTrimCandidateListRemovesInitialNullEn
|
|||||||
residencyController->addToTrimCandidateList(&allocation3);
|
residencyController->addToTrimCandidateList(&allocation3);
|
||||||
residencyController->addToTrimCandidateList(&allocation4);
|
residencyController->addToTrimCandidateList(&allocation4);
|
||||||
|
|
||||||
size_t position3 = allocation3.getTrimCandidateListPosition(osContextId);
|
allocation3.getTrimCandidateListPosition(osContextId);
|
||||||
size_t position4 = allocation4.getTrimCandidateListPosition(osContextId);
|
allocation4.getTrimCandidateListPosition(osContextId);
|
||||||
|
|
||||||
residencyController->removeFromTrimCandidateList(&allocation2, false);
|
residencyController->removeFromTrimCandidateList(&allocation2, false);
|
||||||
residencyController->removeFromTrimCandidateList(&allocation1, false);
|
residencyController->removeFromTrimCandidateList(&allocation1, false);
|
||||||
@@ -687,7 +687,7 @@ TEST_F(WddmResidencyControllerWithGdiTest, trimToBudgetMarksEvictedAllocationNon
|
|||||||
residencyController->addToTrimCandidateList(&allocation2);
|
residencyController->addToTrimCandidateList(&allocation2);
|
||||||
residencyController->addToTrimCandidateList(&allocation3);
|
residencyController->addToTrimCandidateList(&allocation3);
|
||||||
|
|
||||||
bool status = residencyController->trimResidencyToBudget(3 * 4096);
|
residencyController->trimResidencyToBudget(3 * 4096);
|
||||||
|
|
||||||
EXPECT_FALSE(allocation1.getResidencyData().resident[osContextId]);
|
EXPECT_FALSE(allocation1.getResidencyData().resident[osContextId]);
|
||||||
EXPECT_FALSE(allocation2.getResidencyData().resident[osContextId]);
|
EXPECT_FALSE(allocation2.getResidencyData().resident[osContextId]);
|
||||||
@@ -713,7 +713,7 @@ TEST_F(WddmResidencyControllerWithGdiTest, trimToBudgetWaitsFromCpuWhenLastFence
|
|||||||
|
|
||||||
gdi->getWaitFromCpuArg().hDevice = (D3DKMT_HANDLE)0;
|
gdi->getWaitFromCpuArg().hDevice = (D3DKMT_HANDLE)0;
|
||||||
|
|
||||||
bool status = residencyController->trimResidencyToBudget(3 * 4096);
|
residencyController->trimResidencyToBudget(3 * 4096);
|
||||||
|
|
||||||
EXPECT_EQ(1u, wddm->makeNonResidentResult.called);
|
EXPECT_EQ(1u, wddm->makeNonResidentResult.called);
|
||||||
EXPECT_FALSE(allocation1.getResidencyData().resident[osContextId]);
|
EXPECT_FALSE(allocation1.getResidencyData().resident[osContextId]);
|
||||||
@@ -759,7 +759,7 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, trimToBudgetEvictsDon
|
|||||||
|
|
||||||
wddm->makeNonResidentResult.called = 0;
|
wddm->makeNonResidentResult.called = 0;
|
||||||
|
|
||||||
bool status = residencyController->trimResidencyToBudget(3 * 4096);
|
residencyController->trimResidencyToBudget(3 * 4096);
|
||||||
|
|
||||||
EXPECT_EQ(2u, wddm->makeNonResidentResult.called);
|
EXPECT_EQ(2u, wddm->makeNonResidentResult.called);
|
||||||
|
|
||||||
@@ -1012,6 +1012,6 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin
|
|||||||
|
|
||||||
EXPECT_CALL(*wddm, makeResident(::testing::_, ::testing::_, ::testing::_, ::testing::_)).Times(2).WillOnce(::testing::Invoke(makeResidentThatFails)).WillOnce(::testing::Invoke(makeResidentThatSucceds));
|
EXPECT_CALL(*wddm, makeResident(::testing::_, ::testing::_, ::testing::_, ::testing::_)).Times(2).WillOnce(::testing::Invoke(makeResidentThatFails)).WillOnce(::testing::Invoke(makeResidentThatSucceds));
|
||||||
|
|
||||||
bool result = residencyController->makeResidentResidencyAllocations(residencyPack);
|
residencyController->makeResidentResidencyAllocations(residencyPack);
|
||||||
EXPECT_TRUE(residencyController->isMemoryBudgetExhausted());
|
EXPECT_TRUE(residencyController->isMemoryBudgetExhausted());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user