mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Create OsInterface before calling Wddm::init
Related-To: NEO-3691 Change-Id: I33690e4297b6ddd3195c272de00f0c946c56380b Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
a77965adf7
commit
1a35298fdb
@ -300,6 +300,11 @@ void WddmMock::createPagingFenceLogger() {
|
||||
}
|
||||
}
|
||||
|
||||
bool WddmMock::init() {
|
||||
osInterfaceAvailable = rootDeviceEnvironment.osInterface != nullptr;
|
||||
return Wddm::init();
|
||||
}
|
||||
|
||||
void *GmockWddm::virtualAllocWrapper(void *inPtr, size_t size, uint32_t flags, uint32_t type) {
|
||||
void *tmp = reinterpret_cast<void *>(virtualAllocAddress);
|
||||
size += MemoryConstants::pageSize;
|
||||
|
@ -85,6 +85,7 @@ class WddmMock : public Wddm {
|
||||
uint64_t *getPagingFenceAddress() override;
|
||||
void waitOnPagingFenceFromCpu() override;
|
||||
void createPagingFenceLogger() override;
|
||||
bool init() override;
|
||||
|
||||
bool configureDeviceAddressSpace() {
|
||||
configureDeviceAddressSpaceResult.called++;
|
||||
@ -134,6 +135,7 @@ class WddmMock : public Wddm {
|
||||
bool makeResidentStatus = true;
|
||||
bool callBaseMakeResident = true;
|
||||
bool callBaseCreatePagingLogger = true;
|
||||
bool osInterfaceAvailable = false;
|
||||
};
|
||||
|
||||
struct GmockWddm : WddmMock {
|
||||
|
@ -1402,3 +1402,12 @@ TEST(DiscoverDevices, whenDriverInfoHasIncompatibleDriverStoreThenHwDeviceIdIsNo
|
||||
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_TRUE(hwDeviceIds.empty());
|
||||
}
|
||||
|
||||
TEST(InitOsInterfaceTest, givenRootDeviceEnvironmentWhenIntializingWddmDuringInitOsInterfaceMethodThenOsInterfaceIsAvailable) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_EQ(1u, hwDeviceIds.size());
|
||||
executionEnvironment.rootDeviceEnvironments[0]->initOsInterface(std::move(hwDeviceIds[0]));
|
||||
auto wddm = static_cast<WddmMock *>(executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->getWddm());
|
||||
EXPECT_TRUE(wddm->osInterfaceAvailable);
|
||||
}
|
||||
|
Reference in New Issue
Block a user