mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 22:08:53 +08:00
fix: correct gt_id to tile_id engine mapping
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c76edaba4e
commit
85f2734ca4
@@ -309,7 +309,10 @@ std::unique_ptr<EngineInfo> IoctlHelperXe::createEngineInfo(bool isSysmanEnabled
|
||||
|
||||
for (auto i = 0u; i < numberHwEngines; i++) {
|
||||
const auto &engine = queryEngines->engines[i].instance;
|
||||
auto tile = engine.gt_id;
|
||||
if (gtIdToTileId[engine.gt_id] == invalidIndex) {
|
||||
continue;
|
||||
}
|
||||
auto tile = static_cast<uint16_t>(gtIdToTileId[engine.gt_id]);
|
||||
multiTileMask.set(tile);
|
||||
EngineClassInstance engineClassInstance{};
|
||||
engineClassInstance.engineClass = engine.engine_class;
|
||||
|
||||
@@ -68,58 +68,67 @@ struct DrmMockXeDebug : public DrmMockCustom {
|
||||
drm->queryGtList.resize(49); // 1 qword for num gts and 12 qwords per gt
|
||||
auto xeQueryGtList = reinterpret_cast<drm_xe_query_gt_list *>(drm->queryGtList.begin());
|
||||
xeQueryGtList->num_gt = 4;
|
||||
xeQueryGtList->gt_list[0] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MAIN, // type
|
||||
0, // tile_id
|
||||
0, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b100, // native mem regions
|
||||
0x011, // slow mem regions
|
||||
|
||||
constexpr drm_xe_gt tile0MainGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MAIN,
|
||||
.tile_id = 0,
|
||||
.gt_id = 0,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b100,
|
||||
.far_mem_regions = 0x011,
|
||||
};
|
||||
xeQueryGtList->gt_list[1] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MEDIA, // type
|
||||
1, // tile_id
|
||||
1, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b001, // native mem regions
|
||||
0x110, // slow mem regions
|
||||
|
||||
constexpr drm_xe_gt tile1MediaGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MEDIA,
|
||||
.tile_id = 1,
|
||||
.gt_id = 1,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b001,
|
||||
.far_mem_regions = 0x110,
|
||||
};
|
||||
xeQueryGtList->gt_list[2] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MAIN, // type
|
||||
1, // tile_id
|
||||
2, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b010, // native mem regions
|
||||
0x101, // slow mem regions
|
||||
|
||||
constexpr drm_xe_gt tile1MainGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MAIN,
|
||||
.tile_id = 1,
|
||||
.gt_id = 2,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b010,
|
||||
.far_mem_regions = 0x101,
|
||||
};
|
||||
xeQueryGtList->gt_list[3] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MAIN, // type
|
||||
2, // tile_id
|
||||
3, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b100, // native mem regions
|
||||
0x011, // slow mem regions
|
||||
|
||||
constexpr drm_xe_gt tile2MainGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MAIN,
|
||||
.tile_id = 2,
|
||||
.gt_id = 3,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b100,
|
||||
.far_mem_regions = 0x011,
|
||||
};
|
||||
|
||||
xeQueryGtList->gt_list[0] = tile0MainGt;
|
||||
xeQueryGtList->gt_list[1] = tile1MediaGt;
|
||||
xeQueryGtList->gt_list[2] = tile1MainGt;
|
||||
xeQueryGtList->gt_list[3] = tile2MainGt;
|
||||
|
||||
drm->ioctlHelper->initialize();
|
||||
EXPECT_EQ(1, drm->ioctlHelper->getEuDebugSysFsEnable());
|
||||
auto xeQueryEngines = reinterpret_cast<drm_xe_query_engines *>(drm->queryEngines);
|
||||
xeQueryEngines->num_engines = 11;
|
||||
xeQueryEngines->engines[0] = {{DRM_XE_ENGINE_CLASS_RENDER, 0, 0}, {}};
|
||||
xeQueryEngines->engines[1] = {{DRM_XE_ENGINE_CLASS_COPY, 1, 0}, {}};
|
||||
xeQueryEngines->engines[2] = {{DRM_XE_ENGINE_CLASS_COPY, 2, 0}, {}};
|
||||
xeQueryEngines->engines[3] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 3, 0}, {}};
|
||||
xeQueryEngines->engines[4] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 4, 0}, {}};
|
||||
xeQueryEngines->engines[5] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 5, 1}, {}};
|
||||
xeQueryEngines->engines[6] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 6, 1}, {}};
|
||||
xeQueryEngines->engines[7] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 7, 1}, {}};
|
||||
xeQueryEngines->engines[8] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 8, 1}, {}};
|
||||
xeQueryEngines->engines[9] = {{DRM_XE_ENGINE_CLASS_VIDEO_DECODE, 9, 1}, {}};
|
||||
xeQueryEngines->engines[10] = {{DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE, 10, 0}, {}};
|
||||
xeQueryEngines->engines[0] = {{DRM_XE_ENGINE_CLASS_RENDER, 0, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[1] = {{DRM_XE_ENGINE_CLASS_COPY, 1, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[2] = {{DRM_XE_ENGINE_CLASS_COPY, 2, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[3] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 3, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[4] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 4, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[5] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 5, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[6] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 6, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[7] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 7, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[8] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 8, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[9] = {{DRM_XE_ENGINE_CLASS_VIDEO_DECODE, 9, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[10] = {{DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE, 10, tile0MainGt.gt_id}, {}};
|
||||
|
||||
return drm;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
* Copyright (C) 2024-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -228,19 +228,59 @@ void DrmMockXe::initInstance() {
|
||||
xeQueryConfig->info[DRM_XE_QUERY_CONFIG_VA_BITS] = 48;
|
||||
xeQueryConfig->info[DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY] = mockMaxExecQueuePriority;
|
||||
|
||||
constexpr drm_xe_gt tile0MainGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MAIN,
|
||||
.tile_id = 0,
|
||||
.gt_id = 0,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b100,
|
||||
.far_mem_regions = 0x011,
|
||||
};
|
||||
|
||||
constexpr drm_xe_gt tile1MediaGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MEDIA,
|
||||
.tile_id = 1,
|
||||
.gt_id = 1,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b001,
|
||||
.far_mem_regions = 0x110,
|
||||
};
|
||||
|
||||
constexpr drm_xe_gt tile1MainGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MAIN,
|
||||
.tile_id = 1,
|
||||
.gt_id = 2,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b010,
|
||||
.far_mem_regions = 0x101,
|
||||
};
|
||||
|
||||
constexpr drm_xe_gt tile2MainGt = {
|
||||
.type = DRM_XE_QUERY_GT_TYPE_MAIN,
|
||||
.tile_id = 2,
|
||||
.gt_id = 3,
|
||||
.pad = {0},
|
||||
.reference_clock = mockTimestampFrequency,
|
||||
.near_mem_regions = 0b100,
|
||||
.far_mem_regions = 0x011,
|
||||
};
|
||||
|
||||
auto xeQueryEngines = reinterpret_cast<drm_xe_query_engines *>(this->queryEngines);
|
||||
xeQueryEngines->num_engines = 11;
|
||||
xeQueryEngines->engines[0] = {{DRM_XE_ENGINE_CLASS_RENDER, 0, 0}, {}};
|
||||
xeQueryEngines->engines[1] = {{DRM_XE_ENGINE_CLASS_COPY, 1, 0}, {}};
|
||||
xeQueryEngines->engines[2] = {{DRM_XE_ENGINE_CLASS_COPY, 2, 0}, {}};
|
||||
xeQueryEngines->engines[3] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 3, 0}, {}};
|
||||
xeQueryEngines->engines[4] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 4, 0}, {}};
|
||||
xeQueryEngines->engines[5] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 5, 1}, {}};
|
||||
xeQueryEngines->engines[6] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 6, 1}, {}};
|
||||
xeQueryEngines->engines[7] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 7, 1}, {}};
|
||||
xeQueryEngines->engines[8] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 8, 1}, {}};
|
||||
xeQueryEngines->engines[9] = {{DRM_XE_ENGINE_CLASS_VIDEO_DECODE, 9, 1}, {}};
|
||||
xeQueryEngines->engines[10] = {{DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE, 10, 0}, {}};
|
||||
xeQueryEngines->engines[0] = {{DRM_XE_ENGINE_CLASS_RENDER, 0, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[1] = {{DRM_XE_ENGINE_CLASS_COPY, 1, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[2] = {{DRM_XE_ENGINE_CLASS_COPY, 2, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[3] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 3, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[4] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 4, tile0MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[5] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 5, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[6] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 6, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[7] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 7, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[8] = {{DRM_XE_ENGINE_CLASS_COMPUTE, 8, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[9] = {{DRM_XE_ENGINE_CLASS_VIDEO_DECODE, 9, tile1MainGt.gt_id}, {}};
|
||||
xeQueryEngines->engines[10] = {{DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE, 10, tile0MainGt.gt_id}, {}};
|
||||
|
||||
auto xeQueryMemUsage = reinterpret_cast<drm_xe_query_mem_regions *>(this->queryMemUsage);
|
||||
xeQueryMemUsage->num_mem_regions = 3;
|
||||
@@ -269,41 +309,9 @@ void DrmMockXe::initInstance() {
|
||||
this->queryGtList.resize(49); // 1 qword for num gts and 12 qwords per gt
|
||||
auto xeQueryGtList = reinterpret_cast<drm_xe_query_gt_list *>(this->queryGtList.begin());
|
||||
xeQueryGtList->num_gt = 4;
|
||||
xeQueryGtList->gt_list[0] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MAIN, // type
|
||||
0, // tile_id
|
||||
0, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b100, // native mem regions
|
||||
0x011, // slow mem regions
|
||||
};
|
||||
xeQueryGtList->gt_list[1] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MEDIA, // type
|
||||
1, // tile_id
|
||||
1, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b001, // native mem regions
|
||||
0x110, // slow mem regions
|
||||
};
|
||||
xeQueryGtList->gt_list[2] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MAIN, // type
|
||||
1, // tile_id
|
||||
2, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b010, // native mem regions
|
||||
0x101, // slow mem regions
|
||||
};
|
||||
xeQueryGtList->gt_list[3] = {
|
||||
DRM_XE_QUERY_GT_TYPE_MAIN, // type
|
||||
2, // tile_id
|
||||
3, // gt_id
|
||||
{0}, // padding
|
||||
mockTimestampFrequency, // reference_clock
|
||||
0b100, // native mem regions
|
||||
0x011, // slow mem regions
|
||||
};
|
||||
xeQueryGtList->gt_list[0] = tile0MainGt;
|
||||
xeQueryGtList->gt_list[1] = tile1MediaGt;
|
||||
xeQueryGtList->gt_list[2] = tile1MainGt;
|
||||
xeQueryGtList->gt_list[3] = tile2MainGt;
|
||||
this->reset();
|
||||
}
|
||||
|
||||
@@ -1746,6 +1746,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlFailureWhenSetGpuCpuTimesIsCalledThenFalseIs
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::make_unique<DrmMockTime>(mockFd, rootDeviceEnvironment));
|
||||
auto drm = DrmMockXe::create(rootDeviceEnvironment);
|
||||
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
|
||||
xeIoctlHelper->initialize();
|
||||
auto engineInfo = xeIoctlHelper->createEngineInfo(false);
|
||||
ASSERT_NE(nullptr, engineInfo);
|
||||
|
||||
@@ -1764,6 +1765,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlFailureWhenSetGpuCpuTimesIsCalledThenProperV
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::make_unique<DrmMockTime>(mockFd, rootDeviceEnvironment));
|
||||
auto drm = DrmMockXe::create(rootDeviceEnvironment);
|
||||
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
|
||||
xeIoctlHelper->initialize();
|
||||
auto engineInfo = xeIoctlHelper->createEngineInfo(false);
|
||||
ASSERT_NE(nullptr, engineInfo);
|
||||
|
||||
@@ -1790,6 +1792,7 @@ TEST_F(IoctlHelperXeTest, whenDeviceTimestampWidthSetThenProperValuesAreSet) {
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::make_unique<DrmMockTime>(mockFd, rootDeviceEnvironment));
|
||||
auto drm = DrmMockXe::create(rootDeviceEnvironment);
|
||||
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
|
||||
xeIoctlHelper->initialize();
|
||||
auto engineInfo = xeIoctlHelper->createEngineInfo(false);
|
||||
ASSERT_NE(nullptr, engineInfo);
|
||||
|
||||
@@ -1816,7 +1819,7 @@ TEST_F(IoctlHelperXeTest, whenSetDefaultEngineIsCalledThenProperEngineIsSet) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>(&hwInfo);
|
||||
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
|
||||
|
||||
xeIoctlHelper->initialize();
|
||||
auto engineInfo = xeIoctlHelper->createEngineInfo(true);
|
||||
ASSERT_NE(nullptr, engineInfo);
|
||||
|
||||
@@ -2108,7 +2111,7 @@ TEST_F(IoctlHelperXeTest, givenLowPriorityContextWhenSettingPropertiesThenCorrec
|
||||
TEST_F(IoctlHelperXeTest, givenLowPriorityContextWhenCreatingDrmContextThenExtPropertyIsSetCorrectly) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
drm->ioctlHelper->initialize();
|
||||
drm->memoryInfoQueried = true;
|
||||
drm->queryEngineInfo();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
|
||||
|
||||
Reference in New Issue
Block a user