test: add test for config query in XE

Related-To: NEO-10168

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2024-03-26 13:51:21 +00:00
committed by Compute-Runtime-Automation
parent ecdfd2acdd
commit 420a6092ae
2 changed files with 5 additions and 0 deletions

View File

@@ -1812,6 +1812,8 @@ TEST(IoctlHelperXeTest, whenInitializeThenProperHwInfoIsSet) {
EXPECT_EQ(drm.revId, hwInfo->platform.usRevId);
EXPECT_EQ(drm.devId, hwInfo->platform.usDeviceID);
EXPECT_EQ((1ull << 48) - 1, hwInfo->capabilityTable.gpuAddressSpace);
EXPECT_EQ(DrmMockXe::mockMaxExecQueuePriority, ioctlHelper->maxExecQueuePriority);
}
TEST(IoctlHelperXeTest, givenMultipleBindInfosWhenGemCloseIsCalledThenProperHandleIsTaken) {

View File

@@ -34,6 +34,7 @@ struct MockIoctlHelperXe : IoctlHelperXe {
using IoctlHelperXe::getFdFromVmExport;
using IoctlHelperXe::IoctlHelperXe;
using IoctlHelperXe::maxContextSetProperties;
using IoctlHelperXe::maxExecQueuePriority;
using IoctlHelperXe::setContextProperties;
using IoctlHelperXe::setDefaultEngine;
using IoctlHelperXe::UserFenceExtension;
@@ -57,6 +58,7 @@ class DrmMockXe : public DrmMockCustom {
xeQueryConfig->num_params = 5;
xeQueryConfig->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] = (revId << 16) | devId;
xeQueryConfig->info[DRM_XE_QUERY_CONFIG_VA_BITS] = 48;
xeQueryConfig->info[DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY] = mockMaxExecQueuePriority;
auto xeQueryEngines = reinterpret_cast<drm_xe_query_engines *>(queryEngines);
xeQueryEngines->num_engines = 11;
@@ -314,6 +316,7 @@ class DrmMockXe : public DrmMockCustom {
uint64_t queryConfig[6]{}; // 1 qword for num params and 1 qwords per param
static constexpr uint32_t mockExecQueueId = 1234;
static constexpr int32_t mockMaxExecQueuePriority = 3;
static_assert(sizeof(drm_xe_engine) == 4 * sizeof(uint64_t), "");
uint64_t queryEngines[45]{}; // 1 qword for num engines and 4 qwords per engine