fix: do not notify KMDAF when lock/unlock fails

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-08-16 10:40:07 +00:00
committed by Compute-Runtime-Automation
parent 6fcb0f1407
commit a26e25f1df
2 changed files with 37 additions and 6 deletions

View File

@@ -887,8 +887,10 @@ void *Wddm::lockResource(const D3DKMT_HANDLE &handle, bool applyMakeResidentPrio
lock2.hAllocation = handle;
lock2.hDevice = this->device;
[[maybe_unused]] NTSTATUS status = getGdi()->lock2(&lock2);
DEBUG_BREAK_IF(status != STATUS_SUCCESS);
NTSTATUS status = getGdi()->lock2(&lock2);
if (status != STATUS_SUCCESS) {
return nullptr;
}
kmDafLock(handle);
return lock2.pData;
@@ -900,8 +902,10 @@ void Wddm::unlockResource(const D3DKMT_HANDLE &handle) {
unlock2.hAllocation = handle;
unlock2.hDevice = this->device;
[[maybe_unused]] NTSTATUS status = getGdi()->unlock2(&unlock2);
DEBUG_BREAK_IF(status != STATUS_SUCCESS);
NTSTATUS status = getGdi()->unlock2(&unlock2);
if (status != STATUS_SUCCESS) {
return;
}
kmDafListener->notifyUnlock(featureTable->flags.ftrKmdDaf, getAdapter(), device, &handle, 1, getGdi()->escape);
}