Disable RelaxedOrdering if UpdateTagFromWait is disabled
Related-To: NEO-7458 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
parent
ecd8c6b410
commit
151aecc8bd
|
@ -548,6 +548,7 @@ HWTEST2_F(CommandQueueCommandsXeHpc, givenFlushTaskSubmissionEnabledAndSplitBcsC
|
||||||
|
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
DebugManager.flags.SplitBcsCopy.set(1);
|
DebugManager.flags.SplitBcsCopy.set(1);
|
||||||
|
DebugManager.flags.UpdateTaskCountFromWait.set(3);
|
||||||
|
|
||||||
ze_result_t returnValue;
|
ze_result_t returnValue;
|
||||||
auto hwInfo = *NEO::defaultHwInfo;
|
auto hwInfo = *NEO::defaultHwInfo;
|
||||||
|
|
|
@ -509,7 +509,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver {
|
||||||
|
|
||||||
SubmissionStatus flushTagUpdate() override { return SubmissionStatus::SUCCESS; };
|
SubmissionStatus flushTagUpdate() override { return SubmissionStatus::SUCCESS; };
|
||||||
void updateTagFromWait() override{};
|
void updateTagFromWait() override{};
|
||||||
bool isUpdateTagFromWaitEnabled() override { return false; };
|
bool isUpdateTagFromWaitEnabled() const override { return false; };
|
||||||
void createKernelArgsBufferAllocation() override {}
|
void createKernelArgsBufferAllocation() override {}
|
||||||
|
|
||||||
bool isMultiOsContextCapable() const override { return false; }
|
bool isMultiOsContextCapable() const override { return false; }
|
||||||
|
|
|
@ -250,7 +250,7 @@ class CommandStreamReceiver {
|
||||||
|
|
||||||
virtual SubmissionStatus flushTagUpdate() = 0;
|
virtual SubmissionStatus flushTagUpdate() = 0;
|
||||||
virtual void updateTagFromWait() = 0;
|
virtual void updateTagFromWait() = 0;
|
||||||
virtual bool isUpdateTagFromWaitEnabled() = 0;
|
virtual bool isUpdateTagFromWaitEnabled() const = 0;
|
||||||
|
|
||||||
ScratchSpaceController *getScratchSpaceController() const {
|
ScratchSpaceController *getScratchSpaceController() const {
|
||||||
return scratchSpaceController.get();
|
return scratchSpaceController.get();
|
||||||
|
@ -269,7 +269,7 @@ class CommandStreamReceiver {
|
||||||
|
|
||||||
void startControllingDirectSubmissions();
|
void startControllingDirectSubmissions();
|
||||||
|
|
||||||
bool isAnyDirectSubmissionEnabled() {
|
bool isAnyDirectSubmissionEnabled() const {
|
||||||
return this->isDirectSubmissionEnabled() || isBlitterDirectSubmissionEnabled();
|
return this->isDirectSubmissionEnabled() || isBlitterDirectSubmissionEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||||
size_t commandStreamStartTask);
|
size_t commandStreamStartTask);
|
||||||
SubmissionStatus flushHandler(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency);
|
SubmissionStatus flushHandler(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency);
|
||||||
|
|
||||||
bool isUpdateTagFromWaitEnabled() override;
|
bool isUpdateTagFromWaitEnabled() const override;
|
||||||
void updateTagFromWait() override;
|
void updateTagFromWait() override;
|
||||||
|
|
||||||
bool isMultiOsContextCapable() const override;
|
bool isMultiOsContextCapable() const override;
|
||||||
|
|
|
@ -1456,7 +1456,7 @@ inline SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushHandler(BatchBu
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename GfxFamily>
|
template <typename GfxFamily>
|
||||||
inline bool CommandStreamReceiverHw<GfxFamily>::isUpdateTagFromWaitEnabled() {
|
inline bool CommandStreamReceiverHw<GfxFamily>::isUpdateTagFromWaitEnabled() const {
|
||||||
auto &gfxCoreHelper = getGfxCoreHelper();
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
auto enabled = gfxCoreHelper.isUpdateTaskCountFromWaitSupported();
|
auto enabled = gfxCoreHelper.isUpdateTaskCountFromWaitSupported();
|
||||||
enabled &= this->isAnyDirectSubmissionEnabled();
|
enabled &= this->isAnyDirectSubmissionEnabled();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 Intel Corporation
|
* Copyright (C) 2022-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,7 @@ DirectSubmissionInputParams::DirectSubmissionInputParams(const CommandStreamRece
|
||||||
globalFenceAllocation = commandStreamReceiver.getGlobalFenceAllocation();
|
globalFenceAllocation = commandStreamReceiver.getGlobalFenceAllocation();
|
||||||
workPartitionAllocation = commandStreamReceiver.getWorkPartitionAllocation();
|
workPartitionAllocation = commandStreamReceiver.getWorkPartitionAllocation();
|
||||||
completionFenceAllocation = commandStreamReceiver.getTagAllocation();
|
completionFenceAllocation = commandStreamReceiver.getTagAllocation();
|
||||||
|
isUpdateTagFromWaitEnabled = commandStreamReceiver.isUpdateTagFromWaitEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|
|
@ -70,6 +70,7 @@ struct DirectSubmissionInputParams : NonCopyableClass {
|
||||||
GraphicsAllocation *workPartitionAllocation = nullptr;
|
GraphicsAllocation *workPartitionAllocation = nullptr;
|
||||||
GraphicsAllocation *completionFenceAllocation = nullptr;
|
GraphicsAllocation *completionFenceAllocation = nullptr;
|
||||||
const uint32_t rootDeviceIndex;
|
const uint32_t rootDeviceIndex;
|
||||||
|
bool isUpdateTagFromWaitEnabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename GfxFamily, typename Dispatcher>
|
template <typename GfxFamily, typename Dispatcher>
|
||||||
|
|
|
@ -85,7 +85,7 @@ DirectSubmissionHw<GfxFamily, Dispatcher>::DirectSubmissionHw(const DirectSubmis
|
||||||
|
|
||||||
dcFlushRequired = MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable(true, inputParams.rootDeviceEnvironment);
|
dcFlushRequired = MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable(true, inputParams.rootDeviceEnvironment);
|
||||||
auto &gfxCoreHelper = inputParams.rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
auto &gfxCoreHelper = inputParams.rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
||||||
relaxedOrderingEnabled = gfxCoreHelper.isRelaxedOrderingSupported();
|
relaxedOrderingEnabled = gfxCoreHelper.isRelaxedOrderingSupported() && inputParams.isUpdateTagFromWaitEnabled;
|
||||||
|
|
||||||
this->currentRelaxedOrderingQueueSize = RelaxedOrderingHelper::queueSizeMultiplier;
|
this->currentRelaxedOrderingQueueSize = RelaxedOrderingHelper::queueSizeMultiplier;
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
|
||||||
|
|
||||||
SubmissionStatus flushTagUpdate() override { return SubmissionStatus::SUCCESS; };
|
SubmissionStatus flushTagUpdate() override { return SubmissionStatus::SUCCESS; };
|
||||||
void updateTagFromWait() override{};
|
void updateTagFromWait() override{};
|
||||||
bool isUpdateTagFromWaitEnabled() override { return false; };
|
bool isUpdateTagFromWaitEnabled() const override { return false; };
|
||||||
|
|
||||||
bool isMultiOsContextCapable() const override { return multiOsContextCapable; }
|
bool isMultiOsContextCapable() const override { return multiOsContextCapable; }
|
||||||
|
|
||||||
|
|
|
@ -134,8 +134,8 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWithoutCompletionFenceAlloca
|
||||||
EXPECT_EQ(nullptr, directSubmission.completionFenceAllocation);
|
EXPECT_EQ(nullptr, directSubmission.completionFenceAllocation);
|
||||||
|
|
||||||
size_t expectedAllocationsCnt = 3;
|
size_t expectedAllocationsCnt = 3;
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
|
||||||
if (gfxCoreHelper.isRelaxedOrderingSupported()) {
|
if (directSubmission.isRelaxedOrderingEnabled()) {
|
||||||
expectedAllocationsCnt += 2;
|
expectedAllocationsCnt += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,8 +166,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWithCompletionFenceAllocatio
|
||||||
EXPECT_EQ(&completionFenceAllocation, directSubmission.completionFenceAllocation);
|
EXPECT_EQ(&completionFenceAllocation, directSubmission.completionFenceAllocation);
|
||||||
|
|
||||||
size_t expectedAllocationsCnt = 4;
|
size_t expectedAllocationsCnt = 4;
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
if (directSubmission.isRelaxedOrderingEnabled()) {
|
||||||
if (gfxCoreHelper.isRelaxedOrderingSupported()) {
|
|
||||||
expectedAllocationsCnt += 2;
|
expectedAllocationsCnt += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1017,6 +1017,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest, givenDebugFlagSetWhenStoppingRingbu
|
||||||
struct DirectSubmissionRelaxedOrderingTests : public DirectSubmissionDispatchBufferTest {
|
struct DirectSubmissionRelaxedOrderingTests : public DirectSubmissionDispatchBufferTest {
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
DebugManager.flags.DirectSubmissionRelaxedOrdering.set(1);
|
DebugManager.flags.DirectSubmissionRelaxedOrdering.set(1);
|
||||||
|
DebugManager.flags.UpdateTaskCountFromWait.set(3);
|
||||||
DirectSubmissionDispatchBufferTest::SetUp();
|
DirectSubmissionDispatchBufferTest::SetUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2704,4 +2705,24 @@ HWTEST2_F(DirectSubmissionRelaxedOrderingTests, givenNumClientsWhenAskingIfRelax
|
||||||
ultCsr->registerClient();
|
ultCsr->registerClient();
|
||||||
EXPECT_EQ(4u, ultCsr->getNumClients());
|
EXPECT_EQ(4u, ultCsr->getNumClients());
|
||||||
EXPECT_TRUE(NEO::RelaxedOrderingHelper::isRelaxedOrderingDispatchAllowed(*ultCsr, 1));
|
EXPECT_TRUE(NEO::RelaxedOrderingHelper::isRelaxedOrderingDispatchAllowed(*ultCsr, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
HWTEST2_F(DirectSubmissionRelaxedOrderingTests, givenUpdateTagFromWaitDisabledWhenCreatingDirectSubmissionThenDisableRelaxedOrdering, IsAtLeastXeHpcCore) {
|
||||||
|
DebugManager.flags.DirectSubmissionRelaxedOrdering.set(-1);
|
||||||
|
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
||||||
|
|
||||||
|
DebugManager.flags.UpdateTaskCountFromWait.set(0);
|
||||||
|
{
|
||||||
|
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*csr);
|
||||||
|
|
||||||
|
EXPECT_FALSE(directSubmission.isRelaxedOrderingEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugManager.flags.DirectSubmissionRelaxedOrdering.set(1);
|
||||||
|
{
|
||||||
|
|
||||||
|
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*csr);
|
||||||
|
|
||||||
|
EXPECT_TRUE(directSubmission.isRelaxedOrderingEnabled());
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -62,9 +62,8 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenDirectIsInitializedAndStartedThe
|
||||||
EXPECT_NE(nullptr, wddmDirectSubmission->ringBuffers[1].ringBuffer);
|
EXPECT_NE(nullptr, wddmDirectSubmission->ringBuffers[1].ringBuffer);
|
||||||
EXPECT_NE(nullptr, wddmDirectSubmission->semaphores);
|
EXPECT_NE(nullptr, wddmDirectSubmission->semaphores);
|
||||||
|
|
||||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
|
||||||
size_t expectedAllocationsCnt = 3;
|
size_t expectedAllocationsCnt = 3;
|
||||||
if (gfxCoreHelper.isRelaxedOrderingSupported()) {
|
if (wddmDirectSubmission->isRelaxedOrderingEnabled()) {
|
||||||
expectedAllocationsCnt += 2;
|
expectedAllocationsCnt += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,9 +98,8 @@ HWTEST_F(WddmDirectSubmissionNoPreemptionTest, givenWddmWhenDirectIsInitializedA
|
||||||
EXPECT_NE(nullptr, wddmDirectSubmission->ringBuffers[1].ringBuffer);
|
EXPECT_NE(nullptr, wddmDirectSubmission->ringBuffers[1].ringBuffer);
|
||||||
EXPECT_NE(nullptr, wddmDirectSubmission->semaphores);
|
EXPECT_NE(nullptr, wddmDirectSubmission->semaphores);
|
||||||
|
|
||||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
|
||||||
size_t expectedAllocationsCnt = 3;
|
size_t expectedAllocationsCnt = 3;
|
||||||
if (gfxCoreHelper.isRelaxedOrderingSupported()) {
|
if (wddmDirectSubmission->isRelaxedOrderingEnabled()) {
|
||||||
expectedAllocationsCnt += 2;
|
expectedAllocationsCnt += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,9 +140,9 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesThenExpectRin
|
||||||
|
|
||||||
bool ret = wddmDirectSubmission.allocateResources();
|
bool ret = wddmDirectSubmission.allocateResources();
|
||||||
EXPECT_TRUE(ret);
|
EXPECT_TRUE(ret);
|
||||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
|
||||||
size_t expectedAllocationsCnt = 3;
|
size_t expectedAllocationsCnt = 3;
|
||||||
if (gfxCoreHelper.isRelaxedOrderingSupported()) {
|
if (wddmDirectSubmission.isRelaxedOrderingEnabled()) {
|
||||||
expectedAllocationsCnt += 2;
|
expectedAllocationsCnt += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,9 +184,9 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesResidencyFail
|
||||||
|
|
||||||
bool ret = wddmDirectSubmission.allocateResources();
|
bool ret = wddmDirectSubmission.allocateResources();
|
||||||
EXPECT_FALSE(ret);
|
EXPECT_FALSE(ret);
|
||||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
|
||||||
size_t expectedAllocationsCnt = 3;
|
size_t expectedAllocationsCnt = 3;
|
||||||
if (gfxCoreHelper.isRelaxedOrderingSupported()) {
|
if (wddmDirectSubmission.isRelaxedOrderingEnabled()) {
|
||||||
expectedAllocationsCnt += 2;
|
expectedAllocationsCnt += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2022 Intel Corporation
|
* Copyright (C) 2020-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
|
@ -26,6 +26,7 @@ struct MockWddmDirectSubmission : public WddmDirectSubmission<GfxFamily, Dispatc
|
||||||
using BaseClass::handleCompletionFence;
|
using BaseClass::handleCompletionFence;
|
||||||
using BaseClass::handleResidency;
|
using BaseClass::handleResidency;
|
||||||
using BaseClass::isCompleted;
|
using BaseClass::isCompleted;
|
||||||
|
using BaseClass::isRelaxedOrderingEnabled;
|
||||||
using BaseClass::miMemFenceRequired;
|
using BaseClass::miMemFenceRequired;
|
||||||
using BaseClass::osContextWin;
|
using BaseClass::osContextWin;
|
||||||
using BaseClass::ringBuffers;
|
using BaseClass::ringBuffers;
|
||||||
|
|
Loading…
Reference in New Issue