mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 07:14:10 +08:00
refactor: add method to arb check encoder to program buffer pointer directly
Related-To: NEO-15376 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1c36fdc9b0
commit
b57d0b2544
@@ -685,6 +685,10 @@ template <typename GfxFamily>
|
||||
struct EncodeMiArbCheck {
|
||||
using MI_ARB_CHECK = typename GfxFamily::MI_ARB_CHECK;
|
||||
|
||||
static void program(MI_ARB_CHECK *arbCheckCmd, std::optional<bool> preParserDisable);
|
||||
static inline void program(void *cmdBuffer, std::optional<bool> preParserDisable) {
|
||||
program(reinterpret_cast<MI_ARB_CHECK *>(cmdBuffer), preParserDisable);
|
||||
}
|
||||
static void program(LinearStream &commandStream, std::optional<bool> preParserDisable);
|
||||
static size_t getCommandSize();
|
||||
|
||||
|
||||
@@ -1098,11 +1098,15 @@ size_t EncodeMiFlushDW<Family>::getCommandSizeWithWa(const EncodeDummyBlitWaArgs
|
||||
|
||||
template <typename Family>
|
||||
void EncodeMiArbCheck<Family>::program(LinearStream &commandStream, std::optional<bool> preParserDisable) {
|
||||
MI_ARB_CHECK cmd = Family::cmdInitArbCheck;
|
||||
|
||||
EncodeMiArbCheck<Family>::adjust(cmd, preParserDisable);
|
||||
auto miArbCheckStream = commandStream.getSpaceForCmd<MI_ARB_CHECK>();
|
||||
*miArbCheckStream = cmd;
|
||||
program(miArbCheckStream, preParserDisable);
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeMiArbCheck<Family>::program(MI_ARB_CHECK *arbCheckCmd, std::optional<bool> preParserDisable) {
|
||||
MI_ARB_CHECK cmd = Family::cmdInitArbCheck;
|
||||
EncodeMiArbCheck<Family>::adjust(cmd, preParserDisable);
|
||||
*arbCheckCmd = cmd;
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
|
||||
@@ -679,9 +679,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncoderTests, givenDebugFlagSetWhenProgrammi
|
||||
|
||||
using MI_ARB_CHECK = typename FamilyType::MI_ARB_CHECK;
|
||||
|
||||
alignas(4) uint8_t arbCheckBuffer[sizeof(MI_ARB_CHECK)];
|
||||
void *arbCheckBufferPtr = arbCheckBuffer;
|
||||
|
||||
for (int32_t value : {-1, 0, 1}) {
|
||||
debugManager.flags.ForcePreParserEnabledForMiArbCheck.set(value);
|
||||
|
||||
memset(arbCheckBuffer, 0, sizeof(arbCheckBuffer));
|
||||
|
||||
MI_ARB_CHECK buffer[2] = {};
|
||||
LinearStream linearStream(buffer, sizeof(buffer));
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
@@ -689,12 +694,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncoderTests, givenDebugFlagSetWhenProgrammi
|
||||
rootDeviceEnvironment.initGmm();
|
||||
|
||||
EncodeMiArbCheck<FamilyType>::program(linearStream, false);
|
||||
EncodeMiArbCheck<FamilyType>::program(arbCheckBufferPtr, false);
|
||||
|
||||
if (value == 0) {
|
||||
EXPECT_TRUE(buffer[0].getPreParserDisable());
|
||||
} else {
|
||||
EXPECT_FALSE(buffer[0].getPreParserDisable());
|
||||
}
|
||||
EXPECT_EQ(0, memcmp(arbCheckBufferPtr, &buffer[0], sizeof(MI_ARB_CHECK)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user