refactor: bind drm context within IoctlHelper::createDrmContext method

Related-To: NEO-6999
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-06-28 17:10:24 +02:00
committed by Compute-Runtime-Automation
parent efa19a0b18
commit fffd56d7a6
11 changed files with 23 additions and 18 deletions

View File

@@ -14,7 +14,7 @@
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/drm_wrappers.h"
#include "shared/source/os_interface/os_context.h"
#include "shared/source/os_interface/linux/os_context_linux.h"
#include "drm/i915_drm.h"
@@ -82,7 +82,7 @@ void IoctlHelper::logExecBuffer(const ExecBuffer &execBuffer, std::stringstream
<< " }\n";
}
uint32_t IoctlHelper::createDrmContext(Drm &drm, const OsContext &osContext, uint32_t drmVmId) {
uint32_t IoctlHelper::createDrmContext(Drm &drm, OsContextLinux &osContext, uint32_t drmVmId, uint32_t deviceIndex) {
const auto numberOfCCS = drm.getRootDeviceEnvironment().getHardwareInfo()->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
const bool debuggableContext = drm.isContextDebugSupported() && drm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled() && !osContext.isInternalEngine();
@@ -103,6 +103,8 @@ uint32_t IoctlHelper::createDrmContext(Drm &drm, const OsContext &osContext, uin
if (drm.isPreemptionSupported() && osContext.isLowPriority()) {
drm.setLowPriorityContextParam(drmContextId);
}
auto engineFlag = drm.bindDrmContext(drmContextId, deviceIndex, osContext.getEngineType(), osContext.isEngineInstanced());
osContext.setEngineFlag(engineFlag);
return drmContextId;
}