From 9d8ab90dc6bc6a123dd72838f763b979c4e64402 Mon Sep 17 00:00:00 2001 From: Jaime Arteaga Date: Mon, 24 Aug 2020 20:42:37 -0700 Subject: [PATCH] Use reg key to disable copy groups Change-Id: Ia7de2166789bee7395caaefeeaf138b2eb24cecc Signed-off-by: Jaime Arteaga --- .../gen12lp/test_device_gen12lp.cpp | 37 +++++++++++++++++++ shared/source/gen12lp/hw_helper_gen12lp.cpp | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp index a427b1f468..0b38ff4d37 100644 --- a/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp +++ b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp @@ -54,6 +54,43 @@ HWTEST2_F(DeviceQueueGroupTest, EXPECT_EQ(count, 2u); } +class DeviceCopyQueueGroupTest : public DeviceFixture, public ::testing::Test { + public: + void SetUp() override { + DebugManager.flags.EnableBlitterOperationsSupport.set(0); + DeviceFixture::SetUp(); + } + + void TearDown() override { + DeviceFixture::TearDown(); + } + DebugManagerStateRestore restorer; +}; + +HWTEST2_F(DeviceCopyQueueGroupTest, + givenBlitterSupportAndEnableBlitterOperationsSupportSetToZeroThenNoCopyEngineIsReturned, IsGen12LP) { + const uint32_t rootDeviceIndex = 0u; + NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); + hwInfo.featureTable.ftrCCSNode = false; + hwInfo.capabilityTable.blitterOperationsSupported = true; + hwInfo.featureTable.ftrBcsInfo.set(0); + auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, + rootDeviceIndex); + Mock deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + + uint32_t count = 0; + ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); + EXPECT_EQ(ZE_RESULT_SUCCESS, res); + + std::vector properties(count); + res = deviceImp.getCommandQueueGroupProperties(&count, properties.data()); + EXPECT_EQ(ZE_RESULT_SUCCESS, res); + + for (uint32_t i = 0; i < count; i++) { + EXPECT_NE(i, static_cast(NEO::EngineGroupType::Copy)); + } +} + HWTEST2_F(DeviceQueueGroupTest, givenBlitterSupportAndCCSDefaultEngineThenThreeQueueGroupsAreReturned, IsGen12LP) { const uint32_t rootDeviceIndex = 0u; diff --git a/shared/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp index 5ea06dfdcc..0e9a2fdf44 100644 --- a/shared/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -169,7 +169,7 @@ void HwHelperHw::addEngineToEngineGroup(std::vector(EngineGroupType::Compute)].push_back(engine); } - if (engine.getEngineType() == aub_stream::ENGINE_BCS) { + if (engine.getEngineType() == aub_stream::ENGINE_BCS && DebugManager.flags.EnableBlitterOperationsSupport.get() != 0) { engineGroups[static_cast(EngineGroupType::Copy)].push_back(engine); } }