From 3a2281bf77399d390e6ff4670570d335b4f64e94 Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Fri, 23 Apr 2021 17:27:40 +0000 Subject: [PATCH] Program additional VFE_STATE instructions when needed Additonal VFE_STATEs may be programmed when appending kernels to a command list and when the command list is executed. Related-To: NEO-4940, NEO-4574 Signed-off-by: Filip Hazubski --- level_zero/core/source/cmdlist/cmdlist.h | 27 +++++++++ level_zero/core/source/cmdlist/cmdlist_hw.h | 6 ++ level_zero/core/source/cmdlist/cmdlist_hw.inl | 50 ++++++++++++++++ .../core/source/cmdlist/cmdlist_hw_base.inl | 3 + level_zero/core/source/cmdqueue/cmdqueue_hw.h | 6 ++ .../core/source/cmdqueue/cmdqueue_hw.inl | 57 ++++++++++++++++--- .../core/source/cmdqueue/cmdqueue_hw_base.inl | 6 ++ .../core/test/unit_tests/mocks/mock_cmdlist.h | 9 +++ .../sources/cmdlist/test_cmdlist_3.cpp | 31 ++++++++++ .../command_stream_receiver_hw_base.inl | 2 +- .../definitions/stream_properties.h | 6 +- shared/source/helpers/hw_helper.h | 3 + shared/source/helpers/hw_helper_bdw_plus.inl | 5 ++ 13 files changed, 200 insertions(+), 11 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist.h b/level_zero/core/source/cmdlist/cmdlist.h index 752d1f7d1a..bd9b374b3a 100644 --- a/level_zero/core/source/cmdlist/cmdlist.h +++ b/level_zero/core/source/cmdlist/cmdlist.h @@ -16,6 +16,8 @@ #include #include +#include "stream_properties.h" + #include struct _ze_command_list_handle_t {}; @@ -37,6 +39,17 @@ struct CommandList : _ze_command_list_handle_t { static CommandList *allocate(uint32_t numIddsPerBlock) { return new Type(numIddsPerBlock); } }; + struct CommandToPatch { + enum CommandType { + FrontEndState, + Invalid + }; + void *pDestination = nullptr; + void *pCommand = nullptr; + CommandType type = Invalid; + }; + using CommandsToPatch = StackVec; + virtual ze_result_t close() = 0; virtual ze_result_t destroy() = 0; virtual ze_result_t appendEventReset(ze_event_handle_t hEvent) = 0; @@ -200,6 +213,16 @@ struct CommandList : _ze_command_list_handle_t { virtual ze_result_t setSyncModeQueue(bool syncMode) = 0; + const NEO::StreamProperties &getRequiredStreamState() { + return requiredStreamState; + } + const NEO::StreamProperties &getFinalStreamState() { + return finalStreamState; + } + const CommandsToPatch &getCommandsToPatch() { + return commandsToPatch; + } + protected: std::map hostPtrMap; uint32_t commandListPerThreadScratchSize = 0u; @@ -211,6 +234,10 @@ struct CommandList : _ze_command_list_handle_t { NEO::GraphicsAllocation *getAllocationFromHostPtrMap(const void *buffer, uint64_t bufferSize); NEO::GraphicsAllocation *getHostPtrAlloc(const void *buffer, uint64_t bufferSize); bool containsStatelessUncachedResource = false; + + NEO::StreamProperties requiredStreamState{}; + NEO::StreamProperties finalStreamState{}; + CommandsToPatch commandsToPatch{}; }; using CommandListAllocatorFn = CommandList *(*)(uint32_t); diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.h b/level_zero/core/source/cmdlist/cmdlist_hw.h index 60e84cbb46..4a53d1699d 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.h +++ b/level_zero/core/source/cmdlist/cmdlist_hw.h @@ -11,6 +11,7 @@ #include "level_zero/core/source/cmdlist/cmdlist_imp.h" #include "igfxfmid.h" +#include "stream_properties.h" namespace NEO { enum class ImageType; @@ -42,6 +43,7 @@ struct CommandListCoreFamily : CommandListImp { using CommandListImp::CommandListImp; ze_result_t initialize(Device *device, NEO::EngineGroupType engineGroupType) override; virtual void programL3(bool isSLMused); + ~CommandListCoreFamily() override; ze_result_t close() override; ze_result_t appendEventReset(ze_event_handle_t hEvent) override; @@ -211,6 +213,8 @@ struct CommandListCoreFamily : CommandListImp { bool isCooperative); ze_result_t appendLaunchKernelSplit(ze_kernel_handle_t hKernel, const ze_group_count_t *pThreadGroupDimensions, ze_event_handle_t hEvent); ze_result_t prepareIndirectParams(const ze_group_count_t *pThreadGroupDimensions); + void updateStreamProperties(Kernel &kernel); + void clearCommandsToPatch(); void applyMemoryRangesBarrier(uint32_t numRanges, const size_t *pRangeSizes, const void **pRanges); @@ -228,6 +232,8 @@ struct CommandListCoreFamily : CommandListImp { uint64_t getInputBufferSize(NEO::ImageType imageType, uint64_t bytesPerPixel, const ze_image_region_t *region); MOCKABLE_VIRTUAL AlignedAllocationData getAlignedAllocation(Device *device, const void *buffer, uint64_t bufferSize); ze_result_t addEventsToCmdList(uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents); + + bool containsAnyKernel = false; }; template diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 62eaf22db9..6108372f0c 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -54,6 +54,11 @@ inline ze_result_t parseErrorCode(NEO::ErrorCode returnValue) { return ZE_RESULT_SUCCESS; } +template +CommandListCoreFamily::~CommandListCoreFamily() { + clearCommandsToPatch(); +} + template void CommandListCoreFamily::programThreadArbitrationPolicy(Device *device) { using GfxFamily = typename NEO::GfxFamilyMapper::GfxFamily; @@ -77,6 +82,10 @@ ze_result_t CommandListCoreFamily::reset() { unifiedMemoryControls.indirectSharedAllocationsAllowed = false; commandListPreemptionMode = device->getDevicePreemptionMode(); commandListPerThreadScratchSize = 0u; + requiredStreamState = {}; + finalStreamState = requiredStreamState; + containsAnyKernel = false; + clearCommandsToPatch(); if (!isCopyOnly()) { if (!NEO::ApiSpecificConfig::getBindlessConfiguration()) { @@ -1828,6 +1837,47 @@ ze_result_t CommandListCoreFamily::prepareIndirectParams(const ze return ZE_RESULT_SUCCESS; } +template +void CommandListCoreFamily::updateStreamProperties(Kernel &kernel) { + using GfxFamily = typename NEO::GfxFamilyMapper::GfxFamily; + using VFE_STATE_TYPE = typename GfxFamily::VFE_STATE_TYPE; + + if (!containsAnyKernel) { + requiredStreamState.setCooperativeKernelProperties(kernel.usesSyncBuffer(), device->getHwInfo()); + finalStreamState = requiredStreamState; + containsAnyKernel = true; + return; + } + + auto &hwInfo = device->getHwInfo(); + auto programVfe = finalStreamState.setCooperativeKernelProperties(kernel.usesSyncBuffer(), hwInfo); + if (programVfe) { + auto pVfeStateAddress = NEO::PreambleHelper::getSpaceForVfeState(commandContainer.getCommandStream(), hwInfo, engineGroupType); + auto pVfeState = new VFE_STATE_TYPE; + NEO::PreambleHelper::programVfeState(pVfeState, hwInfo, 0, 0, device->getMaxNumHwThreads(), + NEO::AdditionalKernelExecInfo::NotApplicable, finalStreamState); + commandsToPatch.push_back({pVfeStateAddress, pVfeState, CommandToPatch::FrontEndState}); + } +} + +template +void CommandListCoreFamily::clearCommandsToPatch() { + using GfxFamily = typename NEO::GfxFamilyMapper::GfxFamily; + using VFE_STATE_TYPE = typename GfxFamily::VFE_STATE_TYPE; + + for (auto &commandToPatch : commandsToPatch) { + switch (commandToPatch.type) { + case CommandList::CommandToPatch::FrontEndState: + UNRECOVERABLE_IF(commandToPatch.pCommand == nullptr); + delete reinterpret_cast(commandToPatch.pCommand); + break; + default: + UNRECOVERABLE_IF(true); + } + } + commandsToPatch.clear(); +} + template ze_result_t CommandListCoreFamily::setGlobalWorkSizeIndirect(NEO::CrossThreadDataOffset offsets[3], void *crossThreadAddress, uint32_t lws[3]) { using GfxFamily = typename NEO::GfxFamilyMapper::GfxFamily; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl index baaef4b18e..93d277d22c 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl @@ -101,6 +101,8 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(z kernel->getKernelDescriptor().kernelMetadata.kernelName.c_str()); } + updateStreamProperties(*kernel); + NEO::EncodeDispatchKernel::encode(commandContainer, reinterpret_cast(pThreadGroupDimensions), isIndirect, @@ -140,4 +142,5 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(z return ZE_RESULT_SUCCESS; } + } // namespace L0 diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.h b/level_zero/core/source/cmdqueue/cmdqueue_hw.h index e58295a88a..fb4a72278a 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.h +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.h @@ -16,6 +16,7 @@ #include "level_zero/core/source/cmdqueue/cmdqueue_imp.h" #include "igfxfmid.h" +#include "stream_properties.h" namespace L0 { @@ -39,6 +40,8 @@ struct CommandQueueHw : public CommandQueueImp { size_t estimateStateBaseAddressCmdSize(); MOCKABLE_VIRTUAL void programFrontEnd(uint64_t scratchAddress, uint32_t perThreadScratchSpaceSize, NEO::LinearStream &commandStream); + size_t estimateFrontEndCmdSizeForMultipleCommandLists(bool isFrontEndStateDirty, uint32_t numCommandLists, + ze_command_list_handle_t *phCommandLists); size_t estimateFrontEndCmdSize(); size_t estimatePipelineSelect(); void programPipelineSelect(NEO::LinearStream &commandStream); @@ -50,6 +53,9 @@ struct CommandQueueHw : public CommandQueueImp { uint32_t perThreadScratchSpaceSize); bool getPreemptionCmdProgramming() override; + void patchCommands(CommandList &commandList, uint64_t scratchAddress); + + NEO::StreamProperties streamProperties{}; }; } // namespace L0 diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index e74cd93328..4a626f98a3 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -174,10 +174,11 @@ ze_result_t CommandQueueHw::executeCommandLists( linearStreamSizeEstimate += sizeof(MI_BATCH_BUFFER_END); } + auto &hwInfo = device->getHwInfo(); if (hFence) { fence = Fence::fromHandle(hFence); spaceForResidency += residencyContainerSpaceForFence; - linearStreamSizeEstimate += isCopyOnlyCommandQueue ? NEO::EncodeMiFlushDW::getMiFlushDwCmdSizeForDataWrite() : NEO::MemorySynchronizationCommands::getSizeForPipeControlWithPostSyncOperation(device->getHwInfo()); + linearStreamSizeEstimate += isCopyOnlyCommandQueue ? NEO::EncodeMiFlushDW::getMiFlushDwCmdSizeForDataWrite() : NEO::MemorySynchronizationCommands::getSizeForPipeControlWithPostSyncOperation(hwInfo); } spaceForResidency += residencyContainerSpaceForTagWrite; @@ -201,9 +202,7 @@ ze_result_t CommandQueueHw::executeCommandLists( linearStreamSizeEstimate += estimatePipelineSelect(); } - if (frontEndStateDirty) { - linearStreamSizeEstimate += estimateFrontEndCmdSize(); - } + linearStreamSizeEstimate += estimateFrontEndCmdSizeForMultipleCommandLists(frontEndStateDirty, numCommandLists, phCommandLists); if (gsbaStateDirty) { linearStreamSizeEstimate += estimateStateBaseAddressCmdSize(); @@ -216,7 +215,7 @@ ze_result_t CommandQueueHw::executeCommandLists( linearStreamSizeEstimate += NEO::SWTagsManager::estimateSpaceForSWTags(); } - linearStreamSizeEstimate += isCopyOnlyCommandQueue ? NEO::EncodeMiFlushDW::getMiFlushDwCmdSizeForDataWrite() : NEO::MemorySynchronizationCommands::getSizeForPipeControlWithPostSyncOperation(device->getHwInfo()); + linearStreamSizeEstimate += isCopyOnlyCommandQueue ? NEO::EncodeMiFlushDW::getMiFlushDwCmdSizeForDataWrite() : NEO::MemorySynchronizationCommands::getSizeForPipeControlWithPostSyncOperation(hwInfo); size_t alignedSize = alignUp(linearStreamSizeEstimate, minCmdBufferPtrAlign); size_t padding = alignedSize - linearStreamSizeEstimate; reserveLinearStreamSize(alignedSize); @@ -256,9 +255,6 @@ ze_result_t CommandQueueHw::executeCommandLists( commandQueueDebugCmdsProgrammed = true; } - if (frontEndStateDirty) { - programFrontEnd(scratchSpaceController->getScratchPatchAddress(), scratchSpaceController->getPerThreadScratchSpaceSize(), child); - } if (gsbaStateDirty) { auto indirectHeap = CommandList::fromHandle(phCommandLists[0])->commandContainer.getIndirectHeap(NEO::HeapType::INDIRECT_OBJECT); programStateBaseAddress(scratchSpaceController->calculateNewGSH(), indirectHeap->getGraphicsAllocation()->isAllocatedInLocalMemoryPool(), child); @@ -332,6 +328,22 @@ ze_result_t CommandQueueHw::executeCommandLists( statePreemption = commandListPreemption; } + if (!isCopyOnlyCommandQueue) { + auto &requiredStreamState = commandList->getRequiredStreamState(); + auto programVfe = streamProperties.setCooperativeKernelProperties(requiredStreamState.getCooperativeKernelProperties(), hwInfo); + if (frontEndStateDirty) { + programVfe = true; + frontEndStateDirty = false; + } + if (programVfe) { + programFrontEnd(scratchSpaceController->getScratchPatchAddress(), scratchSpaceController->getPerThreadScratchSpaceSize(), child); + } + auto &finalStreamState = commandList->getFinalStreamState(); + streamProperties.setCooperativeKernelProperties(finalStreamState.getCooperativeKernelProperties(), hwInfo); + } + + patchCommands(*commandList, scratchSpaceController->getScratchPatchAddress()); + for (size_t iter = 0; iter < cmdBufferCount; iter++) { auto allocation = cmdBufferAllocations[iter]; NEO::EncodeBatchBufferStartOrEnd::programBatchBufferStart(&child, allocation->getGpuAddress(), true); @@ -381,7 +393,7 @@ ze_result_t CommandQueueHw::executeCommandLists( child, POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, fence->getGpuAddress(), Fence::STATE_SIGNALED, - device->getHwInfo(), + hwInfo, args); } } @@ -445,6 +457,33 @@ size_t CommandQueueHw::estimateFrontEndCmdSize() { return NEO::PreambleHelper::getVFECommandsSize(); } +template +size_t CommandQueueHw::estimateFrontEndCmdSizeForMultipleCommandLists( + bool isFrontEndStateDirty, uint32_t numCommandLists, ze_command_list_handle_t *phCommandLists) { + + auto streamPropertiesCopy = streamProperties; + auto singleFrontEndCmdSize = estimateFrontEndCmdSize(); + auto &hwInfo = device->getHwInfo(); + size_t estimatedSize = 0; + + for (size_t i = 0; i < numCommandLists; i++) { + auto commandList = CommandList::fromHandle(phCommandLists[i]); + auto &requiredStreamState = commandList->getRequiredStreamState(); + auto isVfeRequired = streamPropertiesCopy.setCooperativeKernelProperties(requiredStreamState.getCooperativeKernelProperties(), hwInfo); + if (isFrontEndStateDirty) { + isVfeRequired = true; + isFrontEndStateDirty = false; + } + if (isVfeRequired) { + estimatedSize += singleFrontEndCmdSize; + } + auto &finalStreamState = commandList->getFinalStreamState(); + streamPropertiesCopy.setCooperativeKernelProperties(finalStreamState.getCooperativeKernelProperties(), hwInfo); + } + + return estimatedSize; +} + template size_t CommandQueueHw::estimatePipelineSelect() { diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl index 34a45332fd..3c4086e45a 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl @@ -121,4 +121,10 @@ void CommandQueueHw::handleScratchSpace(NEO::ResidencyContainer & } } +template +void CommandQueueHw::patchCommands(CommandList &commandList, uint64_t scratchAddress) { + auto &commandsToPatch = commandList.getCommandsToPatch(); + UNRECOVERABLE_IF(!commandsToPatch.empty()); +} + } // namespace L0 diff --git a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h index 88a9dfa0ce..de4f14d93d 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h @@ -35,14 +35,19 @@ struct WhiteBox<::L0::CommandListCoreFamily> using BaseClass::appendMemoryCopyBlitRegion; using BaseClass::appendSignalEventPostWalker; using BaseClass::applyMemoryRangesBarrier; + using BaseClass::clearCommandsToPatch; using BaseClass::commandListPerThreadScratchSize; using BaseClass::commandListPreemptionMode; + using BaseClass::commandsToPatch; using BaseClass::engineGroupType; + using BaseClass::finalStreamState; using BaseClass::getAlignedAllocation; using BaseClass::getAllocationFromHostPtrMap; using BaseClass::getHostPtrAlloc; using BaseClass::hostPtrMap; using BaseClass::initialize; + using BaseClass::requiredStreamState; + using BaseClass::updateStreamProperties; WhiteBox() : ::L0::CommandListCoreFamily(BaseClass::defaultNumIddsPerBlock) {} }; @@ -55,6 +60,10 @@ struct WhiteBox> : public L0::CommandListCoreFamilyImmediate { using GfxFamily = typename NEO::GfxFamilyMapper::GfxFamily; using BaseClass = L0::CommandListCoreFamilyImmediate; + using BaseClass::clearCommandsToPatch; + using BaseClass::commandsToPatch; + using BaseClass::finalStreamState; + using BaseClass::requiredStreamState; WhiteBox() : BaseClass(BaseClass::defaultNumIddsPerBlock) {} }; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp index b306b9ecc5..da1c653959 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp @@ -1069,6 +1069,37 @@ TEST_F(CommandListCreate, givenQueueDescriptionwhenCreatingImmediateCommandListF } } +HWTEST2_F(CommandListCreate, whenGettingCommandsToPatchThenCorrectValuesAreReturned, Platforms) { + auto commandList = std::make_unique>>(); + EXPECT_EQ(&commandList->requiredStreamState, &commandList->getRequiredStreamState()); + EXPECT_EQ(&commandList->finalStreamState, &commandList->getFinalStreamState()); + EXPECT_EQ(&commandList->commandsToPatch, &commandList->getCommandsToPatch()); +} + +HWTEST2_F(CommandListCreate, givenNonEmptyCommandsToPatchWhenClearCommandsToPatchIsCalledThenCommandsAreCorrectlyCleared, Platforms) { + using VFE_STATE_TYPE = typename FamilyType::VFE_STATE_TYPE; + + auto pCommandList = std::make_unique>>(); + EXPECT_TRUE(pCommandList->commandsToPatch.empty()); + EXPECT_NO_THROW(pCommandList->clearCommandsToPatch()); + EXPECT_TRUE(pCommandList->commandsToPatch.empty()); + + CommandList::CommandToPatch commandToPatch{}; + pCommandList->commandsToPatch.push_back(commandToPatch); + EXPECT_ANY_THROW(pCommandList->clearCommandsToPatch()); + pCommandList->commandsToPatch.clear(); + + commandToPatch.type = CommandList::CommandToPatch::CommandType::FrontEndState; + pCommandList->commandsToPatch.push_back(commandToPatch); + EXPECT_ANY_THROW(pCommandList->clearCommandsToPatch()); + pCommandList->commandsToPatch.clear(); + + commandToPatch.pCommand = new VFE_STATE_TYPE; + pCommandList->commandsToPatch.push_back(commandToPatch); + EXPECT_NO_THROW(pCommandList->clearCommandsToPatch()); + EXPECT_TRUE(pCommandList->commandsToPatch.empty()); +} + using HostPointerManagerCommandListTest = Test; HWTEST2_F(HostPointerManagerCommandListTest, givenImportedHostPointerWhenAppendMemoryFillUsingHostPointerThenAppendFillUsingHostPointerAllocation, diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 7c6a915632..f7a085a2d1 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -924,7 +924,7 @@ inline void CommandStreamReceiverHw::programVFEState(LinearStream &cs auto engineGroupType = hwHelper.getEngineGroupType(getOsContext().getEngineType(), hwInfo); auto pVfeState = PreambleHelper::getSpaceForVfeState(&csr, hwInfo, engineGroupType); StreamProperties streamProperties{}; - streamProperties.setCooperativeKernelProperties(lastKernelExecutionType == KernelExecutionType::Concurrent); + streamProperties.setCooperativeKernelProperties(lastKernelExecutionType == KernelExecutionType::Concurrent, hwInfo); PreambleHelper::programVfeState( pVfeState, hwInfo, requiredScratchSize, getScratchPatchAddress(), maxFrontEndThreads, lastAdditionalKernelExecInfo, streamProperties); diff --git a/shared/source/command_stream/definitions/stream_properties.h b/shared/source/command_stream/definitions/stream_properties.h index 376d9007bf..8af8d9d3b0 100644 --- a/shared/source/command_stream/definitions/stream_properties.h +++ b/shared/source/command_stream/definitions/stream_properties.h @@ -10,9 +10,13 @@ namespace NEO { struct StreamProperties { - bool setCooperativeKernelProperties(bool isCooperative) { + bool setCooperativeKernelProperties(int32_t cooperativeKernelProperties, const HardwareInfo &hwInfo) { return false; } + + int32_t getCooperativeKernelProperties() const { + return -1; + } }; } // namespace NEO diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index a03e64c940..6496fed4a6 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -65,6 +65,7 @@ class HwHelper { virtual bool hvAlign4Required() const = 0; virtual bool isBufferSizeSuitableForRenderCompression(const size_t size) const = 0; virtual bool obtainBlitterPreference(const HardwareInfo &hwInfo) const = 0; + virtual bool isRegularVfeUsed(const HardwareInfo &hwInfo) const = 0; virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0; virtual bool allowRenderCompression(const HardwareInfo &hwInfo) const = 0; virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const = 0; @@ -228,6 +229,8 @@ class HwHelperHw : public HwHelper { bool obtainBlitterPreference(const HardwareInfo &hwInfo) const override; + bool isRegularVfeUsed(const HardwareInfo &hwInfo) const override; + bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) override; bool timestampPacketWriteSupported() const override; diff --git a/shared/source/helpers/hw_helper_bdw_plus.inl b/shared/source/helpers/hw_helper_bdw_plus.inl index 299aa09e20..a2fdc42f9a 100644 --- a/shared/source/helpers/hw_helper_bdw_plus.inl +++ b/shared/source/helpers/hw_helper_bdw_plus.inl @@ -55,6 +55,11 @@ bool HwHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) con return false; } +template +bool HwHelperHw::isRegularVfeUsed(const HardwareInfo &hwInfo) const { + return true; +} + template const HwHelper::EngineInstancesContainer HwHelperHw::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const { return {