mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Add state base address transition for global stateless heap command lists
Related-To: NEO-5055 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
86e739e9dc
commit
f003666ad7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -136,6 +136,7 @@ void HardwareParse::findHardwareCommands<GenGfxFamily>(IndirectHeap *dsh) {
|
||||
typedef typename GenGfxFamily::INTERFACE_DESCRIPTOR_DATA INTERFACE_DESCRIPTOR_DATA;
|
||||
typedef typename GenGfxFamily::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
|
||||
typedef typename GenGfxFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename GenGfxFamily::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
itorWalker = find<COMPUTE_WALKER *>(cmdList.begin(), cmdList.end());
|
||||
if (itorWalker != cmdList.end()) {
|
||||
@@ -187,6 +188,11 @@ void HardwareParse::findHardwareCommands<GenGfxFamily>(IndirectHeap *dsh) {
|
||||
ASSERT_NE(0u, dynamicStateHeap);
|
||||
}
|
||||
|
||||
itorBindingTableBaseAddress = find<_3DSTATE_BINDING_TABLE_POOL_ALLOC *>(cmdList.begin(), itorWalker);
|
||||
if (itorBindingTableBaseAddress != itorWalker) {
|
||||
cmdBindingTableBaseAddress = *itorBindingTableBaseAddress;
|
||||
}
|
||||
|
||||
// interfaceDescriptorData should be located within COMPUTE_WALKER
|
||||
if (cmdWalker) {
|
||||
// Extract the interfaceDescriptorData
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -134,6 +134,7 @@ void HardwareParse::findHardwareCommands<GenGfxFamily>(IndirectHeap *dsh) {
|
||||
typedef typename GenGfxFamily::INTERFACE_DESCRIPTOR_DATA INTERFACE_DESCRIPTOR_DATA;
|
||||
typedef typename GenGfxFamily::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
|
||||
typedef typename GenGfxFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename GenGfxFamily::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
itorWalker = find<COMPUTE_WALKER *>(cmdList.begin(), cmdList.end());
|
||||
if (itorWalker != cmdList.end()) {
|
||||
@@ -185,6 +186,11 @@ void HardwareParse::findHardwareCommands<GenGfxFamily>(IndirectHeap *dsh) {
|
||||
ASSERT_NE(0u, dynamicStateHeap);
|
||||
}
|
||||
|
||||
itorBindingTableBaseAddress = find<_3DSTATE_BINDING_TABLE_POOL_ALLOC *>(cmdList.begin(), itorWalker);
|
||||
if (itorBindingTableBaseAddress != itorWalker) {
|
||||
cmdBindingTableBaseAddress = *itorBindingTableBaseAddress;
|
||||
}
|
||||
|
||||
// interfaceDescriptorData should be located within COMPUTE_WALKER
|
||||
if (cmdWalker) {
|
||||
// Extract the interfaceDescriptorData
|
||||
|
||||
@@ -29,6 +29,7 @@ struct HardwareParse {
|
||||
itorStateBaseAddress = cmdList.end();
|
||||
itorWalker = cmdList.end();
|
||||
itorGpgpuCsrBaseAddress = cmdList.end();
|
||||
itorBindingTableBaseAddress = cmdList.end();
|
||||
}
|
||||
|
||||
void setUp() {
|
||||
@@ -199,6 +200,7 @@ struct HardwareParse {
|
||||
GenCmdList::iterator itorWalker;
|
||||
GenCmdList::iterator itorBBStartAfterWalker;
|
||||
GenCmdList::iterator itorGpgpuCsrBaseAddress;
|
||||
GenCmdList::iterator itorBindingTableBaseAddress;
|
||||
|
||||
void *cmdInterfaceDescriptorData = nullptr;
|
||||
void *cmdMediaInterfaceDescriptorLoad = nullptr;
|
||||
@@ -208,6 +210,7 @@ struct HardwareParse {
|
||||
void *cmdWalker = nullptr;
|
||||
void *cmdBBStartAfterWalker = nullptr;
|
||||
void *cmdGpgpuCsrBaseAddress = nullptr;
|
||||
void *cmdBindingTableBaseAddress = nullptr;
|
||||
|
||||
bool parsePipeControl = false;
|
||||
};
|
||||
|
||||
@@ -2969,20 +2969,33 @@ HWTEST_F(CommandStreamReceiverHwTest, givenCreateGlobalStatelessHeapAllocationWh
|
||||
EXPECT_EQ(commandStreamReceiver.getGlobalStatelessHeapAllocation(), heapAllocation);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverHwTest, givenCreateGlobalStatelessHeapAllocationWhenFlushingTaskThenGlobalStatelessHeapAllocationIsResident) {
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenCreateGlobalStatelessHeapAllocationWhenFlushingTaskThenGlobalStatelessHeapAllocationIsResidentAndNoBindingTableCommandDispatched,
|
||||
IsAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
commandStreamReceiver.storeMakeResidentAllocations = true;
|
||||
EXPECT_EQ(nullptr, commandStreamReceiver.getGlobalStatelessHeap());
|
||||
|
||||
commandStreamReceiver.createGlobalStatelessHeap();
|
||||
auto statelessHeap = commandStreamReceiver.getGlobalStatelessHeap();
|
||||
ASSERT_NE(nullptr, statelessHeap);
|
||||
|
||||
commandStreamReceiver.flushTask(commandStream,
|
||||
0,
|
||||
&dsh,
|
||||
&ioh,
|
||||
&ssh,
|
||||
statelessHeap,
|
||||
taskLevel,
|
||||
flushTaskFlags,
|
||||
*pDevice);
|
||||
EXPECT_TRUE(commandStreamReceiver.isMadeResident(commandStreamReceiver.getGlobalStatelessHeapAllocation()));
|
||||
|
||||
HardwareParse hwParserCsr;
|
||||
hwParserCsr.parseCommands<FamilyType>(commandStreamReceiver.commandStream, 0);
|
||||
hwParserCsr.findHardwareCommands<FamilyType>();
|
||||
ASSERT_NE(nullptr, hwParserCsr.cmdStateBaseAddress);
|
||||
EXPECT_EQ(nullptr, hwParserCsr.cmdBindingTableBaseAddress);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user