Dont expose internal copy engine if blitter operations are disabled

Related-To: NEO-6325
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-10-28 19:07:28 +00:00
committed by Compute-Runtime-Automation
parent 03540d5301
commit f3afde1153
5 changed files with 39 additions and 0 deletions

View File

@ -877,6 +877,8 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyRegionFromImageToI
const ze_command_queue_desc_t queueDesc = {};
bool internalEngine = true;
neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
device,
@ -921,6 +923,7 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyRegionFromImageToI
const ze_command_queue_desc_t queueDesc = {};
bool internalEngine = true;
neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
device,
@ -966,6 +969,7 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyFromImageToImageUs
const ze_command_queue_desc_t queueDesc = {};
bool internalEngine = true;
neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
device,
@ -1009,6 +1013,7 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenMemoryCopyRegionWithSi
const ze_command_queue_desc_t desc = {};
bool internalEngine = true;
neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
ze_result_t result = ZE_RESULT_SUCCESS;
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
device,

View File

@ -737,6 +737,7 @@ HWTEST2_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForI
void *srcPtr = reinterpret_cast<void *>(0x1234);
void *dstPtr = reinterpret_cast<void *>(0x2345);
neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
device,
@ -789,6 +790,7 @@ HWTEST2_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledFor
void *srcPtr = reinterpret_cast<void *>(0x1234);
void *dstPtr = reinterpret_cast<void *>(0x2345);
neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
device,

View File

@ -566,6 +566,9 @@ EngineControl &Device::getInternalEngine() {
}
EngineControl *Device::getInternalCopyEngine() {
if (!getHardwareInfo().capabilityTable.blitterOperationsSupported) {
return nullptr;
}
for (auto &engine : engines) {
if (engine.osContext->getEngineType() == aub_stream::ENGINE_BCS &&
engine.osContext->isInternalEngine()) {

View File

@ -0,0 +1,10 @@
#
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
target_sources(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/neo_device_tests.cpp
)

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/fixtures/device_fixture.h"
#include "test.h"
using namespace NEO;
typedef Test<DeviceFixture> DeviceTest;
TEST_F(DeviceTest, whenBlitterOperationsSupportIsDisabledThenNoInternalCopyEngineIsReturned) {
pDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = false;
EXPECT_EQ(nullptr, pDevice->getInternalCopyEngine());
}