diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 93bd86050c..61160119c8 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -1026,7 +1026,7 @@ bool CommandQueue::queueDependenciesClearRequired() const { } bool CommandQueue::blitEnqueueAllowed(const CsrSelectionArgs &args) const { - bool blitEnqueueAllowed = getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() || this->isCopyOnly; + bool blitEnqueueAllowed = device->getRootDeviceEnvironment().getProductHelper().blitEnqueueAllowed() && (getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() || this->isCopyOnly); if (DebugManager.flags.EnableBlitterForEnqueueOperations.get() != -1) { blitEnqueueAllowed = DebugManager.flags.EnableBlitterForEnqueueOperations.get(); } diff --git a/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h index aae310a7c2..9e100eedd8 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h @@ -33,7 +33,7 @@ struct ImageAubFixture : public ClDeviceFixture, public AUBCommandStreamFixture MockExecutionEnvironment mockExecutionEnvironment{}; auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHelper(); - if (!productHelper.isBlitterForImagesSupported()) { + if (!productHelper.isBlitterForImagesSupported() || !productHelper.blitEnqueueAllowed()) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/command_queue/command_queue_fixture.h b/opencl/test/unit_test/command_queue/command_queue_fixture.h index 383703312a..8424cdb612 100644 --- a/opencl/test/unit_test/command_queue/command_queue_fixture.h +++ b/opencl/test/unit_test/command_queue/command_queue_fixture.h @@ -98,6 +98,7 @@ struct CommandQueueHwBlitTest : ClDeviceFixture, ContextFixture, CommandQueueHwF DebugManager.flags.EnableBlitterOperationsSupport.set(1); DebugManager.flags.EnableTimestampPacket.set(1); DebugManager.flags.PreferCopyEngineForCopyBufferToBuffer.set(1); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); ClDeviceFixture::setUpImpl(&hwInfo); cl_device_id device = pClDevice; REQUIRE_FULL_BLITTER_OR_SKIP(pClDevice->getRootDeviceEnvironment()); diff --git a/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp index 9bb31c5f1f..d4785bf50a 100644 --- a/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp @@ -383,6 +383,7 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenEnqueueReadThenEnqueueB DebugManager.flags.DoCpuCopyOnReadBuffer.set(0); DebugManager.flags.SplitBcsMaskD2H.set(0b1010); DebugManager.flags.UpdateTaskCountFromWait.set(3); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); auto memoryManager = static_cast(pDevice->getMemoryManager()); memoryManager->returnFakeAllocation = true; @@ -435,6 +436,7 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyAndD2HMaskWhenEnqueueReadTh DebugManager.flags.DoCpuCopyOnReadBuffer.set(0); DebugManager.flags.SplitBcsMaskD2H.set(0b10); DebugManager.flags.UpdateTaskCountFromWait.set(3); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); auto memoryManager = static_cast(pDevice->getMemoryManager()); memoryManager->returnFakeAllocation = true; @@ -487,6 +489,7 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyAndD2HMaskGreaterThanAvaila DebugManager.flags.DoCpuCopyOnReadBuffer.set(0); DebugManager.flags.SplitBcsMaskD2H.set(0b101010); DebugManager.flags.UpdateTaskCountFromWait.set(3); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); auto memoryManager = static_cast(pDevice->getMemoryManager()); memoryManager->returnFakeAllocation = true; @@ -537,6 +540,7 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenEnqueueWriteThenEnqueue DebugManagerStateRestore restorer; DebugManager.flags.SplitBcsCopy.set(1); DebugManager.flags.DoCpuCopyOnReadBuffer.set(0); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); DebugManager.flags.UpdateTaskCountFromWait.set(3); auto memoryManager = static_cast(pDevice->getMemoryManager()); memoryManager->returnFakeAllocation = true; @@ -806,6 +810,7 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenEnqueueReadWithRequeste DebugManager.flags.DoCpuCopyOnReadBuffer.set(0); DebugManager.flags.UpdateTaskCountFromWait.set(3); DebugManager.flags.SplitBcsMaskD2H.set(0b1010); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); auto memoryManager = static_cast(pDevice->getMemoryManager()); memoryManager->returnFakeAllocation = true; auto cmdQHw = static_cast *>(this->pCmdQ); @@ -962,6 +967,7 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenEnqueueReadWithEventThe DebugManager.flags.SplitBcsMaskD2H.set(0b1010); DebugManager.flags.DoCpuCopyOnReadBuffer.set(0); DebugManager.flags.UpdateTaskCountFromWait.set(3); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); auto memoryManager = static_cast(pDevice->getMemoryManager()); memoryManager->returnFakeAllocation = true; auto cmdQHw = static_cast *>(this->pCmdQ); @@ -1076,6 +1082,7 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenGpgpuCsrWhenEnqueueingBlitAfterFlushedK DebugManagerStateRestore restorer; DebugManager.flags.ForceCacheFlushForBcs.set(0); + DebugManager.flags.EnableBlitterForEnqueueOperations.set(1); MockKernelWithInternals mockKernelWithInternals(*pClDevice); size_t offset = 0; diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index 4c23911cd5..ed805cf003 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -1604,11 +1604,11 @@ TEST(CommandQueue, givenCopyOnlyQueueWhenCallingBlitEnqueueAllowedThenReturnTrue CsrSelectionArgs selectionArgs{CL_COMMAND_READ_BUFFER, &multiAlloc, &multiAlloc, 0u, nullptr}; queue.isCopyOnly = false; - EXPECT_EQ(queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled(), + EXPECT_EQ(queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() && context.getDevice(0)->getProductHelper().blitEnqueueAllowed(), queue.blitEnqueueAllowed(selectionArgs)); queue.isCopyOnly = true; - EXPECT_TRUE(queue.blitEnqueueAllowed(selectionArgs)); + EXPECT_EQ(context.getDevice(0)->getProductHelper().blitEnqueueAllowed(), queue.blitEnqueueAllowed(selectionArgs)); } TEST(CommandQueue, givenSimpleClCommandWhenCallingBlitEnqueueAllowedThenReturnCorrectValue) { @@ -1631,7 +1631,7 @@ TEST(CommandQueue, givenSimpleClCommandWhenCallingBlitEnqueueAllowedThenReturnCo CL_COMMAND_SVM_MEMCPY}) { CsrSelectionArgs args{cmdType, &multiAlloc, &multiAlloc, 0u, nullptr}; - bool expectedValue = queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled(); + bool expectedValue = queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() && context.getDevice(0)->getProductHelper().blitEnqueueAllowed(); if (cmdType == CL_COMMAND_COPY_IMAGE_TO_BUFFER) { expectedValue = false; } diff --git a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp index c05b4e8e57..34a14ed241 100644 --- a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp @@ -162,6 +162,10 @@ HWTEST_F(NoBcsBufferTests, givenProductWithNoFullyBlitterSupportWhenCreatingBuff } HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenEnqueueBufferOperationIsCalledThenUseBcsCsr) { + if (!device->getRootDeviceEnvironment().getProductHelper().blitEnqueueAllowed()) { + GTEST_SKIP(); + } + DebugManager.flags.EnableBlitterForEnqueueOperations.set(0); auto mockCmdQueue = static_cast *>(commandQueue.get()); auto bcsEngine = mockCmdQueue->bcsEngines[0]; diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 0f9ac3c499..ac83ba8a84 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -157,6 +157,7 @@ class ProductHelper { virtual uint32_t getL1CachePolicy(bool isDebuggerActive) const = 0; virtual bool isEvictionIfNecessaryFlagSupported() const = 0; virtual void adjustNumberOfCcs(HardwareInfo &hwInfo) const = 0; + virtual bool blitEnqueueAllowed() const = 0; virtual bool isPrefetcherDisablingInDirectSubmissionRequired() const = 0; virtual bool isStatefulAddressingModeSupported() const = 0; virtual bool isPlatformQuerySupported() const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index f79b60623b..29235af646 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -367,6 +367,11 @@ bool ProductHelperHw::isPageFaultSupported() const { return false; } +template +bool ProductHelperHw::blitEnqueueAllowed() const { + return true; +} + template bool ProductHelperHw::isKmdMigrationSupported() const { return false; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 17c11e359b..c01704ae8b 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -71,6 +71,7 @@ class ProductHelperHw : public ProductHelper { bool isStorageInfoAdjustmentRequired() const override; bool isBlitterForImagesSupported() const override; bool isPageFaultSupported() const override; + bool blitEnqueueAllowed() const override; bool isKmdMigrationSupported() const override; bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const override; bool isDcFlushAllowed() const override; diff --git a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl index 7ae1abbac6..b20c614771 100644 --- a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl +++ b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl @@ -54,6 +54,11 @@ bool ProductHelperHw::isEvictionIfNecessaryFlagSupported() const { return true; } +template <> +bool ProductHelperHw::blitEnqueueAllowed() const { + return false; +} + template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { return aub_stream::ProductFamily::Mtl; diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index 4d90b4a502..4b4badacda 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -415,6 +415,10 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfKmdMigrationIsSupported EXPECT_FALSE(productHelper->isKmdMigrationSupported()); } +HWTEST_F(ProductHelperTest, givenProductHelperWhenCheckBlitEnqueueAllowedThenReturnTrue) { + EXPECT_TRUE(productHelper->blitEnqueueAllowed()); +} + HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned) { EXPECT_TRUE(productHelper->isTile64With3DSurfaceOnBCSSupported(pInHwInfo)); diff --git a/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp index 4c7c957041..4f50b2e63a 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp @@ -21,4 +21,5 @@ HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenR HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse, IGFX_METEORLAKE); HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsAdjustWalkOrderAvailableCallThenFalseReturn, IGFX_METEORLAKE); HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenCheckIsCachingOnCpuAvailableThenAlwaysTrue, IGFX_METEORLAKE); -HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned, IGFX_METEORLAKE); \ No newline at end of file +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned, IGFX_METEORLAKE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenCheckBlitEnqueueAllowedThenReturnTrue, IGFX_METEORLAKE); \ No newline at end of file diff --git a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp index 6deb123350..8e596d2306 100644 --- a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp +++ b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp @@ -211,6 +211,10 @@ HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenGettingEvictIfNecessary EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported()); } +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckBlitEnqueueAllowedThenReturnFalse, IsXeLpg) { + EXPECT_FALSE(productHelper->blitEnqueueAllowed()); +} + HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues, IsXeLpg) { EXPECT_FALSE(productHelper->getScmPropertyThreadArbitrationPolicySupport());