From 4f60771f6514092be6f0d3b42d535686fee96309 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Tue, 13 May 2025 16:03:33 +0000 Subject: [PATCH] refactor: add HP param to blit properties Related-To: NEO-7067 Signed-off-by: Bartosz Dunajski --- level_zero/core/source/cmdlist/cmdlist_hw.h | 1 + level_zero/core/source/cmdlist/cmdlist_hw.inl | 10 ++++++++++ level_zero/core/test/unit_tests/mocks/mock_cmdlist.h | 1 + shared/source/helpers/blit_properties.h | 1 + 4 files changed, 13 insertions(+) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.h b/level_zero/core/source/cmdlist/cmdlist_hw.h index 47b1949f1a..f7bf919bf7 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.h +++ b/level_zero/core/source/cmdlist/cmdlist_hw.h @@ -417,6 +417,7 @@ struct CommandListCoreFamily : public CommandListImp { void setAdditionalKernelLaunchParams(CmdListKernelLaunchParams &launchParams, Kernel &kernel) const; void dispatchInOrderPostOperationBarrier(Event *signalOperation, bool dcFlushRequired, bool copyOperation); NEO::GraphicsAllocation *getDeviceCounterAllocForResidency(NEO::GraphicsAllocation *counterDeviceAlloc); + bool isHighPriorityImmediateCmdList() const; NEO::InOrderPatchCommandsContainer inOrderPatchCmds; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 5dbd6525ec..c9780dab45 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -35,6 +35,7 @@ #include "shared/source/memory_manager/memadvise_flags.h" #include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/unified_memory_manager.h" +#include "shared/source/os_interface/os_context.h" #include "shared/source/page_fault_manager/cpu_page_fault_manager.h" #include "shared/source/program/sync_buffer_handler.h" #include "shared/source/utilities/software_tags_manager.h" @@ -1480,6 +1481,11 @@ ze_result_t CommandListCoreFamily::appendMemoryCopyKernelWithGA(v return CommandListCoreFamily::appendLaunchKernelSplit(builtinKernel, dispatchKernelArgs, signalEvent, launchParams); } +template +bool CommandListCoreFamily::isHighPriorityImmediateCmdList() const { + return (this->isImmediateType() && getCsr(false)->getOsContext().isHighPriority()); +} + template ze_result_t CommandListCoreFamily::appendMemoryCopyBlit(uintptr_t dstPtr, NEO::GraphicsAllocation *dstPtrAlloc, @@ -1494,6 +1500,7 @@ ze_result_t CommandListCoreFamily::appendMemoryCopyBlit(uintptr_t auto clearColorAllocation = device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getClearColorAllocation(); auto blitProperties = NEO::BlitProperties::constructPropertiesForCopy(dstPtrAlloc, srcPtrAlloc, {dstOffset, 0, 0}, {srcOffset, 0, 0}, {size, 0, 0}, 0, 0, 0, 0, clearColorAllocation); blitProperties.computeStreamPartitionCount = this->partitionCount; + blitProperties.highPriority = isHighPriorityImmediateCmdList(); commandContainer.addToResidencyContainer(dstPtrAlloc); commandContainer.addToResidencyContainer(srcPtrAlloc); @@ -1543,6 +1550,7 @@ ze_result_t CommandListCoreFamily::appendMemoryCopyBlitRegion(Ali commandContainer.addToResidencyContainer(clearColorAllocation); blitProperties.computeStreamPartitionCount = this->partitionCount; + blitProperties.highPriority = isHighPriorityImmediateCmdList(); blitProperties.bytesPerPixel = bytesPerPixel; blitProperties.srcSize = srcSize; blitProperties.dstSize = dstSize; @@ -1605,6 +1613,7 @@ ze_result_t CommandListCoreFamily::appendCopyImageBlit(NEO::Graph dstOffsets, srcOffsets, copySize, srcRowPitch, srcSlicePitch, dstRowPitch, dstSlicePitch, clearColorAllocation); blitProperties.computeStreamPartitionCount = this->partitionCount; + blitProperties.highPriority = isHighPriorityImmediateCmdList(); blitProperties.bytesPerPixel = bytesPerPixel; blitProperties.srcSize = srcSize; blitProperties.dstSize = dstSize; @@ -2552,6 +2561,7 @@ ze_result_t CommandListCoreFamily::appendBlitFill(void *ptr, cons setAdditionalBlitProperties(blitProperties, signalEvent, false); } blitProperties.computeStreamPartitionCount = this->partitionCount; + blitProperties.highPriority = isHighPriorityImmediateCmdList(); auto blitResult = NEO::BlitCommandsHelper::dispatchBlitMemoryColorFill(blitProperties, *commandContainer.getCommandStream(), neoDevice->getRootDeviceEnvironmentRef()); if (useAdditionalBlitProperties && this->isInOrderExecutionEnabled()) { 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 c34de62b0b..328568c5e4 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h @@ -189,6 +189,7 @@ struct WhiteBox> using BaseClass::allowCbWaitEventsNoopDispatch; using BaseClass::appendBlitFill; using BaseClass::appendLaunchKernelWithParams; + using BaseClass::appendMemoryCopyBlit; using BaseClass::appendMemoryCopyBlitRegion; using BaseClass::clearCommandsToPatch; using BaseClass::closedCmdList; diff --git a/shared/source/helpers/blit_properties.h b/shared/source/helpers/blit_properties.h index 25d7379836..669415cee6 100644 --- a/shared/source/helpers/blit_properties.h +++ b/shared/source/helpers/blit_properties.h @@ -106,6 +106,7 @@ struct BlitProperties { GMM_YUV_PLANE_ENUM dstPlane = GMM_YUV_PLANE_ENUM::GMM_NO_PLANE; GMM_YUV_PLANE_ENUM srcPlane = GMM_YUV_PLANE_ENUM::GMM_NO_PLANE; bool isSystemMemoryPoolUsed = false; + bool highPriority = false; }; } // namespace NEO