Flush tag update on device init

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2023-01-18 09:16:56 +00:00 committed by Compute-Runtime-Automation
parent f4b7a63a35
commit 5f7541084d
7 changed files with 24 additions and 13 deletions

View File

@ -228,6 +228,17 @@ HWTEST_TEMPLATED_F(BlitAuxTranslationTests, whenFlushTagUpdateThenMiFlushDwIsFlu
EXPECT_NE(cmdFound, cmdListBcs.end());
}
HWTEST_TEMPLATED_F(BlitAuxTranslationTests, whenInitializeDeviceWithFirstSubmissionThenMiFlushDwIsFlushed) {
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
EXPECT_EQ(SubmissionStatus::SUCCESS, bcsCsr->initializeDeviceWithFirstSubmission());
auto cmdListBcs = getCmdList<FamilyType>(bcsCsr->getCS(0), 0);
auto cmdFound = expectCommand<MI_FLUSH_DW>(cmdListBcs.begin(), cmdListBcs.end());
EXPECT_NE(cmdFound, cmdListBcs.end());
}
HWTEST_TEMPLATED_F(BlitAuxTranslationTests, whenFlushTagUpdateThenSetStallingCmdsFlag) {
auto ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(bcsCsr);

View File

@ -884,8 +884,12 @@ TEST(DeviceTest, whenCheckBlitSplitEnabledThenReturnsTrue) {
EXPECT_TRUE(Device::isBlitSplitEnabled());
}
TEST(DeviceTest, whenCheckIsInitDeviceWithFirstSubmissionEnabledThenReturnsTrue) {
EXPECT_TRUE(Device::isInitDeviceWithFirstSubmissionEnabled());
TEST(DeviceTest, givenCsrHwWhenCheckIsInitDeviceWithFirstSubmissionEnabledThenReturnsTrue) {
EXPECT_TRUE(Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType::CSR_HW));
}
TEST(DeviceTest, givenCsrNonHwWhenCheckIsInitDeviceWithFirstSubmissionEnabledThenReturnsTrue) {
EXPECT_FALSE(Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType::CSR_TBX));
}
TEST(PlatformsDestructor, whenGlobalPlatformsDestructorIsCalledThenGlobalPlatformsAreDestroyed) {

View File

@ -1583,11 +1583,7 @@ void CommandStreamReceiverHw<GfxFamily>::createKernelArgsBufferAllocation() {
template <typename GfxFamily>
SubmissionStatus CommandStreamReceiverHw<GfxFamily>::initializeDeviceWithFirstSubmission() {
auto lock = obtainUniqueOwnership();
auto &commandStream = getCS(EncodeBatchBufferStartOrEnd<GfxFamily>::getBatchBufferEndSize());
auto commandStreamStart = commandStream.getUsed();
return this->flushSmallTask(commandStream, commandStreamStart);
return flushTagUpdate();
}
template <typename GfxFamily>

View File

@ -388,7 +388,7 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
if (!defaultEngineAlreadySet) {
defaultEngineIndex = deviceCsrIndex;
if (Device::isInitDeviceWithFirstSubmissionEnabled()) {
if (osContext->isDebuggableContext() || Device::isInitDeviceWithFirstSubmissionEnabled(commandStreamReceiver->getType())) {
if (SubmissionStatus::SUCCESS != commandStreamReceiver->initializeDeviceWithFirstSubmission()) {
return false;
}

View File

@ -10,6 +10,7 @@
#include "shared/source/helpers/engine_control.h"
#include "shared/source/helpers/engine_node_helper.h"
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include "shared/source/helpers/options.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/performance_counters.h"
#include "shared/source/utilities/reference_tracked_object.h"
@ -107,7 +108,7 @@ class Device : public ReferenceTrackedObject<Device> {
RootDeviceEnvironment &getRootDeviceEnvironmentRef() const;
bool isFullRangeSvm() const;
static bool isBlitSplitEnabled();
static bool isInitDeviceWithFirstSubmissionEnabled();
static bool isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType csrType);
bool isBcsSplitSupported();
bool areSharedSystemAllocationsAllowed() const;
template <typename SpecializedDeviceT>

View File

@ -13,8 +13,8 @@ bool Device::isBlitSplitEnabled() {
return true;
}
bool Device::isInitDeviceWithFirstSubmissionEnabled() {
return true;
bool Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType csrType) {
return csrType == CommandStreamReceiverType::CSR_HW;
}
} // namespace NEO

View File

@ -7,14 +7,13 @@
#include "shared/source/device/device.h"
#include "shared/test/common/helpers/ult_hw_config.h"
namespace NEO {
bool Device::isBlitSplitEnabled() {
return ultHwConfig.useBlitSplit;
}
bool Device::isInitDeviceWithFirstSubmissionEnabled() {
bool Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType csrType) {
return ultHwConfig.useFirstSubmissionInitDevice;
}