mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Move GmmHelper to RootDeviceEnvironment
Related-To: NEO-3691 Change-Id: I8afdf65f360acc5b9d7b47a728d1d185e5e3700b Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
55ab09e618
commit
ec647dabe9
@ -14,6 +14,7 @@
|
||||
#include "opencl/source/os_interface/linux/drm_command_stream.h"
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_execution_environment.h"
|
||||
#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h"
|
||||
#include "test.h"
|
||||
|
||||
@ -31,8 +32,6 @@ class DrmCommandStreamTest : public ::testing::Test {
|
||||
|
||||
mock = new ::testing::NiceMock<DrmMockImpl>(mockFd);
|
||||
|
||||
executionEnvironment.setHwInfo(*platformDevices);
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
|
||||
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(mock);
|
||||
|
||||
@ -75,14 +74,14 @@ class DrmCommandStreamTest : public ::testing::Test {
|
||||
const int mockFd = 33;
|
||||
static const uint64_t alignment = MemoryConstants::allocationAlignment;
|
||||
DebugManagerStateRestore dbgState;
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<OsContextLinux> osContext;
|
||||
};
|
||||
|
||||
class DrmCommandStreamEnhancedTest : public ::testing::Test {
|
||||
public:
|
||||
std::unique_ptr<DebugManagerStateRestore> dbgState;
|
||||
ExecutionEnvironment *executionEnvironment;
|
||||
MockExecutionEnvironment *executionEnvironment;
|
||||
DrmMockCustom *mock;
|
||||
CommandStreamReceiver *csr = nullptr;
|
||||
|
||||
@ -91,10 +90,8 @@ class DrmCommandStreamEnhancedTest : public ::testing::Test {
|
||||
|
||||
template <typename GfxFamily>
|
||||
void SetUpT() {
|
||||
executionEnvironment = new ExecutionEnvironment;
|
||||
executionEnvironment = new MockExecutionEnvironment();
|
||||
executionEnvironment->incRefInternal();
|
||||
executionEnvironment->setHwInfo(*platformDevices);
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->initGmm();
|
||||
this->dbgState = std::make_unique<DebugManagerStateRestore>();
|
||||
//make sure this is disabled, we don't want to test this now
|
||||
|
@ -1384,7 +1384,7 @@ struct MockDrmCsr : public DrmCommandStreamReceiver<GfxFamily> {
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreatePageTableMngrIsCalledThenCreatePageTableManager) {
|
||||
executionEnvironment.prepareRootDeviceEnvironments(2);
|
||||
executionEnvironment.initGmm();
|
||||
executionEnvironment.rootDeviceEnvironments[1]->initGmm();
|
||||
executionEnvironment.rootDeviceEnvironments[1]->osInterface = std::make_unique<OSInterface>();
|
||||
executionEnvironment.rootDeviceEnvironments[1]->osInterface->get()->setDrm(new DrmMockCustom());
|
||||
auto csr = std::make_unique<MockDrmCsr<FamilyType>>(executionEnvironment, 1, gemCloseWorkerMode::gemCloseWorkerActive);
|
||||
|
Reference in New Issue
Block a user