Add initial support for context debug

Related-To: NEO-5478

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-01-25 20:43:48 +00:00
committed by Compute-Runtime-Automation
parent eb1ea19360
commit 3ab932b101
7 changed files with 72 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -43,4 +43,7 @@ std::string Drm::generateElfUUID(const void *data) {
return generateUUID();
}
void Drm::checkContextDebugSupport() {}
void Drm::setContextDebugFlag(uint32_t drmContextId) {}
} // namespace NEO

View File

@@ -119,6 +119,10 @@ class Drm {
requirePerContextVM = required;
}
void checkContextDebugSupport();
bool isContextDebugSupported() { return contextDebugSupported; }
MOCKABLE_VIRTUAL void setContextDebugFlag(uint32_t drmContextId);
MOCKABLE_VIRTUAL bool isVmBindAvailable();
MOCKABLE_VIRTUAL bool registerResourceClasses();
@@ -170,6 +174,7 @@ class Drm {
bool nonPersistentContextsSupported = false;
bool requirePerContextVM = false;
bool bindAvailable = false;
bool contextDebugSupported = false;
std::once_flag checkBindOnce;
std::unique_ptr<HwDeviceId> hwDeviceId;
int deviceId = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -7,6 +7,8 @@
#include "shared/source/os_interface/linux/os_context_linux.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/os_interface.h"
#include "shared/source/os_interface/os_context.h"
@@ -36,6 +38,11 @@ OsContextLinux::OsContextLinux(Drm &drm, uint32_t contextId, DeviceBitfield devi
if (drm.areNonPersistentContextsSupported()) {
drm.setNonPersistentContext(drmContextId);
}
if (drm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled() && !internalEngine) {
drm.setContextDebugFlag(drmContextId);
}
if (drm.isPreemptionSupported() && lowPriority) {
drm.setLowPriorityContextParam(drmContextId);
}