Add new debug flag allowing to not register trim callback.

Change-Id: I615be3edc9d843fb7b37cf32f2abd5e2839d6ada
This commit is contained in:
Mrozek, Michal
2018-09-17 18:23:04 -07:00
committed by sys_ocldev
parent a2ed6861d8
commit f5a2b38fa4
5 changed files with 15 additions and 1 deletions

View File

@@ -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, 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, DoNotRegisterTrimCallback, false, "When set to true driver is not registering trim callback.")
/*LOGGING FLAGS*/
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")

View File

@@ -826,6 +826,9 @@ uint64_t Wddm::getHeap32Size() {
}
void Wddm::registerTrimCallback(PFND3DKMT_TRIMNOTIFICATIONCALLBACK callback, WddmMemoryManager *memoryManager) {
if (DebugManager.flags.DoNotRegisterTrimCallback.get()) {
return;
}
D3DKMT_REGISTERTRIMNOTIFICATION registerTrimNotification;
registerTrimNotification.Callback = callback;
registerTrimNotification.AdapterLuid = this->adapterLuid;