mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Refactoring HwDeviceId
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
b2fae343ec
commit
67aa1ad7ec
@ -25,7 +25,7 @@ const uint32_t numSubDevices = 2u;
|
||||
constexpr int mockFd = 0;
|
||||
class TestDriverMockDrm : public Drm {
|
||||
public:
|
||||
TestDriverMockDrm(std::string &bdf, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(mockFd, bdf.c_str()), rootDeviceEnvironment) {}
|
||||
TestDriverMockDrm(std::string &bdf, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, bdf.c_str()), rootDeviceEnvironment) {}
|
||||
};
|
||||
|
||||
class DriverLinuxFixture : public ::testing::Test {
|
||||
|
@ -34,7 +34,7 @@ class EngineNeoDrm : public Drm {
|
||||
public:
|
||||
using Drm::getEngineInfo;
|
||||
const int mockFd = 0;
|
||||
EngineNeoDrm(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(mockFd, ""), rootDeviceEnvironment) {}
|
||||
EngineNeoDrm(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, ""), rootDeviceEnvironment) {}
|
||||
};
|
||||
template <>
|
||||
struct Mock<EngineNeoDrm> : public EngineNeoDrm {
|
||||
|
@ -26,7 +26,7 @@ namespace ult {
|
||||
constexpr int mockFd = 0;
|
||||
class SysmanMockDrm : public Drm {
|
||||
public:
|
||||
SysmanMockDrm(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(mockFd, ""), rootDeviceEnvironment) {}
|
||||
SysmanMockDrm(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, ""), rootDeviceEnvironment) {}
|
||||
};
|
||||
|
||||
class PublicLinuxSysmanImp : public L0::LinuxSysmanImp {
|
||||
|
@ -35,7 +35,7 @@ class MemoryNeoDrm : public Drm {
|
||||
public:
|
||||
using Drm::memoryInfo;
|
||||
const int mockFd = 33;
|
||||
MemoryNeoDrm(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(mockFd, ""), rootDeviceEnvironment) {}
|
||||
MemoryNeoDrm(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, ""), rootDeviceEnvironment) {}
|
||||
};
|
||||
|
||||
template <>
|
||||
|
@ -31,7 +31,7 @@ const DeviceDescriptor deviceDescriptorTable[] = {
|
||||
#undef NAMEDDEVICE
|
||||
{0, nullptr, nullptr, GTTYPE_UNDEFINED}};
|
||||
|
||||
Drm *Drm::create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
std::unique_ptr<Drm> drmObject;
|
||||
if (DebugManager.flags.EnableNullHardware.get() == true) {
|
||||
drmObject.reset(new DrmNullDevice(std::move(hwDeviceId), rootDeviceEnvironment));
|
||||
|
@ -27,7 +27,7 @@ void MemoryAllocatorMultiDeviceSystemSpecificFixture::SetUp(ExecutionEnvironment
|
||||
for (auto i = 0u; i < executionEnvironment.rootDeviceEnvironments.size(); i++) {
|
||||
gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments[i]->getGmmClientContext(), nullptr, 0, 0, false);
|
||||
auto wddm = static_cast<WddmMock *>(executionEnvironment.rootDeviceEnvironments[i]->osInterface->getDriverModel()->as<Wddm>());
|
||||
wddm->hwDeviceId = std::make_unique<HwDeviceId>(ADAPTER_HANDLE, LUID{}, osEnvironment, std::make_unique<UmKmDataTranslator>());
|
||||
wddm->hwDeviceId = std::make_unique<HwDeviceIdWddm>(ADAPTER_HANDLE, LUID{}, osEnvironment, std::make_unique<UmKmDataTranslator>());
|
||||
wddm->callBaseMapGpuVa = false;
|
||||
|
||||
allocationInfo.pPrivateDriverData = gmm->gmmResourceInfo->peekHandle();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -9,6 +9,7 @@
|
||||
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/os_interface/linux/drm_neo.h"
|
||||
#include "shared/source/os_interface/linux/hw_device_id.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
@ -20,7 +21,7 @@ class DrmWrap : public NEO::Drm {
|
||||
static std::unique_ptr<NEO::Drm> createDrm(RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
auto hwDeviceIds = OSInterface::discoverDevices(rootDeviceEnvironment.executionEnvironment);
|
||||
if (!hwDeviceIds.empty()) {
|
||||
return std::unique_ptr<Drm>{NEO::Drm::create(std::move(hwDeviceIds[0]), rootDeviceEnvironment)};
|
||||
return std::unique_ptr<Drm>{NEO::Drm::create(std::unique_ptr<HwDeviceIdDrm>(hwDeviceIds[0].release()->as<HwDeviceIdDrm>()), rootDeviceEnvironment)};
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -122,16 +122,16 @@ TEST(DrmTest, GivenSelectedExistingDeviceWhenOpenDirSuccedsThenHwDeviceIdsHavePr
|
||||
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_EQ(1u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
|
||||
entryIndex = 0;
|
||||
openCounter = 2;
|
||||
hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_EQ(2u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, GivenSelectedExistingDeviceWhenOpenDirFailsThenRetryOpeningRenderDevices) {
|
||||
@ -146,16 +146,16 @@ TEST(DrmTest, GivenSelectedExistingDeviceWhenOpenDirFailsThenRetryOpeningRenderD
|
||||
EXPECT_STREQ("/dev/dri/renderD128", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(1u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
|
||||
openCounter = 2;
|
||||
hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_STREQ("/dev/dri/renderD129", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(2u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, givenPrintIoctlEntriesWhenCallIoctlThenIoctlIsPrinted) {
|
||||
@ -286,9 +286,9 @@ TEST(DrmTest, GivenFailingOpenDirAndMultipleAvailableDevicesWhenCreateMultipleRo
|
||||
EXPECT_STREQ("/dev/dri/renderD129", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(requestedNumRootDevices, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, GivenMultipleAvailableDevicesWhenCreateMultipleRootDevicesFlagIsSetThenTheFlagIsRespected) {
|
||||
@ -304,9 +304,9 @@ TEST(DrmTest, GivenMultipleAvailableDevicesWhenCreateMultipleRootDevicesFlagIsSe
|
||||
EXPECT_STREQ("/dev/dri/by-path/pci-0000:test2-render", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(requestedNumRootDevices, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, GivenSelectedIncorectDeviceWhenGetDeviceFdThenFail) {
|
||||
|
@ -22,11 +22,11 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct mockHwDeviceId : public HwDeviceId {
|
||||
using HwDeviceId::osEnvironment;
|
||||
struct mockHwDeviceId : public HwDeviceIdWddm {
|
||||
using HwDeviceIdWddm::osEnvironment;
|
||||
};
|
||||
|
||||
WddmMock::WddmMock(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::make_unique<HwDeviceId>(ADAPTER_HANDLE, LUID{}, rootDeviceEnvironment.executionEnvironment.osEnvironment.get(), std::make_unique<UmKmDataTranslator>()), rootDeviceEnvironment) {
|
||||
WddmMock::WddmMock(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::make_unique<HwDeviceIdWddm>(ADAPTER_HANDLE, LUID{}, rootDeviceEnvironment.executionEnvironment.osEnvironment.get(), std::make_unique<UmKmDataTranslator>()), rootDeviceEnvironment) {
|
||||
if (!rootDeviceEnvironment.executionEnvironment.osEnvironment.get()) {
|
||||
rootDeviceEnvironment.executionEnvironment.osEnvironment = std::make_unique<OsEnvironmentWin>();
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class WddmMock : public Wddm {
|
||||
using Wddm::timestampFrequency;
|
||||
using Wddm::wddmInterface;
|
||||
|
||||
WddmMock(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceId), rootDeviceEnvironment) {}
|
||||
WddmMock(std::unique_ptr<HwDeviceIdWddm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceId), rootDeviceEnvironment) {}
|
||||
WddmMock(RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
~WddmMock();
|
||||
|
||||
|
@ -25,7 +25,7 @@ using namespace NEO;
|
||||
TEST(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSharedAllocationIsCreatedFromMultipleThreadsThenSingleBoIsReused) {
|
||||
class MockDrm : public Drm {
|
||||
public:
|
||||
MockDrm(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(fd, ""), rootDeviceEnvironment) {}
|
||||
MockDrm(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, ""), rootDeviceEnvironment) {}
|
||||
|
||||
int ioctl(unsigned long request, void *arg) override {
|
||||
if (request == DRM_IOCTL_PRIME_FD_TO_HANDLE) {
|
||||
@ -77,7 +77,7 @@ TEST(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSharedAllocationIsCreatedFro
|
||||
TEST(DrmMemoryManagerTest, givenMultipleThreadsWhenSharedAllocationIsCreatedThenPrimeFdToHandleDoesNotRaceWithClose) {
|
||||
class MockDrm : public Drm {
|
||||
public:
|
||||
MockDrm(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(fd, ""), rootDeviceEnvironment) {
|
||||
MockDrm(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, ""), rootDeviceEnvironment) {
|
||||
primeFdHandle = 1;
|
||||
closeHandle = 1;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
using NEO::constructPlatform;
|
||||
using NEO::Drm;
|
||||
using NEO::HwDeviceId;
|
||||
using NEO::HwDeviceIdDrm;
|
||||
using NEO::RootDeviceEnvironment;
|
||||
|
||||
static const int mockFd = 33;
|
||||
@ -36,7 +36,7 @@ static const char *mockPciPath = "";
|
||||
class DrmMockImpl : public Drm {
|
||||
public:
|
||||
DrmMockImpl(int fd) : DrmMockImpl(fd, *constructPlatform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]){};
|
||||
DrmMockImpl(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(fd, mockPciPath), rootDeviceEnvironment){};
|
||||
DrmMockImpl(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, mockPciPath), rootDeviceEnvironment){};
|
||||
|
||||
MOCK_METHOD2(ioctl, int(unsigned long request, void *arg));
|
||||
};
|
||||
@ -44,14 +44,14 @@ class DrmMockImpl : public Drm {
|
||||
class DrmMockSuccess : public Drm {
|
||||
public:
|
||||
DrmMockSuccess() : DrmMockSuccess(mockFd, *constructPlatform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {}
|
||||
DrmMockSuccess(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(fd, mockPciPath), rootDeviceEnvironment) {}
|
||||
DrmMockSuccess(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, mockPciPath), rootDeviceEnvironment) {}
|
||||
|
||||
int ioctl(unsigned long request, void *arg) override { return 0; };
|
||||
};
|
||||
|
||||
class DrmMockFail : public Drm {
|
||||
public:
|
||||
DrmMockFail() : Drm(std::make_unique<HwDeviceId>(mockFd, mockPciPath), *constructPlatform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {}
|
||||
DrmMockFail() : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), *constructPlatform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {}
|
||||
|
||||
int ioctl(unsigned long request, void *arg) override { return -1; };
|
||||
};
|
||||
@ -334,7 +334,7 @@ class DrmMockCustom : public Drm {
|
||||
ioctl_res_ext = &NONE;
|
||||
}
|
||||
|
||||
DrmMockCustom() : Drm(std::make_unique<HwDeviceId>(mockFd, mockPciPath), *constructPlatform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {
|
||||
DrmMockCustom() : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), *constructPlatform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {
|
||||
reset();
|
||||
ioctl_expected.contextCreate = static_cast<int>(NEO::HwHelper::get(NEO::defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*NEO::defaultHwInfo).size());
|
||||
ioctl_expected.contextDestroy = ioctl_expected.contextCreate.load();
|
||||
|
@ -37,7 +37,7 @@ class DrmMockForWorker : public Drm {
|
||||
std::atomic<int> gem_close_cnt;
|
||||
std::atomic<int> gem_close_expected;
|
||||
std::atomic<std::thread::id> ioctl_caller_thread_id;
|
||||
DrmMockForWorker() : Drm(std::make_unique<HwDeviceId>(mockFd, mockPciPath), *platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {
|
||||
DrmMockForWorker() : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), *platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {
|
||||
}
|
||||
int ioctl(unsigned long request, void *arg) override {
|
||||
if (_IOC_TYPE(request) == DRM_IOCTL_BASE) {
|
||||
|
@ -48,7 +48,7 @@ class DrmMock : public Drm {
|
||||
using Drm::translateTopologyInfo;
|
||||
using Drm::virtualMemoryIds;
|
||||
|
||||
DrmMock(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceId>(fd, ""), rootDeviceEnvironment) {
|
||||
DrmMock(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, ""), rootDeviceEnvironment) {
|
||||
sliceCountChangeSupported = true;
|
||||
|
||||
if (rootDeviceEnvironment.executionEnvironment.isDebuggingEnabled()) {
|
||||
@ -88,11 +88,11 @@ class DrmMock : public Drm {
|
||||
}
|
||||
|
||||
void setFileDescriptor(int fd) {
|
||||
hwDeviceId = std::make_unique<HwDeviceId>(fd, "");
|
||||
hwDeviceId = std::make_unique<HwDeviceIdDrm>(fd, "");
|
||||
}
|
||||
|
||||
void setPciPath(const char *pciPath) {
|
||||
hwDeviceId = std::make_unique<HwDeviceId>(getFileDescriptor(), pciPath);
|
||||
hwDeviceId = std::make_unique<HwDeviceIdDrm>(getFileDescriptor(), pciPath);
|
||||
}
|
||||
|
||||
void setDeviceID(int deviceId) { this->deviceId = deviceId; }
|
||||
|
@ -31,7 +31,7 @@ class DrmMockDefault : public DrmMock {
|
||||
Drm **pDrmToReturnFromCreateFunc = nullptr;
|
||||
bool disableBindDefaultInTests = true;
|
||||
|
||||
Drm *Drm::create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
rootDeviceEnvironment.setHwInfo(defaultHwInfo.get());
|
||||
if (pDrmToReturnFromCreateFunc) {
|
||||
return *pDrmToReturnFromCreateFunc;
|
||||
|
@ -440,7 +440,7 @@ TEST(HwDeviceId, whenHwDeviceIdIsDestroyedThenFileDescriptorIsClosed) {
|
||||
SysCalls::closeFuncCalled = 0;
|
||||
int fileDescriptor = 0x1234;
|
||||
{
|
||||
HwDeviceId hwDeviceId(fileDescriptor, "");
|
||||
HwDeviceIdDrm hwDeviceId(fileDescriptor, "");
|
||||
}
|
||||
EXPECT_EQ(1u, SysCalls::closeFuncCalled);
|
||||
EXPECT_EQ(fileDescriptor, SysCalls::closeFuncArgPassed);
|
||||
|
@ -45,7 +45,7 @@ namespace SysCalls {
|
||||
extern const wchar_t *currentLibraryPath;
|
||||
}
|
||||
extern uint32_t numRootDevicesToEnum;
|
||||
std::unique_ptr<HwDeviceId> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid);
|
||||
std::unique_ptr<HwDeviceIdWddm> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid);
|
||||
} // namespace NEO
|
||||
|
||||
using namespace NEO;
|
||||
@ -100,7 +100,7 @@ TEST_F(Wddm20Tests, givenNullPageTableManagerAndRenderCompressedResourceWhenMapp
|
||||
|
||||
TEST(WddmDiscoverDevices, WhenNoHwDeviceIdIsProvidedToWddmThenWddmIsNotCreated) {
|
||||
struct MockWddm : public Wddm {
|
||||
MockWddm(std::unique_ptr<HwDeviceId> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceIdIn), rootDeviceEnvironment) {}
|
||||
MockWddm(std::unique_ptr<HwDeviceIdWddm> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceIdIn), rootDeviceEnvironment) {}
|
||||
};
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
@ -1114,7 +1114,8 @@ TEST(WddmGfxPartitionTests, WhenInitializingGfxPartitionThen64KBHeapsAreUsed) {
|
||||
struct MockWddm : public Wddm {
|
||||
using Wddm::gfxPartition;
|
||||
|
||||
MockWddm(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(OSInterface::discoverDevices(rootDeviceEnvironment.executionEnvironment)[0]), rootDeviceEnvironment) {}
|
||||
MockWddm(RootDeviceEnvironment &rootDeviceEnvironment)
|
||||
: Wddm(std::unique_ptr<HwDeviceIdWddm>(OSInterface::discoverDevices(rootDeviceEnvironment.executionEnvironment)[0].release()->as<HwDeviceIdWddm>()), rootDeviceEnvironment) {}
|
||||
};
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
@ -1357,7 +1358,7 @@ TEST(HwDeviceId, whenHwDeviceIdIsDestroyedThenAdapterIsClosed) {
|
||||
|
||||
D3DKMT_HANDLE adapter = 0x1234;
|
||||
{
|
||||
HwDeviceId hwDeviceId{adapter, {}, osEnv.get(), std::make_unique<UmKmDataTranslator>()};
|
||||
HwDeviceIdWddm hwDeviceId{adapter, {}, osEnv.get(), std::make_unique<UmKmDataTranslator>()};
|
||||
}
|
||||
EXPECT_EQ(1u, GdiWithMockedCloseFunc::closeAdapterCalled);
|
||||
EXPECT_EQ(adapter, GdiWithMockedCloseFunc::closeAdapterCalledArgPassed);
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "opencl/test/unit_test/mocks/mock_wddm.h"
|
||||
|
||||
namespace NEO {
|
||||
Wddm *Wddm::createWddm(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
Wddm *Wddm::createWddm(std::unique_ptr<HwDeviceIdWddm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
return new WddmMock(rootDeviceEnvironment);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
@ -30,7 +30,7 @@ class WddmWithKmDafMock : public Wddm {
|
||||
using Wddm::mapGpuVirtualAddress;
|
||||
|
||||
WddmWithKmDafMock(RootDeviceEnvironment &rootDeviceEnvironment)
|
||||
: Wddm(std::make_unique<HwDeviceId>(ADAPTER_HANDLE, LUID{}, rootDeviceEnvironment.executionEnvironment.osEnvironment.get(), std::make_unique<UmKmDataTranslator>()),
|
||||
: Wddm(std::make_unique<HwDeviceIdWddm>(ADAPTER_HANDLE, LUID{}, rootDeviceEnvironment.executionEnvironment.osEnvironment.get(), std::make_unique<UmKmDataTranslator>()),
|
||||
rootDeviceEnvironment) {
|
||||
kmDafListener.reset(new KmDafListenerMock);
|
||||
}
|
||||
|
@ -22,6 +22,6 @@ TEST(wddmCreateTests, givenInputVersionWhenCreatingThenCreateRequestedObject) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment);
|
||||
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
std::unique_ptr<Wddm> wddm(Wddm::createWddm(std::move(hwDeviceIds[0]), rootDeviceEnvironment));
|
||||
std::unique_ptr<Wddm> wddm(Wddm::createWddm(std::unique_ptr<HwDeviceIdWddm>(hwDeviceIds[0].release()->as<HwDeviceIdWddm>()), rootDeviceEnvironment));
|
||||
EXPECT_NE(nullptr, wddm);
|
||||
}
|
||||
|
@ -17,15 +17,18 @@ struct HardwareInfo;
|
||||
class OSInterface;
|
||||
|
||||
struct PhysicalDevicePciBusInfo {
|
||||
PhysicalDevicePciBusInfo() = default;
|
||||
|
||||
PhysicalDevicePciBusInfo(uint32_t domain, uint32_t bus, uint32_t device, uint32_t function)
|
||||
: pciDomain(domain), pciBus(bus), pciDevice(device), pciFunction(function) {}
|
||||
|
||||
uint32_t pciDomain;
|
||||
uint32_t pciBus;
|
||||
uint32_t pciDevice;
|
||||
uint32_t pciFunction;
|
||||
static constexpr uint32_t InvalidValue = std::numeric_limits<uint32_t>::max();
|
||||
static constexpr PhysicalDevicePciBusInfo invalid() { return {}; }
|
||||
|
||||
static const uint32_t InvalidValue = std::numeric_limits<uint32_t>::max();
|
||||
uint32_t pciDomain = InvalidValue;
|
||||
uint32_t pciBus = InvalidValue;
|
||||
uint32_t pciDevice = InvalidValue;
|
||||
uint32_t pciFunction = InvalidValue;
|
||||
};
|
||||
|
||||
class DriverInfo {
|
||||
|
@ -63,7 +63,7 @@ constexpr const char *getIoctlParamString(int param) {
|
||||
|
||||
} // namespace IoctlHelper
|
||||
|
||||
Drm::Drm(std::unique_ptr<HwDeviceId> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment)
|
||||
Drm::Drm(std::unique_ptr<HwDeviceIdDrm> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment)
|
||||
: DriverModel(DriverModelType::DRM),
|
||||
hwDeviceId(std::move(hwDeviceIdIn)), rootDeviceEnvironment(rootDeviceEnvironment) {
|
||||
pagingFence.fill(0u);
|
||||
@ -375,7 +375,7 @@ void Drm::setupSystemInfo(HardwareInfo *hwInfo, SystemInfo &sysInfo) {
|
||||
void appendHwDeviceId(std::vector<std::unique_ptr<HwDeviceId>> &hwDeviceIds, int fileDescriptor, const char *pciPath) {
|
||||
if (fileDescriptor >= 0) {
|
||||
if (Drm::isi915Version(fileDescriptor)) {
|
||||
hwDeviceIds.push_back(std::make_unique<HwDeviceId>(fileDescriptor, pciPath));
|
||||
hwDeviceIds.push_back(std::make_unique<HwDeviceIdDrm>(fileDescriptor, pciPath));
|
||||
} else {
|
||||
SysCalls::close(fileDescriptor);
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ class Drm : public DriverModel {
|
||||
|
||||
static bool isi915Version(int fd);
|
||||
|
||||
static Drm *create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
static Drm *create(std::unique_ptr<HwDeviceIdDrm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
static void overrideBindSupport(bool &useVmBind);
|
||||
std::string getPciPath() {
|
||||
return hwDeviceId->getPciPath();
|
||||
@ -224,14 +224,14 @@ class Drm : public DriverModel {
|
||||
bool contextDebugSupported = false;
|
||||
bool newResourceBound = false;
|
||||
std::once_flag checkBindOnce;
|
||||
std::unique_ptr<HwDeviceId> hwDeviceId;
|
||||
std::unique_ptr<HwDeviceIdDrm> hwDeviceId;
|
||||
int deviceId = 0;
|
||||
int revisionId = 0;
|
||||
GTTYPE eGtType = GTTYPE_UNDEFINED;
|
||||
RootDeviceEnvironment &rootDeviceEnvironment;
|
||||
uint64_t uuid = 0;
|
||||
|
||||
Drm(std::unique_ptr<HwDeviceId> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
Drm(std::unique_ptr<HwDeviceIdDrm> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
std::unique_ptr<SystemInfo> systemInfo;
|
||||
std::unique_ptr<CacheInfo> cacheInfo;
|
||||
std::unique_ptr<EngineInfo> engineInfo;
|
||||
|
@ -38,7 +38,7 @@ class DrmNullDevice : public Drm {
|
||||
}
|
||||
}
|
||||
|
||||
DrmNullDevice(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment), gpuTimestamp(0){};
|
||||
DrmNullDevice(std::unique_ptr<HwDeviceIdDrm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment), gpuTimestamp(0){};
|
||||
|
||||
protected:
|
||||
uint64_t gpuTimestamp;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -7,14 +7,19 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
|
||||
#include <string>
|
||||
namespace NEO {
|
||||
|
||||
class HwDeviceId : NonCopyableClass {
|
||||
class HwDeviceIdDrm : public HwDeviceId {
|
||||
public:
|
||||
HwDeviceId(int fileDescriptorIn, const char *pciPathIn) : fileDescriptor(fileDescriptorIn), pciPath(pciPathIn) {}
|
||||
~HwDeviceId();
|
||||
static constexpr DriverModelType driverModelType = DriverModelType::DRM;
|
||||
|
||||
HwDeviceIdDrm(int fileDescriptorIn, const char *pciPathIn)
|
||||
: HwDeviceId(DriverModelType::DRM),
|
||||
fileDescriptor(fileDescriptorIn), pciPath(pciPathIn) {}
|
||||
~HwDeviceIdDrm() override;
|
||||
int getFileDescriptor() const { return fileDescriptor; }
|
||||
const char *getPciPath() const { return pciPath.c_str(); }
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
HwDeviceId::~HwDeviceId() {
|
||||
HwDeviceIdDrm::~HwDeviceIdDrm() {
|
||||
SysCalls::close(fileDescriptor);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ bool OSInterface::isDebugAttachAvailable() const {
|
||||
}
|
||||
|
||||
bool RootDeviceEnvironment::initOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex) {
|
||||
Drm *drm = Drm::create(std::move(hwDeviceId), *this);
|
||||
Drm *drm = Drm::create(std::unique_ptr<HwDeviceIdDrm>(hwDeviceId.release()->as<HwDeviceIdDrm>()), *this);
|
||||
if (!drm) {
|
||||
return false;
|
||||
}
|
||||
|
@ -15,17 +15,45 @@
|
||||
|
||||
namespace NEO {
|
||||
class ExecutionEnvironment;
|
||||
class HwDeviceId;
|
||||
class MemoryManager;
|
||||
enum class DriverModelType { WDDM,
|
||||
DRM };
|
||||
|
||||
class HwDeviceId : public NonCopyableClass {
|
||||
public:
|
||||
HwDeviceId(DriverModelType driverModel) : driverModelType(driverModel) {
|
||||
}
|
||||
|
||||
virtual ~HwDeviceId() = default;
|
||||
|
||||
DriverModelType getDriverModelType() const {
|
||||
return driverModelType;
|
||||
}
|
||||
|
||||
template <typename DerivedType>
|
||||
DerivedType *as() {
|
||||
UNRECOVERABLE_IF(DerivedType::driverModelType != this->driverModelType);
|
||||
return static_cast<DerivedType *>(this);
|
||||
}
|
||||
|
||||
template <typename DerivedType>
|
||||
DerivedType *as() const {
|
||||
UNRECOVERABLE_IF(DerivedType::driverModelType != this->driverModelType);
|
||||
return static_cast<const DerivedType *>(this);
|
||||
}
|
||||
|
||||
protected:
|
||||
DriverModelType driverModelType;
|
||||
};
|
||||
|
||||
class DriverModel : public NonCopyableClass {
|
||||
public:
|
||||
DriverModel(DriverModelType driverModelType)
|
||||
: driverModelType(driverModelType) {
|
||||
}
|
||||
|
||||
virtual ~DriverModel() = default;
|
||||
|
||||
template <typename DerivedType>
|
||||
DerivedType *as() {
|
||||
UNRECOVERABLE_IF(DerivedType::driverModelType != this->driverModelType);
|
||||
@ -46,8 +74,6 @@ class DriverModel : public NonCopyableClass {
|
||||
return driverModelType;
|
||||
}
|
||||
|
||||
virtual ~DriverModel() = default;
|
||||
|
||||
protected:
|
||||
DriverModelType driverModelType;
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/windows/wddm/um_km_data_translator.h"
|
||||
#include "shared/source/os_interface/windows/windows_wrapper.h"
|
||||
|
||||
@ -17,9 +17,11 @@
|
||||
namespace NEO {
|
||||
class Gdi;
|
||||
struct OsEnvironment;
|
||||
class HwDeviceId : NonCopyableClass {
|
||||
class HwDeviceIdWddm : public HwDeviceId {
|
||||
public:
|
||||
HwDeviceId(D3DKMT_HANDLE adapterIn, LUID adapterLuidIn, OsEnvironment *osEnvironmentIn, std::unique_ptr<UmKmDataTranslator> umKmDataTranslator);
|
||||
static constexpr DriverModelType driverModelType = DriverModelType::WDDM;
|
||||
|
||||
HwDeviceIdWddm(D3DKMT_HANDLE adapterIn, LUID adapterLuidIn, OsEnvironment *osEnvironmentIn, std::unique_ptr<UmKmDataTranslator> umKmDataTranslator);
|
||||
Gdi *getGdi() const;
|
||||
constexpr D3DKMT_HANDLE getAdapter() const {
|
||||
return adapter;
|
||||
@ -27,7 +29,7 @@ class HwDeviceId : NonCopyableClass {
|
||||
constexpr LUID getAdapterLuid() const {
|
||||
return adapterLuid;
|
||||
}
|
||||
~HwDeviceId();
|
||||
~HwDeviceIdWddm() override;
|
||||
|
||||
UmKmDataTranslator *getUmKmDataTranslator() {
|
||||
return umKmDataTranslator.get();
|
||||
|
@ -11,18 +11,19 @@
|
||||
#include "shared/source/os_interface/windows/os_environment_win.h"
|
||||
namespace NEO {
|
||||
|
||||
HwDeviceId::~HwDeviceId() {
|
||||
HwDeviceIdWddm::~HwDeviceIdWddm() {
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
D3DKMT_CLOSEADAPTER CloseAdapter = {0};
|
||||
CloseAdapter.hAdapter = adapter;
|
||||
status = static_cast<OsEnvironmentWin *>(osEnvironment)->gdi->closeAdapter(&CloseAdapter);
|
||||
DEBUG_BREAK_IF(status != STATUS_SUCCESS);
|
||||
}
|
||||
HwDeviceId::HwDeviceId(D3DKMT_HANDLE adapterIn, LUID adapterLuidIn,
|
||||
OsEnvironment *osEnvironmentIn, std::unique_ptr<UmKmDataTranslator> umKmDataTranslator)
|
||||
: adapter(adapterIn), adapterLuid(adapterLuidIn), osEnvironment(osEnvironmentIn),
|
||||
HwDeviceIdWddm::HwDeviceIdWddm(D3DKMT_HANDLE adapterIn, LUID adapterLuidIn,
|
||||
OsEnvironment *osEnvironmentIn, std::unique_ptr<UmKmDataTranslator> umKmDataTranslator)
|
||||
: HwDeviceId(DriverModelType::WDDM),
|
||||
adapter(adapterIn), adapterLuid(adapterLuidIn), osEnvironment(osEnvironmentIn),
|
||||
umKmDataTranslator(std::move(umKmDataTranslator)) {}
|
||||
Gdi *HwDeviceId::getGdi() const {
|
||||
Gdi *HwDeviceIdWddm::getGdi() const {
|
||||
return static_cast<OsEnvironmentWin *>(osEnvironment)->gdi.get();
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -23,7 +23,9 @@ bool OSInterface::isDebugAttachAvailable() const {
|
||||
}
|
||||
|
||||
bool RootDeviceEnvironment::initOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex) {
|
||||
auto wddm(Wddm::createWddm(std::move(hwDeviceId), *this));
|
||||
UNRECOVERABLE_IF(hwDeviceId->getDriverModelType() != DriverModelType::WDDM);
|
||||
auto hwDeviceIdWddm = std::unique_ptr<HwDeviceIdWddm>(reinterpret_cast<HwDeviceIdWddm *>(hwDeviceId.release()));
|
||||
auto wddm(Wddm::createWddm(std::move(hwDeviceIdWddm), *this));
|
||||
if (!wddm->init()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/os_interface/os_library.h"
|
||||
#include "shared/source/os_interface/windows/gdi_interface.h"
|
||||
#include "shared/source/os_interface/windows/os_library_win.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
#include <memory>
|
||||
|
@ -59,7 +59,7 @@ Wddm::GetSystemInfoFcn Wddm::getSystemInfo = getGetSystemInfo();
|
||||
Wddm::VirtualAllocFcn Wddm::virtualAllocFnc = getVirtualAlloc();
|
||||
Wddm::VirtualFreeFcn Wddm::virtualFreeFnc = getVirtualFree();
|
||||
|
||||
Wddm::Wddm(std::unique_ptr<HwDeviceId> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment)
|
||||
Wddm::Wddm(std::unique_ptr<HwDeviceIdWddm> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment)
|
||||
: DriverModel(DriverModelType::WDDM), hwDeviceId(std::move(hwDeviceIdIn)), rootDeviceEnvironment(rootDeviceEnvironment) {
|
||||
UNRECOVERABLE_IF(!hwDeviceId);
|
||||
featureTable.reset(new FeatureTable());
|
||||
@ -264,7 +264,7 @@ bool validDriverStorePath(OsEnvironmentWin &osEnvironment, D3DKMT_HANDLE adapter
|
||||
return isCompatibleDriverStore(std::move(deviceRegistryPath));
|
||||
}
|
||||
|
||||
std::unique_ptr<HwDeviceId> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid) {
|
||||
std::unique_ptr<HwDeviceIdWddm> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid) {
|
||||
D3DKMT_OPENADAPTERFROMLUID OpenAdapterData = {{0}};
|
||||
OpenAdapterData.AdapterLuid = adapterLuid;
|
||||
auto status = osEnvironment.gdi->openAdapterFromLuid(&OpenAdapterData);
|
||||
@ -295,7 +295,7 @@ std::unique_ptr<HwDeviceId> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &os
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return std::make_unique<HwDeviceId>(OpenAdapterData.hAdapter, adapterLuid, &osEnvironment, std::move(umKmDataTranslator));
|
||||
return std::make_unique<HwDeviceIdWddm>(OpenAdapterData.hAdapter, adapterLuid, &osEnvironment, std::move(umKmDataTranslator));
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<HwDeviceId>> OSInterface::discoverDevices(ExecutionEnvironment &executionEnvironment) {
|
||||
@ -347,7 +347,7 @@ std::vector<std::unique_ptr<HwDeviceId>> OSInterface::discoverDevices(ExecutionE
|
||||
|
||||
auto hwDeviceId = createHwDeviceIdFromAdapterLuid(*osEnvironment, adapterDesc.luid);
|
||||
if (hwDeviceId) {
|
||||
hwDeviceIds.push_back(std::move(hwDeviceId));
|
||||
hwDeviceIds.push_back(std::unique_ptr<HwDeviceId>(hwDeviceId.release()));
|
||||
}
|
||||
|
||||
if (hwDeviceIds.size() == numRootDevices) {
|
||||
@ -600,7 +600,7 @@ NTSTATUS Wddm::createAllocationsAndMapGpuVa(OsHandleStorage &osHandles) {
|
||||
}
|
||||
|
||||
auto osHandle = static_cast<OsHandleWin *>(osHandles.fragmentStorageData[i].osHandleStorage);
|
||||
if (osHandle->handle == (D3DKMT_HANDLE) nullptr && osHandles.fragmentStorageData[i].fragmentSize) {
|
||||
if ((osHandle->handle == (D3DKMT_HANDLE)0) && (osHandles.fragmentStorageData[i].fragmentSize)) {
|
||||
AllocationInfo[allocationCount].pPrivateDriverData = osHandle->gmm->gmmResourceInfo->peekHandle();
|
||||
[[maybe_unused]] auto pSysMem = osHandles.fragmentStorageData[i].cpuPtr;
|
||||
[[maybe_unused]] auto PSysMemFromGmm = osHandle->gmm->gmmResourceInfo->getSystemMemPointer();
|
||||
|
@ -56,7 +56,7 @@ class Wddm : public DriverModel {
|
||||
|
||||
virtual ~Wddm();
|
||||
|
||||
static Wddm *createWddm(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
static Wddm *createWddm(std::unique_ptr<HwDeviceIdWddm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
bool init();
|
||||
|
||||
MOCKABLE_VIRTUAL bool evict(const D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim);
|
||||
@ -121,7 +121,7 @@ class Wddm : public DriverModel {
|
||||
|
||||
uint64_t getMaxApplicationAddress() const;
|
||||
|
||||
HwDeviceId *getHwDeviceId() const {
|
||||
HwDeviceIdWddm *getHwDeviceId() const {
|
||||
return hwDeviceId.get();
|
||||
}
|
||||
D3DKMT_HANDLE getAdapter() const { return hwDeviceId->getAdapter(); }
|
||||
@ -179,7 +179,7 @@ class Wddm : public DriverModel {
|
||||
PhysicalDevicePciBusInfo getPciBusInfo() const;
|
||||
|
||||
protected:
|
||||
std::unique_ptr<HwDeviceId> hwDeviceId;
|
||||
std::unique_ptr<HwDeviceIdWddm> hwDeviceId;
|
||||
D3DKMT_HANDLE device = 0;
|
||||
D3DKMT_HANDLE pagingQueue = 0;
|
||||
D3DKMT_HANDLE pagingQueueSyncObject = 0;
|
||||
@ -207,7 +207,7 @@ class Wddm : public DriverModel {
|
||||
std::unique_ptr<GmmMemory> gmmMemory;
|
||||
uintptr_t minAddress = 0;
|
||||
|
||||
Wddm(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
Wddm(std::unique_ptr<HwDeviceIdWddm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
MOCKABLE_VIRTUAL bool waitOnGPU(D3DKMT_HANDLE context);
|
||||
bool createDevice(PreemptionMode preemptionMode);
|
||||
bool createPagingQueue();
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
|
||||
namespace NEO {
|
||||
Wddm *Wddm::createWddm(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
Wddm *Wddm::createWddm(std::unique_ptr<HwDeviceIdWddm> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
return new Wddm(std::move(hwDeviceId), rootDeviceEnvironment);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
Reference in New Issue
Block a user