Add new debug flag allowing to not register trim callback.
Change-Id: I615be3edc9d843fb7b37cf32f2abd5e2839d6ada
This commit is contained in:
parent
a2ed6861d8
commit
f5a2b38fa4
|
@ -51,6 +51,7 @@ DECLARE_DEBUG_VARIABLE(bool, ForceDispatchScheduler, false, "dispatches schedule
|
||||||
DECLARE_DEBUG_VARIABLE(bool, TrackParentEvents, false, "events track their parents")
|
DECLARE_DEBUG_VARIABLE(bool, TrackParentEvents, false, "events track their parents")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, RebuildPrecompiledKernels, false, "forces driver to recompile precompiled kernels from sources")
|
DECLARE_DEBUG_VARIABLE(bool, RebuildPrecompiledKernels, false, "forces driver to recompile precompiled kernels from sources")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, LoopAtPlatformInitialize, false, "Adds endless loop in platform initalize, useful for debugging.")
|
DECLARE_DEBUG_VARIABLE(bool, LoopAtPlatformInitialize, false, "Adds endless loop in platform initalize, useful for debugging.")
|
||||||
|
DECLARE_DEBUG_VARIABLE(bool, DoNotRegisterTrimCallback, false, "When set to true driver is not registering trim callback.")
|
||||||
/*LOGGING FLAGS*/
|
/*LOGGING FLAGS*/
|
||||||
DECLARE_DEBUG_VARIABLE(bool, PrintDebugMessages, false, "when enabled, some debug messages will be propagated to console")
|
DECLARE_DEBUG_VARIABLE(bool, PrintDebugMessages, false, "when enabled, some debug messages will be propagated to console")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, DumpKernels, false, "Enables dumping kernels' program source code to text files and program from binary to bin file")
|
DECLARE_DEBUG_VARIABLE(bool, DumpKernels, false, "Enables dumping kernels' program source code to text files and program from binary to bin file")
|
||||||
|
|
|
@ -826,6 +826,9 @@ uint64_t Wddm::getHeap32Size() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wddm::registerTrimCallback(PFND3DKMT_TRIMNOTIFICATIONCALLBACK callback, WddmMemoryManager *memoryManager) {
|
void Wddm::registerTrimCallback(PFND3DKMT_TRIMNOTIFICATIONCALLBACK callback, WddmMemoryManager *memoryManager) {
|
||||||
|
if (DebugManager.flags.DoNotRegisterTrimCallback.get()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
D3DKMT_REGISTERTRIMNOTIFICATION registerTrimNotification;
|
D3DKMT_REGISTERTRIMNOTIFICATION registerTrimNotification;
|
||||||
registerTrimNotification.Callback = callback;
|
registerTrimNotification.Callback = callback;
|
||||||
registerTrimNotification.AdapterLuid = this->adapterLuid;
|
registerTrimNotification.AdapterLuid = this->adapterLuid;
|
||||||
|
|
|
@ -59,6 +59,7 @@ class WddmMock : public Wddm {
|
||||||
using Wddm::pagingFenceAddress;
|
using Wddm::pagingFenceAddress;
|
||||||
using Wddm::pagingQueue;
|
using Wddm::pagingQueue;
|
||||||
using Wddm::preemptionMode;
|
using Wddm::preemptionMode;
|
||||||
|
using Wddm::trimCallbackHandle;
|
||||||
using Wddm::wddmInterface;
|
using Wddm::wddmInterface;
|
||||||
|
|
||||||
WddmMock() : Wddm(){};
|
WddmMock() : Wddm(){};
|
||||||
|
|
|
@ -1107,6 +1107,14 @@ TEST_F(WddmMemoryManagerResidencyTest, trimCallbackIsRegisteredInWddmMemoryManag
|
||||||
EXPECT_EQ(wddm->getDevice(), gdi->getRegisterTrimNotificationArg().hDevice);
|
EXPECT_EQ(wddm->getDevice(), gdi->getRegisterTrimNotificationArg().hDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(WddmDebugModesTests, givenDebugModeWhenItIsActiveThenTrimCallbackIsNotRegistred) {
|
||||||
|
DebugManagerStateRestore stateRestore;
|
||||||
|
DebugManager.flags.DoNotRegisterTrimCallback.set(true);
|
||||||
|
WddmMock wddm;
|
||||||
|
wddm.init();
|
||||||
|
EXPECT_EQ(nullptr, wddm.trimCallbackHandle);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(WddmMemoryManagerResidencyTest, givenNotUsedAllocationsFromPreviousPeriodicTrimWhenTrimResidencyPeriodicTrimIsCalledThenAllocationsAreEvictedMarkedAndRemovedFromTrimCandidateList) {
|
TEST_F(WddmMemoryManagerResidencyTest, givenNotUsedAllocationsFromPreviousPeriodicTrimWhenTrimResidencyPeriodicTrimIsCalledThenAllocationsAreEvictedMarkedAndRemovedFromTrimCandidateList) {
|
||||||
D3DKMT_TRIMNOTIFICATION trimNotification = {0};
|
D3DKMT_TRIMNOTIFICATION trimNotification = {0};
|
||||||
trimNotification.Flags.PeriodicTrim = 1;
|
trimNotification.Flags.PeriodicTrim = 1;
|
||||||
|
|
|
@ -83,4 +83,5 @@ CreateMultipleDevices = 0
|
||||||
EnableExperimentalCommandBuffer = 0
|
EnableExperimentalCommandBuffer = 0
|
||||||
LoopAtPlatformInitialize = false
|
LoopAtPlatformInitialize = false
|
||||||
EnableTimestampPacket = false
|
EnableTimestampPacket = false
|
||||||
ReturnRawGpuTimestamps = 0
|
ReturnRawGpuTimestamps = 0
|
||||||
|
DoNotRegisterTrimCallback = false
|
Loading…
Reference in New Issue