mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Add initial support for context debug
Related-To: NEO-5478 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
eb1ea19360
commit
3ab932b101
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user