Remove not needed arguments in init os interface functions

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-12-13 18:47:36 +00:00
committed by Compute-Runtime-Automation
parent b4ad6e011f
commit 7aebfc3293
7 changed files with 19 additions and 29 deletions

View File

@@ -11,7 +11,7 @@
namespace NEO {
bool RootDeviceEnvironment::initOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex) {
return initDrmOsInterface(std::move(hwDeviceId), rootDeviceIndex, this, this->osInterface, this->memoryOperationsInterface);
return initDrmOsInterface(std::move(hwDeviceId), rootDeviceIndex, this);
}
} // namespace NEO

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/linux/hw_device_id.h"
#include "shared/source/os_interface/linux/os_interface_linux.h"
#include "shared/source/os_interface/windows/os_interface_win.h"
@@ -13,9 +14,9 @@ namespace NEO {
bool RootDeviceEnvironment::initOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex) {
if (hwDeviceId->getDriverModelType() == DriverModelType::DRM) {
return initDrmOsInterface(std::move(hwDeviceId), rootDeviceIndex, this, osInterface, memoryOperationsInterface);
return initDrmOsInterface(std::move(hwDeviceId), rootDeviceIndex, this);
} else {
return initWddmOsInterface(std::move(hwDeviceId), rootDeviceIndex, this, osInterface, memoryOperationsInterface);
return initWddmOsInterface(std::move(hwDeviceId), this);
}
}

View File

@@ -11,7 +11,7 @@
namespace NEO {
bool RootDeviceEnvironment::initOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex) {
return initWddmOsInterface(std::move(hwDeviceId), rootDeviceIndex, this, osInterface, memoryOperationsInterface);
return initWddmOsInterface(std::move(hwDeviceId), this);
}
} // namespace NEO

View File

@@ -5,16 +5,11 @@
*
*/
#include "shared/source/os_interface/linux/os_interface_linux.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gmm_helper/gmm_lib.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/linux/drm_memory_operations_handler.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/sys_calls.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/linux/hw_device_id.h"
#include <sys/stat.h>
#include <system_error>
@@ -35,8 +30,7 @@ bool OSInterface::isDebugAttachAvailable() const {
}
bool initDrmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex,
RootDeviceEnvironment *rootDeviceEnv,
std::unique_ptr<OSInterface> &dstOsInterface, std::unique_ptr<MemoryOperationsHandler> &dstMemoryOpsHandler) {
RootDeviceEnvironment *rootDeviceEnv) {
auto hwDeviceIdDrm = std::unique_ptr<HwDeviceIdDrm>(reinterpret_cast<HwDeviceIdDrm *>(hwDeviceId.release()));
Drm *drm = Drm::create(std::move(hwDeviceIdDrm), *rootDeviceEnv);
@@ -44,6 +38,7 @@ bool initDrmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootD
return false;
}
auto &dstOsInterface = rootDeviceEnv->osInterface;
dstOsInterface.reset(new OSInterface());
dstOsInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
auto hardwareInfo = rootDeviceEnv->getMutableHardwareInfo();
@@ -51,7 +46,7 @@ bool initDrmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootD
if (hwConfig->configureHwInfoDrm(hardwareInfo, hardwareInfo, dstOsInterface.get())) {
return false;
}
dstMemoryOpsHandler = DrmMemoryOperationsHandler::create(*drm, rootDeviceIndex);
rootDeviceEnv->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, rootDeviceIndex);
[[maybe_unused]] bool result = rootDeviceEnv->initAilConfiguration();
DEBUG_BREAK_IF(!result);

View File

@@ -7,16 +7,15 @@
#pragma once
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/os_interface.h"
#include <cstdint>
#include <memory>
namespace NEO {
class HwDeviceId;
struct RootDeviceEnvironment;
bool initDrmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex,
RootDeviceEnvironment *rootDeviceEnv,
std::unique_ptr<OSInterface> &dstOsInterface, std::unique_ptr<MemoryOperationsHandler> &dstMemoryOpsHandler);
RootDeviceEnvironment *rootDeviceEnv);
} // namespace NEO

View File

@@ -14,9 +14,7 @@
namespace NEO {
bool initWddmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex,
RootDeviceEnvironment *rootDeviceEnv,
std::unique_ptr<OSInterface> &dstOsInterface, std::unique_ptr<MemoryOperationsHandler> &dstMemoryOpsHandler) {
bool initWddmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, RootDeviceEnvironment *rootDeviceEnv) {
UNRECOVERABLE_IF(hwDeviceId->getDriverModelType() != DriverModelType::WDDM);
auto hwDeviceIdWddm = std::unique_ptr<HwDeviceIdWddm>(reinterpret_cast<HwDeviceIdWddm *>(hwDeviceId.release()));
NEO::Wddm *wddm = Wddm::createWddm(std::move(hwDeviceIdWddm), *rootDeviceEnv);
@@ -24,7 +22,7 @@ bool initWddmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t root
delete wddm;
return false;
}
dstMemoryOpsHandler = std::make_unique<WddmMemoryOperationsHandler>(wddm);
rootDeviceEnv->memoryOperationsInterface = std::make_unique<WddmMemoryOperationsHandler>(wddm);
return true;
}
} // namespace NEO

View File

@@ -7,16 +7,13 @@
#pragma once
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/os_interface.h"
#include <cstdint>
#include <memory>
namespace NEO {
bool initWddmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex,
RootDeviceEnvironment *rootDeviceEnv,
std::unique_ptr<OSInterface> &dstOsInterface, std::unique_ptr<MemoryOperationsHandler> &dstMemoryOpsHandler);
class HwDeviceId;
struct RootDeviceEnvironment;
bool initWddmOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, RootDeviceEnvironment *rootDeviceEnv);
} // namespace NEO