diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index e226f1fd0f..3b53162dc8 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -2159,12 +2159,12 @@ void CommandListCoreFamily::updateStreamProperties(Kernel &kernel auto disableOverdispatch = hwHelper.isDisableOverdispatchAvailable(hwInfo); if (!containsAnyKernel) { - requiredStreamState.frontEndState.setProperties(isCooperative, disableOverdispatch, false, hwInfo); + requiredStreamState.frontEndState.setProperties(isCooperative, disableOverdispatch, -1, hwInfo); finalStreamState = requiredStreamState; containsAnyKernel = true; } - finalStreamState.frontEndState.setProperties(isCooperative, disableOverdispatch, false, hwInfo); + finalStreamState.frontEndState.setProperties(isCooperative, disableOverdispatch, -1, hwInfo); bool isPatchingVfeStateAllowed = NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get(); if (finalStreamState.frontEndState.isDirty() && isPatchingVfeStateAllowed) { auto pVfeStateAddress = NEO::PreambleHelper::getSpaceForVfeState(commandContainer.getCommandStream(), hwInfo, engineGroupType); diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index 75a59ac55c..4446a3751c 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -221,8 +221,10 @@ ze_result_t CommandQueueHw::executeCommandLists( if (!isPatchingVfeStateAllowed) { streamProperties.frontEndState.setProperties(anyCommandListWithCooperativeKernels, disableOverdispatch, isEngineInstanced, hwInfo); - frontEndStateDirty |= streamProperties.frontEndState.isDirty(); + } else { + streamProperties.frontEndState.singleSliceDispatchCcsMode.set(isEngineInstanced); } + frontEndStateDirty |= streamProperties.frontEndState.isDirty(); gsbaStateDirty |= csr->getGSBAStateDirty(); frontEndStateDirty |= csr->getMediaVFEStateDirty(); @@ -365,9 +367,8 @@ ze_result_t CommandQueueHw::executeCommandLists( if (!isCopyOnlyCommandQueue) { bool programVfe = frontEndStateDirty; if (isPatchingVfeStateAllowed) { - auto requiredStreamStateCopy = commandList->getRequiredStreamState(); - requiredStreamStateCopy.frontEndState.singleSliceDispatchCcsMode.set(isEngineInstanced); - streamProperties.frontEndState.setProperties(requiredStreamStateCopy.frontEndState); + auto &requiredStreamState = commandList->getRequiredStreamState(); + streamProperties.frontEndState.setProperties(requiredStreamState.frontEndState); programVfe |= streamProperties.frontEndState.isDirty(); } @@ -377,9 +378,8 @@ ze_result_t CommandQueueHw::executeCommandLists( } if (isPatchingVfeStateAllowed) { - auto finalStreamStateCopy = commandList->getFinalStreamState(); - finalStreamStateCopy.frontEndState.singleSliceDispatchCcsMode.set(isEngineInstanced); - streamProperties.frontEndState.setProperties(finalStreamStateCopy.frontEndState); + auto &finalStreamState = commandList->getFinalStreamState(); + streamProperties.frontEndState.setProperties(finalStreamState.frontEndState); } } @@ -510,22 +510,19 @@ size_t CommandQueueHw::estimateFrontEndCmdSizeForMultipleCommandL } auto streamPropertiesCopy = csr->getStreamProperties(); - auto isEngineInstanced = csr->getOsContext().isEngineInstanced(); size_t estimatedSize = 0; for (size_t i = 0; i < numCommandLists; i++) { auto commandList = CommandList::fromHandle(phCommandLists[i]); - auto requiredStreamStateCopy = commandList->getRequiredStreamState(); - requiredStreamStateCopy.frontEndState.singleSliceDispatchCcsMode.set(isEngineInstanced); - streamPropertiesCopy.frontEndState.setProperties(requiredStreamStateCopy.frontEndState); + auto &requiredStreamState = commandList->getRequiredStreamState(); + streamPropertiesCopy.frontEndState.setProperties(requiredStreamState.frontEndState); if (isFrontEndStateDirty || streamPropertiesCopy.frontEndState.isDirty()) { estimatedSize += singleFrontEndCmdSize; isFrontEndStateDirty = false; } - auto finalStreamStateCopy = commandList->getFinalStreamState(); - finalStreamStateCopy.frontEndState.singleSliceDispatchCcsMode.set(isEngineInstanced); - streamPropertiesCopy.frontEndState.setProperties(finalStreamStateCopy.frontEndState); + auto &finalStreamState = commandList->getFinalStreamState(); + streamPropertiesCopy.frontEndState.setProperties(finalStreamState.frontEndState); } return estimatedSize; diff --git a/shared/source/command_stream/definitions/stream_properties.inl b/shared/source/command_stream/definitions/stream_properties.inl index d0fa3d2254..599fb25841 100644 --- a/shared/source/command_stream/definitions/stream_properties.inl +++ b/shared/source/command_stream/definitions/stream_properties.inl @@ -23,7 +23,7 @@ struct FrontEndProperties { StreamProperty disableOverdispatch{}; StreamProperty singleSliceDispatchCcsMode{}; - void setProperties(bool isCooperativeKernel, bool disableOverdispatch, bool engineInstancedDevice, const HardwareInfo &hwInfo); + void setProperties(bool isCooperativeKernel, bool disableOverdispatch, int32_t engineInstancedDevice, const HardwareInfo &hwInfo); void setProperties(const FrontEndProperties &properties); bool isDirty(); void clearIsDirty(); diff --git a/shared/source/command_stream/stream_properties.cpp b/shared/source/command_stream/stream_properties.cpp index f79ca1beb1..9b3697000e 100644 --- a/shared/source/command_stream/stream_properties.cpp +++ b/shared/source/command_stream/stream_properties.cpp @@ -37,7 +37,8 @@ void StateComputeModeProperties::clearIsDirty() { largeGrfMode.isDirty = false; } -void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableOverdispatch, bool engineInstancedDevice, const HardwareInfo &hwInfo) { +void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableOverdispatch, int32_t engineInstancedDevice, + const HardwareInfo &hwInfo) { clearIsDirty(); this->disableOverdispatch.set(disableOverdispatch); diff --git a/shared/source/xe_hp_core/preamble_xe_hp_core.cpp b/shared/source/xe_hp_core/preamble_xe_hp_core.cpp index b4d4be6ffa..2df291c2c4 100644 --- a/shared/source/xe_hp_core/preamble_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/preamble_xe_hp_core.cpp @@ -21,7 +21,7 @@ void PreambleHelper::appendProgramVFEState(const HardwareInfo &hwInfo, c auto command = static_cast(cmd); command->setComputeOverdispatchDisable(streamProperties.frontEndState.disableOverdispatch.value == 1); - command->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value); + command->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value == 1); if (DebugManager.flags.CFEComputeOverdispatchDisable.get() != -1) { command->setComputeOverdispatchDisable(DebugManager.flags.CFEComputeOverdispatchDisable.get());