From 76099c3aa77b54e3d45bbe9ef7f24c9b70140bff Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Fri, 10 Mar 2023 21:39:07 +0000 Subject: [PATCH] [fix] do not set default state in context for one-time set properties. - csr class one-time properties should be set only during dispatch time - by allowing one-time properties to be dirty at least once - this is algorithm correction ensuring trigger n-p state change in case - when multi-time properties are not supported on such platform Related-To: NEO-5055 Signed-off-by: Zbigniew Zdanowicz --- .../core/source/cmdlist/cmdlist_imp.cpp | 1 - .../sources/cmdlist/test_cmdlist_6.cpp | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index 3633b6fb47..39e8ca4dba 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -155,7 +155,6 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device commandList = nullptr; return commandList; } - commandList->setStreamPropertiesDefaultSettings(csr->getStreamProperties()); auto commandQueue = CommandQueue::create(productFamily, device, csr, desc, commandList->isCopyOnly(), internalUsage, returnValue); if (!commandQueue) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp index 72e487f4e2..05c4866e4e 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp @@ -172,6 +172,26 @@ HWTEST2_F(CommandListExecuteImmediate, givenOutOfDeviceMemoryErrorOnFlushWhenExe EXPECT_EQ(ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY, commandListImmediate.executeCommandListImmediateWithFlushTask(false, false, false)); } +HWTEST2_F(CommandListExecuteImmediate, GivenImmediateCommandListWhenCommandListIsCreatedThenCsrStateIsNotSet, IsAtLeastSkl) { + std::unique_ptr commandList; + const ze_command_queue_desc_t desc = {}; + ze_result_t returnValue; + commandList.reset(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::RenderCompute, returnValue)); + auto &commandListImmediate = static_cast &>(*commandList); + + auto ¤tCsrStreamProperties = commandListImmediate.csr->getStreamProperties(); + EXPECT_EQ(-1, currentCsrStreamProperties.stateComputeMode.isCoherencyRequired.value); + EXPECT_EQ(-1, currentCsrStreamProperties.stateComputeMode.devicePreemptionMode.value); + + EXPECT_EQ(-1, currentCsrStreamProperties.frontEndState.disableOverdispatch.value); + EXPECT_EQ(-1, currentCsrStreamProperties.frontEndState.singleSliceDispatchCcsMode.value); + + EXPECT_EQ(-1, currentCsrStreamProperties.pipelineSelect.modeSelected.value); + EXPECT_EQ(-1, currentCsrStreamProperties.pipelineSelect.mediaSamplerDopClockGate.value); + + EXPECT_EQ(-1, currentCsrStreamProperties.stateBaseAddress.globalAtomics.value); +} + using CommandListTest = Test; using IsDcFlushSupportedPlatform = IsWithinGfxCore;