L0debug - Canonize SBA in single address space mode

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
This commit is contained in:
Yates, Brandon
2022-10-29 18:39:35 +00:00
committed by Compute-Runtime-Automation
parent 9816f815f3
commit f067145137
2 changed files with 13 additions and 3 deletions

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
@@ -241,12 +242,13 @@ HWTEST2_F(SingleAddressSpaceFixture, GivenOneNonZeroSbaAddressesWhenProgrammingS
cmdStream.replaceGraphicsAllocation(streamAllocation);
cmdStream.replaceBuffer(streamAllocation->getUnderlyingBuffer(), streamAllocation->getUnderlyingBufferSize());
uint64_t ssba = 0x1234567000;
uint64_t ssba = 0x0000800011112222;
NEO::Debugger::SbaAddresses sbaAddresses = {0};
sbaAddresses.SurfaceStateBaseAddress = ssba;
debugger->programSbaTrackingCommandsSingleAddressSpace(cmdStream, sbaAddresses);
debugger->singleAddressSpaceSbaTracking = true;
debugger->captureStateBaseAddress(cmdStream, sbaAddresses);
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, cmdStream.getCpuBase(), cmdStream.getUsed()));
@@ -289,9 +291,17 @@ HWTEST2_F(SingleAddressSpaceFixture, GivenOneNonZeroSbaAddressesWhenProgrammingS
itor = find<MI_STORE_DATA_IMM *>(itor, cmdList.end());
ASSERT_NE(cmdList.end(), itor);
auto lowDword = genCmdCast<MI_STORE_DATA_IMM *>(*itor)->getDataDword0();
itor++;
itor = find<MI_STORE_DATA_IMM *>(itor, cmdList.end());
ASSERT_NE(cmdList.end(), itor);
auto highDword = genCmdCast<MI_STORE_DATA_IMM *>(*itor)->getDataDword0();
uint64_t foundSsba = ((static_cast<uint64_t>(highDword) & 0xffffffff) << 32) | lowDword;
const auto gmmHelper = pDevice->getGmmHelper();
const auto ssbaCanonized = gmmHelper->canonize(ssba);
EXPECT_EQ(ssbaCanonized, foundSsba);
itor = find<MI_ARB_CHECK *>(itor, cmdList.end());
ASSERT_NE(cmdList.end(), itor);