refactor: move empty sba programming in heapless prolog to base class

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk 2025-05-09 14:55:09 +00:00 committed by Compute-Runtime-Automation
parent a51902bb3a
commit 809feca620
11 changed files with 138 additions and 60 deletions

View File

@ -3,7 +3,7 @@ components:
branch: master branch: master
dest_dir: infra dest_dir: infra
fetch_tags: true fetch_tags: true
revision: v6939 revision: v6941
type: git type: git
converter: M-3107 converter: M-3107
version: '1' version: '1'

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2024 Intel Corporation * Copyright (C) 2021-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -8,6 +8,7 @@
#include "shared/source/command_container/command_encoder.h" #include "shared/source/command_container/command_encoder.h"
#include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/aub_command_stream_receiver_hw.h"
#include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/memory_manager.h"
#include "shared/test/common/helpers/dispatch_flags_helper.h" #include "shared/test/common/helpers/dispatch_flags_helper.h"
@ -54,6 +55,11 @@ struct MiAtomicAubFixture : public AUBFixture {
taskStream.replaceGraphicsAllocation(streamAllocation); taskStream.replaceGraphicsAllocation(streamAllocation);
taskStream.replaceBuffer(streamAllocation->getUnderlyingBuffer(), taskStream.replaceBuffer(streamAllocation->getUnderlyingBuffer(),
streamAllocation->getUnderlyingBufferSize()); streamAllocation->getUnderlyingBufferSize());
auto &compilerProductHelper = device->getCompilerProductHelper();
auto heaplessEnabled = compilerProductHelper.isHeaplessModeEnabled(device->getHardwareInfo());
this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(heaplessEnabled);
} }
void tearDown() { void tearDown() {
@ -71,11 +77,20 @@ struct MiAtomicAubFixture : public AUBFixture {
csr->makeResident(*deviceSurface); csr->makeResident(*deviceSurface);
csr->makeResident(*systemSurface); csr->makeResident(*systemSurface);
csr->flushTask(taskStream, 0,
&csr->getIndirectHeap(IndirectHeapType::dynamicState, 0u), if (this->heaplessStateInitEnabled) {
&csr->getIndirectHeap(IndirectHeapType::indirectObject, 0u), csr->flushTaskStateless(taskStream, 0,
&csr->getIndirectHeap(IndirectHeapType::surfaceState, 0u), &csr->getIndirectHeap(IndirectHeapType::dynamicState, 0u),
0u, dispatchFlags, device->getDevice()); &csr->getIndirectHeap(IndirectHeapType::indirectObject, 0u),
&csr->getIndirectHeap(IndirectHeapType::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
} else {
csr->flushTask(taskStream, 0,
&csr->getIndirectHeap(IndirectHeapType::dynamicState, 0u),
&csr->getIndirectHeap(IndirectHeapType::indirectObject, 0u),
&csr->getIndirectHeap(IndirectHeapType::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
}
csr->flushBatchedSubmissions(); csr->flushBatchedSubmissions();
} }
@ -84,6 +99,7 @@ struct MiAtomicAubFixture : public AUBFixture {
GraphicsAllocation *streamAllocation = nullptr; GraphicsAllocation *streamAllocation = nullptr;
GraphicsAllocation *deviceSurface = nullptr; GraphicsAllocation *deviceSurface = nullptr;
GraphicsAllocation *systemSurface = nullptr; GraphicsAllocation *systemSurface = nullptr;
bool heaplessStateInitEnabled = false;
}; };
using MiAtomicAubTest = Test<MiAtomicAubFixture>; using MiAtomicAubTest = Test<MiAtomicAubFixture>;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022-2024 Intel Corporation * Copyright (C) 2022-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -7,6 +7,7 @@
#include "shared/source/helpers/array_count.h" #include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/utilities/io_functions.h" #include "shared/source/utilities/io_functions.h"
#include "shared/source/utilities/tag_allocator.h" #include "shared/source/utilities/tag_allocator.h"
#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_execution_environment.h"
@ -391,7 +392,12 @@ struct MultiLevelBatchAubFixture : public AUBFixture {
thirdLevelBatch = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); thirdLevelBatch = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties);
secondLevelBatchStream = std::make_unique<LinearStream>(secondLevelBatch); secondLevelBatchStream = std::make_unique<LinearStream>(secondLevelBatch);
thirdLevelBatchStream = std::make_unique<LinearStream>(thirdLevelBatch); thirdLevelBatchStream = std::make_unique<LinearStream>(thirdLevelBatch);
};
auto &compilerProductHelper = device->getCompilerProductHelper();
auto heaplessEnabled = compilerProductHelper.isHeaplessModeEnabled(device->getHardwareInfo());
this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(heaplessEnabled);
}
void tearDown() { void tearDown() {
debugManager.flags.AubDumpAddMmioRegistersList.getRef() = "unk"; debugManager.flags.AubDumpAddMmioRegistersList.getRef() = "unk";
debugManager.flags.AubDumpAddMmioRegistersList.getRef().shrink_to_fit(); debugManager.flags.AubDumpAddMmioRegistersList.getRef().shrink_to_fit();
@ -403,18 +409,27 @@ struct MultiLevelBatchAubFixture : public AUBFixture {
memoryManager->freeGraphicsMemory(helperSurface); memoryManager->freeGraphicsMemory(helperSurface);
AUBFixture::tearDown(); AUBFixture::tearDown();
}; }
void flushStream() { void flushStream() {
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.guardCommandBufferWithPipeControl = true;
csr->makeResident(*helperSurface); csr->makeResident(*helperSurface);
csr->flushTask(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeap::Type::dynamicState, 0u), if (this->heaplessStateInitEnabled) {
&csr->getIndirectHeap(IndirectHeap::Type::indirectObject, 0u), csr->flushTaskStateless(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeap::Type::surfaceState, 0u), &csr->getIndirectHeap(IndirectHeap::Type::dynamicState, 0u),
0u, dispatchFlags, device->getDevice()); &csr->getIndirectHeap(IndirectHeap::Type::indirectObject, 0u),
&csr->getIndirectHeap(IndirectHeap::Type::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
} else {
csr->flushTask(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeap::Type::dynamicState, 0u),
&csr->getIndirectHeap(IndirectHeap::Type::indirectObject, 0u),
&csr->getIndirectHeap(IndirectHeap::Type::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
}
csr->flushBatchedSubmissions(); csr->flushBatchedSubmissions();
} }
@ -431,6 +446,7 @@ struct MultiLevelBatchAubFixture : public AUBFixture {
GraphicsAllocation *secondLevelBatch = nullptr; GraphicsAllocation *secondLevelBatch = nullptr;
GraphicsAllocation *thirdLevelBatch = nullptr; GraphicsAllocation *thirdLevelBatch = nullptr;
bool heaplessStateInitEnabled = false;
}; };
using MultiLevelBatchTestsWithNesting = Test<MultiLevelBatchAubFixture<true>>; using MultiLevelBatchTestsWithNesting = Test<MultiLevelBatchAubFixture<true>>;

View File

@ -1,11 +1,12 @@
/* /*
* Copyright (C) 2022-2024 Intel Corporation * Copyright (C) 2022-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
*/ */
#include "shared/source/command_container/command_encoder.h" #include "shared/source/command_container/command_encoder.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/register_offsets.h" #include "shared/source/helpers/register_offsets.h"
#include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/memory_manager.h"
@ -35,6 +36,10 @@ struct MiMath : public AUBFixture, public ::testing::Test {
streamAllocation = this->device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::commandBuffer, device->getDeviceBitfield()}); streamAllocation = this->device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::commandBuffer, device->getDeviceBitfield()});
taskStream = std::make_unique<LinearStream>(streamAllocation); taskStream = std::make_unique<LinearStream>(streamAllocation);
auto &compilerProductHelper = device->getCompilerProductHelper();
auto heaplessEnabled = compilerProductHelper.isHeaplessModeEnabled(device->getHardwareInfo());
this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(heaplessEnabled);
} }
void TearDown() override { void TearDown() override {
this->device->getMemoryManager()->freeGraphicsMemory(streamAllocation); this->device->getMemoryManager()->freeGraphicsMemory(streamAllocation);
@ -45,11 +50,19 @@ struct MiMath : public AUBFixture, public ::testing::Test {
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.guardCommandBufferWithPipeControl = true;
csr->flushTask(*taskStream, 0, if (this->heaplessStateInitEnabled) {
&csr->getIndirectHeap(IndirectHeapType::dynamicState, 0u), csr->flushTaskStateless(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeapType::indirectObject, 0u), &csr->getIndirectHeap(IndirectHeapType::dynamicState, 0u),
&csr->getIndirectHeap(IndirectHeapType::surfaceState, 0u), &csr->getIndirectHeap(IndirectHeapType::indirectObject, 0u),
0u, dispatchFlags, device->getDevice()); &csr->getIndirectHeap(IndirectHeapType::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
} else {
csr->flushTask(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeapType::dynamicState, 0u),
&csr->getIndirectHeap(IndirectHeapType::indirectObject, 0u),
&csr->getIndirectHeap(IndirectHeapType::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
}
csr->flushBatchedSubmissions(); csr->flushBatchedSubmissions();
} }
@ -125,6 +138,7 @@ struct MiMath : public AUBFixture, public ::testing::Test {
const uint32_t numberOfOperationToLoadAddressToMiMathAccu = 7; const uint32_t numberOfOperationToLoadAddressToMiMathAccu = 7;
std::unique_ptr<LinearStream> taskStream; std::unique_ptr<LinearStream> taskStream;
GraphicsAllocation *streamAllocation = nullptr; GraphicsAllocation *streamAllocation = nullptr;
bool heaplessStateInitEnabled = false;
}; };
using MatcherIsDg2OrPvc = IsWithinProducts<IGFX_DG2, IGFX_PVC>; using MatcherIsDg2OrPvc = IsWithinProducts<IGFX_DG2, IGFX_PVC>;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022-2024 Intel Corporation * Copyright (C) 2022-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -10,6 +10,7 @@
#include "shared/source/command_container/walker_partition_xehp_and_later.h" #include "shared/source/command_container/walker_partition_xehp_and_later.h"
#include "shared/source/helpers/array_count.h" #include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/timestamp_packet.h" #include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/utilities/io_functions.h" #include "shared/source/utilities/io_functions.h"
#include "shared/source/utilities/tag_allocator.h" #include "shared/source/utilities/tag_allocator.h"
@ -120,6 +121,11 @@ void AubWalkerPartitionZeroFixture::setUp() {
helperSurface = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties); helperSurface = memoryManager->allocateGraphicsMemoryWithProperties(*commandBufferProperties);
memset(helperSurface->getUnderlyingBuffer(), 0, MemoryConstants::pageSize); memset(helperSurface->getUnderlyingBuffer(), 0, MemoryConstants::pageSize);
taskStream = std::make_unique<LinearStream>(streamAllocation); taskStream = std::make_unique<LinearStream>(streamAllocation);
auto &compilerProductHelper = device->getCompilerProductHelper();
auto heaplessEnabled = compilerProductHelper.isHeaplessModeEnabled(device->getHardwareInfo());
this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(heaplessEnabled);
} }
void AubWalkerPartitionZeroFixture::tearDown() { void AubWalkerPartitionZeroFixture::tearDown() {
auto memoryManager = this->device->getMemoryManager(); auto memoryManager = this->device->getMemoryManager();
@ -133,11 +139,20 @@ void AubWalkerPartitionZeroFixture::flushStream() {
dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.guardCommandBufferWithPipeControl = true;
csr->makeResident(*helperSurface); csr->makeResident(*helperSurface);
csr->flushTask(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeap::Type::dynamicState, 0u), if (this->heaplessStateInitEnabled) {
&csr->getIndirectHeap(IndirectHeap::Type::indirectObject, 0u), csr->flushTaskStateless(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeap::Type::surfaceState, 0u), &csr->getIndirectHeap(IndirectHeap::Type::dynamicState, 0u),
0u, dispatchFlags, device->getDevice()); &csr->getIndirectHeap(IndirectHeap::Type::indirectObject, 0u),
&csr->getIndirectHeap(IndirectHeap::Type::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
} else {
csr->flushTask(*taskStream, 0,
&csr->getIndirectHeap(IndirectHeap::Type::dynamicState, 0u),
&csr->getIndirectHeap(IndirectHeap::Type::indirectObject, 0u),
&csr->getIndirectHeap(IndirectHeap::Type::surfaceState, 0u),
0u, dispatchFlags, device->getDevice());
}
csr->flushBatchedSubmissions(); csr->flushBatchedSubmissions();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022-2024 Intel Corporation * Copyright (C) 2022-2025 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -120,6 +120,7 @@ struct AubWalkerPartitionFixture : public KernelAUBFixture<SimpleKernelFixture>
HardwareParse hwParser; HardwareParse hwParser;
DispatchParameters dispatchParamters; DispatchParameters dispatchParamters;
bool heaplessStateInitEnabled = false;
}; };
struct AubWalkerPartitionTest : public AubWalkerPartitionFixture, struct AubWalkerPartitionTest : public AubWalkerPartitionFixture,

View File

@ -29,6 +29,8 @@
using namespace NEO; using namespace NEO;
#include "shared/test/common/test_macros/header/heapless_matchers.h"
typedef UltCommandStreamReceiverTest CommandStreamReceiverFlushTaskTests; typedef UltCommandStreamReceiverTest CommandStreamReceiverFlushTaskTests;
HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenCommandStreamReceiverGetsUpdated) { HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenCommandStreamReceiverGetsUpdated) {
@ -760,7 +762,7 @@ HWTEST2_F(CommandStreamReceiverFlushTaskTests, GivenPreambleSentAndMediaSamplerR
EXPECT_NE(nullptr, getCommand<typename FamilyType::PIPELINE_SELECT>()); EXPECT_NE(nullptr, getCommand<typename FamilyType::PIPELINE_SELECT>());
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenStateBaseAddressNotSentWhenFlushingTaskThenStateBaseAddressIsSent) { HWTEST2_F(CommandStreamReceiverFlushTaskTests, GivenStateBaseAddressNotSentWhenFlushingTaskThenStateBaseAddressIsSent, IsHeapfulSupported) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
commandStreamReceiver.isPreambleSent = true; commandStreamReceiver.isPreambleSent = true;
commandStreamReceiver.setMediaVFEStateDirty(false); commandStreamReceiver.setMediaVFEStateDirty(false);
@ -774,7 +776,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenStateBaseAddressNotSentWhenFl
EXPECT_NE(cmdList.end(), stateBaseAddressItor); EXPECT_NE(cmdList.end(), stateBaseAddressItor);
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenSizeChangedWhenFlushingTaskThenStateBaseAddressIsSent) { HWTEST2_F(CommandStreamReceiverFlushTaskTests, GivenSizeChangedWhenFlushingTaskThenStateBaseAddressIsSent, IsHeapfulSupported) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
auto dshSize = dsh.getMaxAvailableSpace(); auto dshSize = dsh.getMaxAvailableSpace();
auto iohSize = ioh.getMaxAvailableSpace(); auto iohSize = ioh.getMaxAvailableSpace();
@ -803,7 +805,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenSizeChangedWhenFlushingTaskTh
EXPECT_NE(cmdList.end(), stateBaseAddressItor); EXPECT_NE(cmdList.end(), stateBaseAddressItor);
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDshHeapChangeWhenFlushTaskIsCalledThenSbaIsReloaded) { HWTEST2_F(CommandStreamReceiverFlushTaskTests, givenDshHeapChangeWhenFlushTaskIsCalledThenSbaIsReloaded, IsHeapfulSupported) {
bool deviceUsesDsh = pDevice->getHardwareInfo().capabilityTable.supportsImages; bool deviceUsesDsh = pDevice->getHardwareInfo().capabilityTable.supportsImages;
if (!deviceUsesDsh) { if (!deviceUsesDsh) {
GTEST_SKIP(); GTEST_SKIP();
@ -819,7 +821,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDshHeapChangeWhenFlushTaskIsC
EXPECT_NE(cmdList.end(), stateBaseAddressItor); EXPECT_NE(cmdList.end(), stateBaseAddressItor);
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenSshHeapChangeWhenFlushTaskIsCalledThenSbaIsReloaded) { HWTEST2_F(CommandStreamReceiverFlushTaskTests, givenSshHeapChangeWhenFlushTaskIsCalledThenSbaIsReloaded, IsHeapfulSupported) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
configureCSRtoNonDirtyState<FamilyType>(false); configureCSRtoNonDirtyState<FamilyType>(false);
@ -831,7 +833,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenSshHeapChangeWhenFlushTaskIsC
EXPECT_NE(cmdList.end(), stateBaseAddressItor); EXPECT_NE(cmdList.end(), stateBaseAddressItor);
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenIohHeapChangeWhenFlushTaskIsCalledThenSbaIsReloaded) { HWTEST2_F(CommandStreamReceiverFlushTaskTests, givenIohHeapChangeWhenFlushTaskIsCalledThenSbaIsReloaded, IsHeapfulSupported) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
configureCSRtoNonDirtyState<FamilyType>(false); configureCSRtoNonDirtyState<FamilyType>(false);
@ -843,7 +845,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenIohHeapChangeWhenFlushTaskIsC
EXPECT_NE(cmdList.end(), stateBaseAddressItor); EXPECT_NE(cmdList.end(), stateBaseAddressItor);
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenStateBaseAddressNotChangedWhenFlushingTaskThenStateBaseAddressIsNotSent) { HWTEST2_F(CommandStreamReceiverFlushTaskTests, GivenStateBaseAddressNotChangedWhenFlushingTaskThenStateBaseAddressIsNotSent, IsHeapfulSupported) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
commandStreamReceiver.isPreambleSent = true; commandStreamReceiver.isPreambleSent = true;
configureCSRHeapStatesToNonDirty<FamilyType>(); configureCSRHeapStatesToNonDirty<FamilyType>();
@ -1269,14 +1271,14 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBlockedKernelRequiringDCFlush
cmdList.clear(); cmdList.clear();
// Parse command list // Parse command list
parseCommands<FamilyType>(commandStreamTask, usedBefore); parseCommands<FamilyType>(commandStreamTask, usedAfter - usedBefore);
auto itorPC = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end()); auto itorPC = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
EXPECT_NE(cmdList.end(), itorPC); ASSERT_NE(cmdList.end(), itorPC);
if (UnitTestHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) { if (UnitTestHelper<FamilyType>::isPipeControlWArequired(pDevice->getHardwareInfo())) {
itorPC++; itorPC++;
itorPC = find<PIPE_CONTROL *>(itorPC, cmdList.end()); itorPC = find<PIPE_CONTROL *>(itorPC, cmdList.end());
EXPECT_NE(cmdList.end(), itorPC); ASSERT_NE(cmdList.end(), itorPC);
} }
// Verify that the dcFlushEnabled bit is set in PC // Verify that the dcFlushEnabled bit is set in PC

View File

@ -216,7 +216,7 @@ HWTEST2_F(PreambleCfeStateXeHPAndLater, givenSetDebugFlagWhenPreambleCfeStateIsP
} }
using XeHpCommandStreamReceiverFlushTaskTests = UltCommandStreamReceiverTest; using XeHpCommandStreamReceiverFlushTaskTests = UltCommandStreamReceiverTest;
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushingCommandStreamReceiverThenExpectStateBaseAddressEqualsIndirectObjectBaseAddress) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, whenFlushingCommandStreamReceiverThenExpectStateBaseAddressEqualsIndirectObjectBaseAddress, IsHeapfulSupportedAndAtLeastXeHpCore) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessModeEnabled) { if (commandStreamReceiver.heaplessModeEnabled) {
@ -236,7 +236,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushi
} }
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushCalledThenStateBaseAddressHasAllCachesOn) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, whenFlushCalledThenStateBaseAddressHasAllCachesOn, IsHeapfulSupportedAndAtLeastXeHpCore) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
auto gmmHelper = pDevice->getRootDeviceEnvironment().getGmmHelper(); auto gmmHelper = pDevice->getRootDeviceEnvironment().getGmmHelper();
@ -261,7 +261,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushC
EXPECT_EQ(expectedMocsForStateless, stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlState()); EXPECT_EQ(expectedMocsForStateless, stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlState());
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushCalledThenStateBaseAddressHasAllCachesOffWhenDebugFlagIsPresent) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, whenFlushCalledThenStateBaseAddressHasAllCachesOffWhenDebugFlagIsPresent, IsHeapfulSupportedAndAtLeastXeHpCore) {
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;
debugManager.flags.DisableCachingForHeaps.set(1); debugManager.flags.DisableCachingForHeaps.set(1);
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
@ -287,7 +287,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushC
EXPECT_EQ(expectedMocsForHeap, stateBaseAddress->getBindlessSamplerStateMemoryObjectControlState()); EXPECT_EQ(expectedMocsForHeap, stateBaseAddress->getBindlessSamplerStateMemoryObjectControlState());
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenL3ToL1DebugFlagWhenStatelessMocsIsProgrammedThenItHasL1CachingOn) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, givenL3ToL1DebugFlagWhenStatelessMocsIsProgrammedThenItHasL1CachingOn, IsHeapfulSupportedAndAtLeastXeHpCore) {
DebugManagerStateRestore restore; DebugManagerStateRestore restore;
debugManager.flags.ForceL1Caching.set(1u); debugManager.flags.ForceL1Caching.set(1u);
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
@ -303,7 +303,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenL3ToL
EXPECT_EQ(expectedMocs, stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlState()); EXPECT_EQ(expectedMocs, stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlState());
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenForceL1CachingDebugFlagDisabledWhenStatelessMocsIsProgrammedThenItHasL3CachingOn) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, givenForceL1CachingDebugFlagDisabledWhenStatelessMocsIsProgrammedThenItHasL3CachingOn, IsHeapfulSupportedAndAtLeastXeHpCore) {
DebugManagerStateRestore restore; DebugManagerStateRestore restore;
debugManager.flags.ForceL1Caching.set(0u); debugManager.flags.ForceL1Caching.set(0u);
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
@ -322,7 +322,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenForce
EXPECT_EQ(expectedMocs, stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlState()); EXPECT_EQ(expectedMocs, stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlState());
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushingCommandStreamReceiverThenExpectBindlessBaseAddressEqualSurfaceStateBaseAddress) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, whenFlushingCommandStreamReceiverThenExpectBindlessBaseAddressEqualSurfaceStateBaseAddress, IsHeapfulSupportedAndAtLeastXeHpCore) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
@ -343,7 +343,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushi
EXPECT_EQ(bindlessSurfaceSize, stateBaseAddress->getBindlessSurfaceStateSize()); EXPECT_EQ(bindlessSurfaceSize, stateBaseAddress->getBindlessSurfaceStateSize());
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushingCommandStreamReceiverThenSetBindlessSamplerStateBaseAddressModifyEnable) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, whenFlushingCommandStreamReceiverThenSetBindlessSamplerStateBaseAddressModifyEnable, IsHeapfulSupportedAndAtLeastXeHpCore) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessModeEnabled) { if (commandStreamReceiver.heaplessModeEnabled) {
@ -361,7 +361,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushi
EXPECT_EQ(dsh.getHeapSizeInPages(), stateBaseAddress->getBindlessSamplerStateBufferSize()); EXPECT_EQ(dsh.getHeapSizeInPages(), stateBaseAddress->getBindlessSamplerStateBufferSize());
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenDebugKeysThatOverrideMultiGpuSettingWhenStateBaseAddressIsProgrammedThenValuesMatch) { HWTEST2_F(XeHpCommandStreamReceiverFlushTaskTests, givenDebugKeysThatOverrideMultiGpuSettingWhenStateBaseAddressIsProgrammedThenValuesMatch, IsHeapfulSupportedAndAtLeastXeHpCore) {
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();

View File

@ -2322,6 +2322,10 @@ inline void CommandStreamReceiverHw<GfxFamily>::handleBatchedDispatchImplicitFlu
} }
} }
template <typename GfxFamily>
void CommandStreamReceiverHw<GfxFamily>::programStateBaseAddressHeapless(Device &device, LinearStream &commandStream) {
}
template <typename GfxFamily> template <typename GfxFamily>
inline BatchBuffer CommandStreamReceiverHw<GfxFamily>::prepareBatchBufferForSubmission(LinearStream &commandStreamTask, inline BatchBuffer CommandStreamReceiverHw<GfxFamily>::prepareBatchBufferForSubmission(LinearStream &commandStreamTask,
size_t commandStreamStartTask, size_t commandStreamStartTask,

View File

@ -54,11 +54,6 @@ SubmissionStatus CommandStreamReceiverHw<GfxFamily>::programHeaplessProlog(Devic
return SubmissionStatus::unsupported; return SubmissionStatus::unsupported;
} }
template <typename GfxFamily>
void CommandStreamReceiverHw<GfxFamily>::programStateBaseAddressHeapless(Device &device, LinearStream &commandStream) {
UNRECOVERABLE_IF(true);
}
template <typename GfxFamily> template <typename GfxFamily>
void CommandStreamReceiverHw<GfxFamily>::programComputeModeHeapless(Device &device, LinearStream &commandStream) { void CommandStreamReceiverHw<GfxFamily>::programComputeModeHeapless(Device &device, LinearStream &commandStream) {
UNRECOVERABLE_IF(true); UNRECOVERABLE_IF(true);

View File

@ -5962,7 +5962,6 @@ HWTEST_F(CommandStreamReceiverHwHeaplessTest, whenHeaplessCommandStreamReceiverF
EXPECT_ANY_THROW(csr->flushTaskStateless(commandStream, 0, nullptr, nullptr, nullptr, 0, csr->recordedDispatchFlags, *pDevice)); EXPECT_ANY_THROW(csr->flushTaskStateless(commandStream, 0, nullptr, nullptr, nullptr, 0, csr->recordedDispatchFlags, *pDevice));
EXPECT_ANY_THROW(csr->programHeaplessProlog(*pDevice)); EXPECT_ANY_THROW(csr->programHeaplessProlog(*pDevice));
EXPECT_ANY_THROW(csr->programStateBaseAddressHeapless(*pDevice, commandStream));
EXPECT_ANY_THROW(csr->programComputeModeHeapless(*pDevice, commandStream)); EXPECT_ANY_THROW(csr->programComputeModeHeapless(*pDevice, commandStream));
EXPECT_ANY_THROW(csr->getCmdSizeForHeaplessPrologue(*pDevice)); EXPECT_ANY_THROW(csr->getCmdSizeForHeaplessPrologue(*pDevice));
EXPECT_ANY_THROW(csr->handleAllocationsResidencyForHeaplessProlog(commandStream, *pDevice)); EXPECT_ANY_THROW(csr->handleAllocationsResidencyForHeaplessProlog(commandStream, *pDevice));
@ -6369,12 +6368,20 @@ HWTEST_F(CommandStreamReceiverHwTest, givenEpilogueStreamAvailableWhenFlushBcsTa
HWTEST_F(CommandStreamReceiverHwTest, givenEpilogueStreamAvailableWhenFlushImmediateTaskCalledThenDispachEpilogueCommandsIntoEpilogueStream) { HWTEST_F(CommandStreamReceiverHwTest, givenEpilogueStreamAvailableWhenFlushImmediateTaskCalledThenDispachEpilogueCommandsIntoEpilogueStream) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
auto heaplessStateInit = commandStreamReceiver.heaplessStateInitialized;
// first flush can carry preamble, no interest in flags here // first flush can carry preamble, no interest in flags here
commandStreamReceiver.flushImmediateTask(commandStream, if (heaplessStateInit) {
commandStream.getUsed(), commandStreamReceiver.flushImmediateTaskStateless(commandStream,
immediateFlushTaskFlags, commandStream.getUsed(),
*pDevice); immediateFlushTaskFlags,
*pDevice);
} else {
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
}
// regular dispatch here // regular dispatch here
GraphicsAllocation *commandBuffer = commandStreamReceiver.getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{commandStreamReceiver.getRootDeviceIndex(), MemoryConstants::pageSize}); GraphicsAllocation *commandBuffer = commandStreamReceiver.getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{commandStreamReceiver.getRootDeviceIndex(), MemoryConstants::pageSize});
@ -6387,10 +6394,18 @@ HWTEST_F(CommandStreamReceiverHwTest, givenEpilogueStreamAvailableWhenFlushImmed
immediateFlushTaskFlags.requireTaskCountUpdate = true; immediateFlushTaskFlags.requireTaskCountUpdate = true;
immediateFlushTaskFlags.optionalEpilogueCmdStream = &epilogueStream; immediateFlushTaskFlags.optionalEpilogueCmdStream = &epilogueStream;
commandStreamReceiver.flushImmediateTask(commandStream, if (heaplessStateInit) {
commandStream.getUsed(), commandStreamReceiver.flushImmediateTaskStateless(commandStream,
immediateFlushTaskFlags, commandStream.getUsed(),
*pDevice); immediateFlushTaskFlags,
*pDevice);
} else {
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
}
EXPECT_TRUE(commandStreamReceiver.isMadeResident(commandBuffer)); EXPECT_TRUE(commandStreamReceiver.isMadeResident(commandBuffer));
EXPECT_TRUE(commandStreamReceiver.latestFlushedBatchBuffer.dispatchMonitorFence); EXPECT_TRUE(commandStreamReceiver.latestFlushedBatchBuffer.dispatchMonitorFence);