feature: add query for additional device properties

Related-To: NEO-12590

Signed-off-by: Alicja Lukaszewicz <alicja.lukaszewicz@intel.com>
This commit is contained in:
Alicja Lukaszewicz
2024-10-28 13:57:32 +00:00
committed by Compute-Runtime-Automation
parent 637541ba93
commit 654fdc1345
12 changed files with 83 additions and 0 deletions

View File

@@ -3315,3 +3315,24 @@ TEST(MemoryManagerTest, givenIsCompressionSupportedForShareableThenReturnTrue) {
EXPECT_TRUE(memoryManager.isCompressionSupportedForShareable(true));
EXPECT_TRUE(memoryManager.isCompressionSupportedForShareable(false));
}
TEST(MemoryManagerTest, WhenGettingExtraDevicePropertiesThenNoExceptionIsThrown) {
MockMemoryManager memoryManager;
uint32_t moduleId = 0;
uint16_t serverType = 0;
EXPECT_NO_THROW(memoryManager.getExtraDeviceProperties(0, &moduleId, &serverType));
}
TEST(MemoryManagerTest, WhenGettingExtraDevicePropertiesThenPropertiesRemainUnchanged) {
NEO::ExecutionEnvironment executionEnvironment;
OsAgnosticMemoryManager memoryManager(executionEnvironment);
uint32_t moduleId = 0;
uint16_t serverType = 0;
memoryManager.getExtraDeviceProperties(0, &moduleId, &serverType);
EXPECT_EQ(moduleId, 0u);
EXPECT_EQ(serverType, 0u);
}

View File

@@ -1850,6 +1850,21 @@ TEST_F(DrmMemoryManagerTest, whenCallingGetNumMediaThenCallIoctlHelper) {
EXPECT_EQ(1u, mockIoctlHelper->getNumMediaEncodersCalled);
}
TEST_F(DrmMemoryManagerTest, whenCallingGetExtraDevicePropertiesThenCallIoctlHelper) {
auto mockIoctlHelper = new MockIoctlHelper(*mock);
auto &drm = static_cast<DrmMockCustom &>(memoryManager->getDrm(rootDeviceIndex));
drm.ioctlHelper.reset(mockIoctlHelper);
uint32_t moduleId = 0;
uint16_t serverType = 0;
EXPECT_EQ(0u, mockIoctlHelper->queryDeviceParamsCalled);
memoryManager->getExtraDeviceProperties(rootDeviceIndex, &moduleId, &serverType);
EXPECT_EQ(1u, mockIoctlHelper->queryDeviceParamsCalled);
}
TEST_F(DrmMemoryManagerTest, GivenShareableEnabledWhenAskedToCreateGraphicsAllocationThenValidAllocationIsReturnedAndStandard64KBHeapIsUsed) {
mock->ioctlHelper.reset(new MockIoctlHelper(*mock));
mock->queryMemoryInfo();

View File

@@ -406,6 +406,12 @@ TEST_F(IoctlPrelimHelperTests, givenPrelimWhenGettingEuStallFdParameterThenCorre
EXPECT_EQ(static_cast<uint32_t>(PRELIM_I915_PERF_FLAG_FD_EU_STALL), ioctlHelper.getEuStallFdParameter());
}
TEST_F(IoctlPrelimHelperTests, givenPrelimWhenQueryDeviceParamsIsCalledThenFalseIsReturned) {
uint32_t moduleId = 0;
uint16_t serverType = 0;
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
}
struct MockIoctlHelperPrelim20 : IoctlHelperPrelim20 {
using IoctlHelperPrelim20::createGemExt;
using IoctlHelperPrelim20::IoctlHelperPrelim20;

View File

@@ -879,3 +879,13 @@ TEST(IoctlHelperTestsUpstream, whenCallingGetStatusAndFlagsForResetStatsThenZero
EXPECT_FALSE(ioctlHelper.validPageFault(0u));
}
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenQueryDeviceParamsIsCalledThenFalseIsReturned) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
IoctlHelperUpstream ioctlHelper{*drm};
uint32_t moduleId = 0;
uint16_t serverType = 0;
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
}

View File

@@ -2532,3 +2532,13 @@ TEST(IoctlHelperXeTest, givenIoctlHelperWhenGettingFenceAddressThenReturnCorrect
fenceAddr = ioctlHelper.getPagingFenceAddress(0, &osContext);
EXPECT_EQ(osContext.getFenceAddr(0), fenceAddr);
}
TEST(IoctlHelperXeTest, givenIoctlWhenQueryDeviceParamsIsCalledThenFalseIsReturned) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
uint32_t moduleId = 0;
uint16_t serverType = 0;
EXPECT_FALSE(xeIoctlHelper->queryDeviceParams(&moduleId, &serverType));
}