mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
Debug flag to control MI_ARB_CHECK prefetcher
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
41c51df086
commit
e24322f266
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
@@ -111,4 +112,25 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncoderTests, whenAppendParamsForImageFromBuf
|
||||
EncodeSurfaceState<FamilyType>::appendParamsForImageFromBuffer(&surfaceState);
|
||||
|
||||
EXPECT_EQ(0, memcmp(&expectedState, &surfaceState, sizeof(surfaceState)));
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncoderTests, givenDebugFlagSetWhenProgrammingMiArbThenSetPreparserDisabledValue) {
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
using MI_ARB_CHECK = typename FamilyType::MI_ARB_CHECK;
|
||||
|
||||
for (int32_t value : {-1, 0, 1}) {
|
||||
DebugManager.flags.ForcePreParserEnabledForMiArbCheck.set(value);
|
||||
|
||||
MI_ARB_CHECK buffer[2] = {};
|
||||
LinearStream linearStream(buffer, sizeof(buffer));
|
||||
|
||||
EncodeMiArbCheck<FamilyType>::program(linearStream);
|
||||
|
||||
if (value == 0) {
|
||||
EXPECT_TRUE(buffer[0].getPreParserDisable());
|
||||
} else {
|
||||
EXPECT_FALSE(buffer[0].getPreParserDisable());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -956,3 +956,26 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DirectSubmissionTest,
|
||||
size_t usedSizeAfter = directSubmission.ringCommandStream.getUsed();
|
||||
EXPECT_EQ(expectedSize, usedSizeAfter - usedSize);
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionTest, givenDebugFlagSetWhenDispatchingPrefetcherThenSetCorrectValue) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.ForcePreParserEnabledForMiArbCheck.set(1);
|
||||
|
||||
using MI_ARB_CHECK = typename FamilyType::MI_ARB_CHECK;
|
||||
using Dispatcher = BlitterDispatcher<FamilyType>;
|
||||
|
||||
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice, *osContext.get());
|
||||
|
||||
bool ret = directSubmission.allocateResources();
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
directSubmission.dispatchDisablePrefetcher(true);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, 0);
|
||||
hwParse.findHardwareCommands<FamilyType>();
|
||||
MI_ARB_CHECK *arbCheck = hwParse.getCommand<MI_ARB_CHECK>();
|
||||
ASSERT_NE(nullptr, arbCheck);
|
||||
|
||||
EXPECT_EQ(0u, arbCheck->getPreParserDisable());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user