From 57f88ee197c881779eb8eebaca6464c880b20b21 Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Mon, 17 Jun 2019 13:56:03 +0200 Subject: [PATCH] Determine the engine flag while binding the context. Related-To: NEO-3008 Change-Id: Id2a9a210ca3a611b6663d43f1442b26cfccddb10 Signed-off-by: Piotr Fusik --- runtime/os_interface/linux/drm_neo.h | 2 +- runtime/os_interface/linux/drm_query.cpp | 6 ++++-- runtime/os_interface/linux/os_context_linux.cpp | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/os_interface/linux/drm_neo.h b/runtime/os_interface/linux/drm_neo.h index 2ba538b069..e91af3b86f 100644 --- a/runtime/os_interface/linux/drm_neo.h +++ b/runtime/os_interface/linux/drm_neo.h @@ -65,7 +65,7 @@ class Drm { uint32_t createDrmContext(); void destroyDrmContext(uint32_t drmContextId); void setLowPriorityContextParam(uint32_t drmContextId); - int bindDrmContext(uint32_t drmContextId, DeviceBitfield deviceBitfield, aub_stream::EngineType engineType); + unsigned int bindDrmContext(uint32_t drmContextId, DeviceBitfield deviceBitfield, aub_stream::EngineType engineType); void setGtType(GTTYPE eGtType) { this->eGtType = eGtType; } GTTYPE getGtType() const { return this->eGtType; } diff --git a/runtime/os_interface/linux/drm_query.cpp b/runtime/os_interface/linux/drm_query.cpp index ccf1130554..3daa9ea1ce 100644 --- a/runtime/os_interface/linux/drm_query.cpp +++ b/runtime/os_interface/linux/drm_query.cpp @@ -5,6 +5,8 @@ * */ +#include "runtime/os_interface/linux/drm_engine_mapper.h" + #include "drm_neo.h" namespace NEO { @@ -19,8 +21,8 @@ void Drm::queryEngineInfo() { void Drm::queryMemoryInfo() { } -int Drm::bindDrmContext(uint32_t drmContextId, DeviceBitfield deviceBitfield, aub_stream::EngineType engineType) { - return -1; +unsigned int Drm::bindDrmContext(uint32_t drmContextId, DeviceBitfield deviceBitfield, aub_stream::EngineType engineType) { + return DrmEngineMapper::engineNodeMap(engineType); } } // namespace NEO diff --git a/runtime/os_interface/linux/os_context_linux.cpp b/runtime/os_interface/linux/os_context_linux.cpp index 04a3770900..5451e9cc27 100644 --- a/runtime/os_interface/linux/os_context_linux.cpp +++ b/runtime/os_interface/linux/os_context_linux.cpp @@ -7,7 +7,6 @@ #include "runtime/os_interface/linux/os_context_linux.h" -#include "runtime/os_interface/linux/drm_engine_mapper.h" #include "runtime/os_interface/linux/drm_neo.h" #include "runtime/os_interface/linux/os_interface.h" #include "runtime/os_interface/os_context.h" @@ -26,12 +25,11 @@ OsContextLinux::OsContextLinux(Drm &drm, uint32_t contextId, DeviceBitfield devi aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority) : OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority), drm(drm) { - engineFlag = DrmEngineMapper::engineNodeMap(engineType); this->drmContextId = drm.createDrmContext(); if (drm.isPreemptionSupported() && lowPriority) { drm.setLowPriorityContextParam(this->drmContextId); } - drm.bindDrmContext(this->drmContextId, deviceBitfield, engineType); + this->engineFlag = drm.bindDrmContext(this->drmContextId, deviceBitfield, engineType); } OsContextLinux::~OsContextLinux() {