diff --git a/level_zero/core/source/cmdlist/cmdlist.cpp b/level_zero/core/source/cmdlist/cmdlist.cpp index f49e956e74..91178d8f30 100644 --- a/level_zero/core/source/cmdlist/cmdlist.cpp +++ b/level_zero/core/source/cmdlist/cmdlist.cpp @@ -78,17 +78,6 @@ void CommandList::removeHostPtrAllocations() { hostPtrMap.clear(); } -void CommandList::forceDcFlushForDcFlushMitigation() { - if (this->device && this->device->getProductHelper().isDcFlushMitigated()) { - for (const auto &engine : this->device->getNEODevice()->getMemoryManager()->getRegisteredEngines(this->device->getNEODevice()->getRootDeviceIndex())) { - if (engine.commandStreamReceiver->isDirectSubmissionEnabled()) { - engine.commandStreamReceiver->registerDcFlushForDcMitigation(); - engine.commandStreamReceiver->flushTagUpdate(); - } - } - } -} - void CommandList::removeMemoryPrefetchAllocations() { if (this->performMemoryPrefetch) { auto prefetchManager = this->device->getDriverHandle()->getMemoryManager()->getPrefetchManager(); @@ -99,13 +88,6 @@ void CommandList::removeMemoryPrefetchAllocations() { } } -void CommandList::registerCsrDcFlushForDcMitigation(NEO::CommandStreamReceiver &csr) { - if (this->requiresDcFlushForDcMitigation) { - csr.registerDcFlushForDcMitigation(); - this->requiresDcFlushForDcMitigation = false; - } -} - NEO::GraphicsAllocation *CommandList::getAllocationFromHostPtrMap(const void *buffer, uint64_t bufferSize, bool copyOffload) { auto allocation = hostPtrMap.lower_bound(buffer); if (allocation != hostPtrMap.end()) { diff --git a/level_zero/core/source/cmdlist/cmdlist.h b/level_zero/core/source/cmdlist/cmdlist.h index 5d8e3a4e1a..7be5d0c8b7 100644 --- a/level_zero/core/source/cmdlist/cmdlist.h +++ b/level_zero/core/source/cmdlist/cmdlist.h @@ -218,7 +218,6 @@ struct CommandList : _ze_command_list_handle_t { return commandListPerThreadScratchSize[slotId]; } - void forceDcFlushForDcFlushMitigation(); void setAdditionalDispatchKernelArgsFromLaunchParams(NEO::EncodeDispatchKernelArgs &dispatchKernelArgs, const CmdListKernelLaunchParams &launchParams) const; ze_result_t validateLaunchParams(const CmdListKernelLaunchParams &launchParams) const; @@ -430,8 +429,6 @@ struct CommandList : _ze_command_list_handle_t { return wasPending; } - void registerCsrDcFlushForDcMitigation(NEO::CommandStreamReceiver &csr); - NEO::EngineGroupType getEngineGroupType() const { return engineGroupType; } @@ -538,7 +535,6 @@ struct CommandList : _ze_command_list_handle_t { bool heaplessStateInitEnabled = false; bool scratchAddressPatchingEnabled = false; bool taskCountUpdateFenceRequired = false; - bool requiresDcFlushForDcMitigation = false; bool statelessBuiltinsEnabled = false; bool localDispatchSupport = false; bool l3FlushAfterPostSyncRequired = false; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 5611d6c3f9..abe2887345 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -158,8 +158,6 @@ ze_result_t CommandListCoreFamily::reset() { this->inOrderPatchCmds.clear(); - this->forceDcFlushForDcFlushMitigation(); - return ZE_RESULT_SUCCESS; } diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl index 7463fb207b..2fe712d957 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl @@ -505,7 +505,6 @@ inline ze_result_t CommandListCoreFamilyImmediate::executeCommand if (cmdQ->peekIsCopyOnlyCommandQueue()) { completionStamp = flushBcsTask(*commandStream, commandStreamStart, hasStallingCmds, hasRelaxedOrderingDependencies, requireTaskCountUpdate, appendOperation, csr); } else { - this->registerCsrDcFlushForDcMitigation(*csr); completionStamp = (this->*computeFlushMethod)(*commandStream, commandStreamStart, hasStallingCmds, hasRelaxedOrderingDependencies, appendOperation, requireTaskCountUpdate); } diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl index 7544ac4244..d3073d1783 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl @@ -566,10 +566,6 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(K } if (kernelImp->usesRayTracing()) { - if (this->device->getProductHelper().isDcFlushMitigated()) { - this->requiresDcFlushForDcMitigation = true; - } - NEO::PipeControlArgs args{}; args.stateCacheInvalidationEnable = true; NEO::MemorySynchronizationCommands::addSingleBarrier(*commandContainer.getCommandStream(), args); diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index 1a84ec4b3d..57ed966746 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -75,8 +75,6 @@ ze_result_t CommandListImp::destroy() { } } - this->forceDcFlushForDcFlushMitigation(); - delete this; return ZE_RESULT_SUCCESS; } diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index 27b9c83543..9dfec32ca6 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -819,8 +819,6 @@ ze_result_t CommandQueueHw::setupCmdListsAndContextParams( ctx.cmdListScratchAddressPatchingEnabled |= commandList->getCmdListScratchAddressPatchingEnabled(); - commandList->registerCsrDcFlushForDcMitigation(*this->getCsr()); - ctx.spaceForResidency += estimateCommandListResidencySize(commandList); } } @@ -1381,7 +1379,6 @@ void CommandQueueHw::dispatchTaskCountPostSyncRegular( NEO::PipeControlArgs args; args.dcFlushEnable = this->csr->getDcFlushSupport(); - args.dcFlushEnable |= this->csr->checkDcFlushRequiredForDcMitigationAndReset(); args.workloadPartitionOffset = this->partitionCount > 1; args.notifyEnable = this->csr->isUsedNotifyEnableForPostSync(); NEO::MemorySynchronizationCommands::addBarrierWithPostSyncOperation( 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 e63634eb9a..1fa1e36e1b 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h @@ -112,7 +112,6 @@ struct WhiteBox<::L0::CommandListCoreFamily> using BaseClass::pipeControlMultiKernelEventSync; using BaseClass::pipelineSelectStateTracking; using BaseClass::requiredStreamState; - using BaseClass::requiresDcFlushForDcMitigation; using BaseClass::requiresQueueUncachedMocs; using BaseClass::scratchAddressPatchingEnabled; using BaseClass::setAdditionalBlitProperties; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp index ea19c62a1f..193fcd06a1 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp @@ -1630,30 +1630,6 @@ HWTEST2_F(CommandListAppendLaunchRayTracingKernelTest, givenKernelUsingRayTracin EXPECT_EQ(ZE_RESULT_SUCCESS, result); } -HWTEST2_F(CommandListAppendLaunchRayTracingKernelTest, givenDcFlushMitigationWhenAppendLaunchKernelWithRayTracingIsCalledThenRequireDcFlush, RayTracingMatcher) { - VariableBackup rtMemoryBackedBuffer{&neoDevice->rtMemoryBackedBuffer, buffer1}; - - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(0); - - Mock<::L0::KernelImp> kernel; - auto pMockModule = std::unique_ptr(new Mock(device, nullptr)); - kernel.module = pMockModule.get(); - - kernel.setGroupSize(4, 1, 1); - ze_group_count_t groupCount{8, 1, 1}; - auto pCommandList = std::make_unique>>(); - auto result = pCommandList->initialize(device, NEO::EngineGroupType::compute, 0); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - kernel.immutableData.kernelDescriptor->kernelAttributes.flags.hasRTCalls = true; - CmdListKernelLaunchParams launchParams = {}; - - result = pCommandList->appendLaunchKernel(kernel.toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - EXPECT_EQ(pCommandList->requiresDcFlushForDcMitigation, device->getProductHelper().isDcFlushMitigated()); -} - using RayTracingCmdListTest = Test; template @@ -1773,28 +1749,6 @@ HWTEST2_F(RayTracingCmdListTest, ultCsr->isMadeResident(rtAllocation, residentCount); } -HWTEST2_F(RayTracingCmdListTest, - givenDcFlushMitigationWhenRegularAppendLaunchKernelAndExecuteThenRegisterDcFlushForDcFlushMitigation, - RayTracingMatcher) { - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(0); - - auto ultCsr = static_cast *>(commandQueue->getCsr()); - - ze_group_count_t groupCount{1, 1, 1}; - CmdListKernelLaunchParams launchParams = {}; - auto result = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - result = commandList->close(); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - - ze_command_list_handle_t cmdListHandle = commandList->toHandle(); - result = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, true, nullptr, nullptr); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - - EXPECT_EQ(ultCsr->registeredDcFlushForDcFlushMitigation, device->getProductHelper().isDcFlushMitigated()); -} - HWTEST2_F(RayTracingCmdListTest, givenRayTracingKernelWhenRegularCmdListExecutedAndImmediateExecutedAgainThenDispatch3dBtdCommandOnceMakeResidentTwiceAndPipeControlWithStateCacheFlushAfterWalker, RayTracingMatcher) { @@ -1899,22 +1853,6 @@ HWTEST2_F(RayTracingCmdListTest, ultCsr->isMadeResident(rtAllocation, residentCount); } -HWTEST2_F(RayTracingCmdListTest, - givenDcFlushMitigationWhenImmediateAppendLaunchKernelThenRegisterDcFlushForDcFlushMitigation, - RayTracingMatcher) { - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(0); - - commandListImmediate->isSyncModeQueue = true; - auto ultCsr = static_cast *>(commandQueue->getCsr()); - - ze_group_count_t groupCount{1, 1, 1}; - CmdListKernelLaunchParams launchParams = {}; - auto result = commandListImmediate->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - EXPECT_EQ(ultCsr->registeredDcFlushForDcFlushMitigation, device->getProductHelper().isDcFlushMitigated()); -} - HWTEST2_F(RayTracingCmdListTest, givenRayTracingKernelWhenImmediateCmdListExecutedAndRegularExecutedAgainThenDispatch3dBtdCommandOnceMakeResidentTwiceAndPipeControlWithStateCacheFlushAfterWalker, RayTracingMatcher) { diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 6f5af5e65f..3112fc76a6 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -672,8 +672,7 @@ cl_int CommandQueue::enqueueReleaseSharedObjects(cl_uint numObjects, const cl_me } if (this->getGpgpuCommandStreamReceiver().isDirectSubmissionEnabled()) { - if (this->getDevice().getProductHelper().isDcFlushMitigated() || isDisplayableReleased) { - this->getGpgpuCommandStreamReceiver().registerDcFlushForDcMitigation(); + if (isDisplayableReleased) { this->getGpgpuCommandStreamReceiver().sendRenderStateCacheFlush(); { TakeOwnershipWrapper queueOwnership(*this); diff --git a/opencl/source/context/context.cpp b/opencl/source/context/context.cpp index 38278bb7ce..6e07306386 100644 --- a/opencl/source/context/context.cpp +++ b/opencl/source/context/context.cpp @@ -682,16 +682,6 @@ Buffer *Context::BufferPoolAllocator::allocateBufferFromPool(const MemoryPropert bufferFromPool = this->allocateFromPools(memoryProperties, flags, flagsIntel, requestedSize, hostPtr, errcodeRet); if (bufferFromPool != nullptr) { - for (const auto rootDeviceIndex : this->context->getRootDeviceIndices()) { - auto cmdQ = this->context->getSpecialQueue(rootDeviceIndex); - if (cmdQ->getDevice().getProductHelper().isDcFlushMitigated()) { - auto &csr = cmdQ->getGpgpuCommandStreamReceiver(); - auto lock = csr.obtainUniqueOwnership(); - csr.registerDcFlushForDcMitigation(); - csr.flushTagUpdate(); - } - } - return bufferFromPool; } diff --git a/opencl/source/dll/command_queue_dll.cpp b/opencl/source/dll/command_queue_dll.cpp index 1d86c9ff3d..07099c625d 100644 --- a/opencl/source/dll/command_queue_dll.cpp +++ b/opencl/source/dll/command_queue_dll.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,8 +17,4 @@ bool CommandQueue::isTimestampWaitEnabled() { return true; } -bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type) { - return type != AllocationType::bufferHostMemory; -} - } // namespace NEO diff --git a/opencl/source/mem_obj/buffer.cpp b/opencl/source/mem_obj/buffer.cpp index 8116c56a9a..3736e8393e 100644 --- a/opencl/source/mem_obj/buffer.cpp +++ b/opencl/source/mem_obj/buffer.cpp @@ -204,8 +204,6 @@ Buffer *Buffer::create(Context *context, flags, 0, size, hostPtr, bufferCreateArgs, errcodeRet); } -extern bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type); - bool inline copyHostPointer(Buffer *buffer, Device &device, size_t size, @@ -217,8 +215,7 @@ bool inline copyHostPointer(Buffer *buffer, auto memory = buffer->getGraphicsAllocation(rootDeviceIndex); auto isCompressionEnabled = memory->isCompressionEnabled(); const bool isLocalMemory = !MemoryPoolHelper::isSystemMemoryPool(memory->getMemoryPool()); - const bool isGpuCopyRequiredForDcFlushMitigation = productHelper.isDcFlushMitigated() && checkIsGpuCopyRequiredForDcFlushMitigation(memory->getAllocationType()); - const bool gpuCopyRequired = isCompressionEnabled || isLocalMemory || isGpuCopyRequiredForDcFlushMitigation; + const bool gpuCopyRequired = isCompressionEnabled || isLocalMemory; if (gpuCopyRequired) { auto &hwInfo = device.getHardwareInfo(); @@ -241,14 +238,11 @@ bool inline copyHostPointer(Buffer *buffer, memory->setAubWritable(true, GraphicsAllocation::defaultBank); memory->setTbxWritable(true, GraphicsAllocation::defaultBank); memcpy_s(ptrOffset(lockedPointer, buffer->getOffset()), size, hostPtr, size); - if (isGpuCopyRequiredForDcFlushMitigation) { - CpuIntrinsics::sfence(); - } return true; } else { auto blitMemoryToAllocationResult = BlitOperationResult::unsupported; - if (productHelper.isBlitterFullySupported(hwInfo) && (isLocalMemory || isGpuCopyRequiredForDcFlushMitigation)) { + if (productHelper.isBlitterFullySupported(hwInfo) && isLocalMemory) { device.stopDirectSubmissionForCopyEngine(); blitMemoryToAllocationResult = BlitHelperFunctions::blitMemoryToAllocation(device, memory, buffer->getOffset(), hostPtr, {size, 1, 1}); } diff --git a/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h b/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h index 54c8b78e06..ada2c45c93 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h +++ b/opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and_later.h @@ -403,7 +403,7 @@ void CopyEngineXeHPAndLater::givenSrcCompressedBuffer template template void CopyEngineXeHPAndLater::givenCompressedBufferWhenAuxTranslationCalledThenResolveAndCompressImpl() { - if ((this->context->getDevice(0u)->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities > 0) || !compressionSupported() || this->context->getDevice(0u)->getProductHelper().isDcFlushMitigated()) { + if ((this->context->getDevice(0u)->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities > 0) || !compressionSupported()) { // no support for scenarios where stateless is mixed with blitter compression GTEST_SKIP(); } diff --git a/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp index c1a20320c7..56dbff91dd 100644 --- a/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_hw_1_tests.cpp @@ -1501,7 +1501,6 @@ HWTEST_F(CommandQueueHwTest, givenDirectSubmissionAndSharedDisplayableImageWhenR result = mockCmdQueueHw.enqueueReleaseSharedObjects(numObjects, memObjects, 0, nullptr, nullptr, 0); EXPECT_EQ(result, CL_SUCCESS); EXPECT_TRUE(ultCsr.renderStateCacheFlushed); - EXPECT_TRUE(ultCsr.renderStateCacheDcFlushForced); EXPECT_EQ(finishCalledBefore + 1u, mockCmdQueueHw.finishCalledCount); EXPECT_EQ(taskCountBefore + 1u, mockCmdQueueHw.taskCount); } \ No newline at end of file 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 c5bd446f0c..385d383e49 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -1391,38 +1391,6 @@ HWTEST_F(CommandQueueTests, givenDirectSubmissionAndSharedImageWhenReleasingShar result = cmdQ.enqueueReleaseSharedObjects(numObjects, memObjects, 0, nullptr, nullptr, 0); EXPECT_EQ(result, CL_SUCCESS); EXPECT_TRUE(ultCsr->renderStateCacheFlushed); - EXPECT_EQ(ultCsr->renderStateCacheDcFlushForced, context.getDevice(0)->getProductHelper().isDcFlushMitigated()); -} - -HWTEST_F(CommandQueueTests, givenDcFlushMitigationAndDirectSubmissionAndBufferWhenReleasingSharedObjectThenFlushRenderStateCacheAndForceDcFlush) { - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(0); - - MockContext context; - MockCommandQueue cmdQ(&context, context.getDevice(0), 0, false); - MockSharingHandler *mockSharingHandler = new MockSharingHandler; - - auto buffer = std::unique_ptr(BufferHelper<>::create(&context)); - buffer->setSharingHandler(mockSharingHandler); - buffer->getGraphicsAllocation(0u)->setAllocationType(AllocationType::sharedBuffer); - - cl_mem memObject = buffer.get(); - cl_uint numObjects = 1; - cl_mem *memObjects = &memObject; - - cl_int result = cmdQ.enqueueAcquireSharedObjects(numObjects, memObjects, 0, nullptr, nullptr, 0); - EXPECT_EQ(result, CL_SUCCESS); - - auto ultCsr = static_cast *>(&cmdQ.getGpgpuCommandStreamReceiver()); - ultCsr->directSubmissionAvailable = true; - ultCsr->callBaseSendRenderStateCacheFlush = false; - ultCsr->flushReturnValue = SubmissionStatus::success; - EXPECT_FALSE(ultCsr->renderStateCacheFlushed); - - result = cmdQ.enqueueReleaseSharedObjects(numObjects, memObjects, 0, nullptr, nullptr, 0); - EXPECT_EQ(result, CL_SUCCESS); - EXPECT_EQ(ultCsr->renderStateCacheFlushed, context.getDevice(0)->getProductHelper().isDcFlushMitigated()); - EXPECT_EQ(ultCsr->renderStateCacheDcFlushForced, context.getDevice(0)->getProductHelper().isDcFlushMitigated()); } TEST(CommandQueue, givenEnqueuesForSharedObjectsWithImageWhenUsingSharingHandlerWithEventThenReturnSuccess) { diff --git a/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp index 5beaa1f048..2f123fa3e0 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_enqueue_tests.cpp @@ -525,7 +525,7 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueMapBufferIsCal EXPECT_EQ(zeroCopyBuffer, containsHint(expectedHint, userData)); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[CL_ENQUEUE_MAP_BUFFER_REQUIRES_COPY_DATA], static_cast(buffer)); - EXPECT_EQ(!zeroCopyBuffer && !pCmdQ->getDevice().getProductHelper().isDcFlushMitigated(), containsHint(expectedHint, userData)); + EXPECT_EQ(!zeroCopyBuffer, containsHint(expectedHint, userData)); alignedFree(address); delete buffer; @@ -555,7 +555,7 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagAndBlockingEventWhenEnque EXPECT_EQ(zeroCopyBuffer, containsHint(expectedHint, userData)); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[CL_ENQUEUE_MAP_BUFFER_REQUIRES_COPY_DATA], static_cast(buffer.get())); - EXPECT_EQ(!zeroCopyBuffer && !pCmdQ->getDevice().getProductHelper().isDcFlushMitigated(), containsHint(expectedHint, userData)); + EXPECT_EQ(!zeroCopyBuffer, containsHint(expectedHint, userData)); alignedFree(address); } @@ -653,7 +653,7 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueUnmapIsCalling pCmdQ->enqueueUnmapMemObject(buffer, mapPtr, 0, nullptr, nullptr); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[CL_ENQUEUE_UNMAP_MEM_OBJ_REQUIRES_COPY_DATA], mapPtr, static_cast(buffer)); - EXPECT_EQ(!zeroCopyBuffer && !pCmdQ->getDevice().getProductHelper().isDcFlushMitigated(), containsHint(expectedHint, userData)); + EXPECT_EQ(!zeroCopyBuffer, containsHint(expectedHint, userData)); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[CL_ENQUEUE_UNMAP_MEM_OBJ_DOESNT_REQUIRE_COPY_DATA], mapPtr); EXPECT_EQ(zeroCopyBuffer, containsHint(expectedHint, userData)); @@ -685,7 +685,7 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyAndBlockedEventFlagWhenEnqueu EXPECT_FALSE(pCmdQ->isQueueBlocked()); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[CL_ENQUEUE_UNMAP_MEM_OBJ_REQUIRES_COPY_DATA], mapPtr, static_cast(buffer.get())); - EXPECT_EQ(!zeroCopyBuffer && !pCmdQ->getDevice().getProductHelper().isDcFlushMitigated(), containsHint(expectedHint, userData)); + EXPECT_EQ(!zeroCopyBuffer, containsHint(expectedHint, userData)); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[CL_ENQUEUE_UNMAP_MEM_OBJ_DOESNT_REQUIRE_COPY_DATA], mapPtr); EXPECT_EQ(zeroCopyBuffer, containsHint(expectedHint, userData)); diff --git a/opencl/test/unit_test/libult/command_queue_ult.cpp b/opencl/test/unit_test/libult/command_queue_ult.cpp index 1975a381bc..1f08494dfb 100644 --- a/opencl/test/unit_test/libult/command_queue_ult.cpp +++ b/opencl/test/unit_test/libult/command_queue_ult.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,8 +19,4 @@ bool CommandQueue::isTimestampWaitEnabled() { return ultHwConfig.useWaitForTimestamps; } -bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type) { - return ultHwConfig.useGpuCopyForDcFlushMitigation; -} - } // namespace NEO \ No newline at end of file diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index c05bc5f185..1df2383d98 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -598,53 +598,6 @@ TEST(Buffer, givenClMemCopyHostPointerPassedToBufferCreateWhenAllocationIsNotInS } } -namespace CpuIntrinsicsTests { -extern std::atomic sfenceCounter; -} // namespace CpuIntrinsicsTests - -TEST(Buffer, givenDcFlushMitigationWhenCreateBufferCopyHostptrThenUseMemcpy) { - ExecutionEnvironment *executionEnvironment = MockClDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u); - executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; - auto productHelper = executionEnvironment->rootDeviceEnvironments[0]->productHelper.get(); - if (!productHelper->isDcFlushMitigated()) { - GTEST_SKIP(); - } - - auto blitterCalled = 0u; - auto mockBlitMemoryToAllocation = [&](const NEO::Device &device, NEO::GraphicsAllocation *memory, size_t offset, const void *hostPtr, - Vec3 size) -> NEO::BlitOperationResult { - blitterCalled++; - return BlitOperationResult::success; - }; - - VariableBackup blitMemoryToAllocationFuncBackup(&NEO::BlitHelperFunctions::blitMemoryToAllocation, mockBlitMemoryToAllocation); - VariableBackup backup(&ultHwConfig); - ultHwConfig.useGpuCopyForDcFlushMitigation = true; - - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(0); - - auto *memoryManager = new MockMemoryManagerFailFirstAllocation(*executionEnvironment); - executionEnvironment->memoryManager.reset(memoryManager); - memoryManager->returnBaseAllocateGraphicsMemoryInDevicePool = true; - auto device = std::make_unique(MockDevice::create(executionEnvironment, 0)); - - MockContext ctx(device.get()); - CpuIntrinsicsTests::sfenceCounter.store(0u); - - cl_int retVal = 0; - cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR; - char memory[] = {1, 2, 3, 4, 5, 6, 7, 8}; - - std::unique_ptr buffer(Buffer::create(&ctx, flags, sizeof(memory), memory, retVal)); - - ASSERT_NE(nullptr, buffer.get()); - EXPECT_EQ(blitterCalled, 0u); - EXPECT_EQ(ctx.getSpecialQueue(0)->taskCount, 0u); - EXPECT_EQ(1u, CpuIntrinsicsTests::sfenceCounter.load()); - CpuIntrinsicsTests::sfenceCounter.store(0u); -} - TEST(Buffer, givenPropertiesWithClDeviceHandleListKHRWhenCreateBufferThenCorrectBufferIsSet) { MockDefaultContext context; auto clDevice = context.getDevice(1); @@ -1945,10 +1898,6 @@ HWTEST_F(BufferCreateTests, givenClMemCopyHostPointerPassedToBufferCreateWhenAll auto memoryManager = new MockMemoryManager(true, *executionEnvironment); executionEnvironment->memoryManager.reset(memoryManager); - if (executionEnvironment->rootDeviceEnvironments[0]->getProductHelper().isDcFlushMitigated()) { - debugManager.flags.AllowDcFlush.set(1); - } - MockClDevice device(new MockDevice(executionEnvironment, mockRootDeviceIndex)); ASSERT_TRUE(device.createEngines()); DeviceFactory::prepareDeviceEnvironments(*device.getExecutionEnvironment()); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests_pvc_and_later.cpp b/opencl/test/unit_test/mem_obj/buffer_tests_pvc_and_later.cpp index 91d3d0ceb1..13560f5367 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests_pvc_and_later.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests_pvc_and_later.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -115,10 +115,6 @@ HWTEST2_F(PvcAndLaterBufferTests, givenCompressedBufferInSystemAndBlitterSupport auto pDevice = deviceFactory.rootDevices[0]; auto pMockContext = std::make_unique(pDevice); - if (pDevice->getProductHelper().isDcFlushMitigated()) { - debugManager.flags.AllowDcFlush.set(1); - } - static_cast(pDevice->getExecutionEnvironment()->memoryManager.get())->enable64kbpages[0] = true; static_cast(pDevice->getExecutionEnvironment()->memoryManager.get())->localMemorySupported[0] = false; diff --git a/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp b/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp index ad2d91b206..d0d55a21fa 100644 --- a/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp +++ b/opencl/test/unit_test/mem_obj/windows/buffer_windows_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -150,10 +150,6 @@ HWTEST_F(BufferCreateWindowsTests, givenClMemCopyHostPointerPassedToBufferCreate auto memoryManager = new MockMemoryManager(true, *executionEnvironment); executionEnvironment->memoryManager.reset(memoryManager); - if (executionEnvironment->rootDeviceEnvironments[0]->getProductHelper().isDcFlushMitigated()) { - debugManager.flags.AllowDcFlush.set(1); - } - MockClDevice device(new MockDevice(executionEnvironment, mockRootDeviceIndex)); ASSERT_TRUE(device.createEngines()); DeviceFactory::prepareDeviceEnvironments(*device.getExecutionEnvironment()); diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp index 258e271046..c02fc6344f 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -570,9 +570,6 @@ void CommandContainer::storeAllocationAndFlushTagUpdate(GraphicsAllocation *allo } else { getHeapHelper()->storeHeapAllocation(allocation); } - if (device->getProductHelper().isDcFlushMitigated()) { - this->immediateCmdListCsr->registerDcFlushForDcMitigation(); - } this->immediateCmdListCsr->flushTagUpdate(); } diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 3f19f0cbf3..89101fdf1a 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -696,10 +696,6 @@ IndirectHeap &CommandStreamReceiver::getIndirectHeap(IndirectHeap::Type heapType internalAllocationStorage->storeAllocation(std::unique_ptr(heapMemory), REUSABLE_ALLOCATION); heapMemory = nullptr; this->heapStorageRequiresRecyclingTag = true; - - if (this->peekRootDeviceEnvironment().getProductHelper().isDcFlushMitigated()) { - this->registerDcFlushForDcMitigation(); - } } if (!heapMemory) { diff --git a/shared/source/command_stream/command_stream_receiver.h b/shared/source/command_stream/command_stream_receiver.h index d7ac6d83ab..62112cecfe 100644 --- a/shared/source/command_stream/command_stream_receiver.h +++ b/shared/source/command_stream/command_stream_receiver.h @@ -349,16 +349,6 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass { requiresInstructionCacheFlush = true; } - MOCKABLE_VIRTUAL bool checkDcFlushRequiredForDcMitigationAndReset() { - auto ret = this->requiresDcFlush; - this->requiresDcFlush = false; - return ret; - } - - void registerDcFlushForDcMitigation() { - this->requiresDcFlush = true; - } - bool isLocalMemoryEnabled() const { return localMemoryEnabled; } uint32_t getRootDeviceIndex() const { return rootDeviceIndex; } 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 460df7de1a..71a7145827 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -1224,7 +1224,7 @@ SubmissionStatus CommandStreamReceiverHw::flushPipeControl(bool state auto lock = obtainUniqueOwnership(); PipeControlArgs args; - args.dcFlushEnable = this->dcFlushSupport || this->checkDcFlushRequiredForDcMitigationAndReset(); + args.dcFlushEnable = this->dcFlushSupport; args.notifyEnable = isUsedNotifyEnableForPostSync(); args.workloadPartitionOffset = isMultiTileOperationEnabled(); @@ -1850,7 +1850,6 @@ inline void CommandStreamReceiverHw::processBarrierWithPostSync(Linea auto &rootDeviceEnvironment = this->peekRootDeviceEnvironment(); args.dcFlushEnable = getDcFlushRequired(dispatchFlags.dcFlush); - args.dcFlushEnable |= this->checkDcFlushRequiredForDcMitigationAndReset(); args.notifyEnable = isUsedNotifyEnableForPostSync(); args.tlbInvalidation |= dispatchFlags.memoryMigrationRequired; args.textureCacheInvalidationEnable |= dispatchFlags.textureCacheFlush || this->heapStorageRequiresRecyclingTag; @@ -2225,7 +2224,6 @@ void CommandStreamReceiverHw::dispatchImmediateFlushClientBufferComma PipeControlArgs args = {}; args.dcFlushEnable = this->dcFlushSupport; - args.dcFlushEnable |= this->checkDcFlushRequiredForDcMitigationAndReset(); args.notifyEnable = isUsedNotifyEnableForPostSync(); args.workloadPartitionOffset = isMultiTileOperationEnabled(); MemorySynchronizationCommands::addBarrierWithPostSyncOperation( diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index a1c4f3ae53..e90f4f1d66 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -229,8 +229,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverridePatIndexForSystemMemory, -1, "-1: defaul DECLARE_DEBUG_VARIABLE(int32_t, OverridePatIndexForDeviceMemory, -1, "-1: default, >=0: PatIndex to override. Applicable only for Device memory.") DECLARE_DEBUG_VARIABLE(int32_t, OverridePatIndexForUncachedTypes, -1, "-1: default, >=0: PatIndex to override for uncached resource types. Applicable only on Linux.") DECLARE_DEBUG_VARIABLE(int32_t, OverridePatIndexForCachedTypes, -1, "-1: default, >=0: PatIndex to override for cached resource types. Applicable only on Linux.") -DECLARE_DEBUG_VARIABLE(int32_t, OverrideReadWritePatForDcFlushMitigation, -1, "-1: default, >=0: PatIndex to override for read write resources when mitigating dc flush") -DECLARE_DEBUG_VARIABLE(int32_t, OverrideWriteOnlyPatForDcFlushMitigation, -1, "-1: default, >=0: PatIndex to override for write only resources when mitigating dc flush") DECLARE_DEBUG_VARIABLE(int32_t, UseGemCreateExtInAllocateMemoryByKMD, -1, "Use gem create ext when allocating memory by KMD") DECLARE_DEBUG_VARIABLE(int32_t, UseTileMemoryBankInVirtualMemoryCreation, -1, "-1: default - on, 0: do not assign tile memory bank to virtual memory space, 1: assign tile memory bank to virtual memory space") DECLARE_DEBUG_VARIABLE(int32_t, OverrideTimestampEvents, -1, "-1: default (based on user settings), 0: Force disable timestamp events (no timestamps will be reported), 1: Force enable timestamp events") diff --git a/shared/source/gmm_helper/cache_settings_helper.cpp b/shared/source/gmm_helper/cache_settings_helper.cpp index 2c1fbc7105..f11f974608 100644 --- a/shared/source/gmm_helper/cache_settings_helper.cpp +++ b/shared/source/gmm_helper/cache_settings_helper.cpp @@ -48,10 +48,6 @@ bool CacheSettingsHelper::preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmReso } GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper, const HardwareInfo *hwInfo) { - if (productHelper.overrideUsageForDcFlushMitigation(allocationType)) { - return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper); - } - if (debugManager.flags.ForceGmmSystemMemoryBufferForAllocations.get()) { UNRECOVERABLE_IF(allocationType == AllocationType::unknown); if ((1llu << (static_cast(allocationType))) & debugManager.flags.ForceGmmSystemMemoryBufferForAllocations.get()) { diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index cbe003d2ce..22c3adc290 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -2062,10 +2062,6 @@ inline std::unique_ptr DrmMemoryManager::makeGmmIfSingleHandle(const Alloca gmmRequirements.overriderCacheable.enableOverride = true; gmmRequirements.overriderCacheable.value = true; } - if (productHelper.overrideCacheableForDcFlushMitigation(allocationData.type)) { - gmmRequirements.overriderPreferNoCpuAccess.enableOverride = true; - gmmRequirements.overriderPreferNoCpuAccess.value = false; - } return std::make_unique(gmmHelper, nullptr, diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index fd2293562b..15330a5f43 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -132,12 +132,6 @@ class ProductHelper { virtual bool isPrimaryContextsAggregationSupported() const = 0; virtual bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isDcFlushAllowed() const = 0; - virtual bool isDcFlushMitigated() const = 0; - virtual bool mitigateDcFlush() const = 0; - virtual bool overrideUsageForDcFlushMitigation(AllocationType allocationType) const = 0; - virtual bool overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const = 0; - virtual bool overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const = 0; - virtual bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const = 0; virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0; virtual bool getUuid(NEO::DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array &uuid) const = 0; virtual bool isFlushTaskAllowed() const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index bd9890c654..7203a35c5e 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -442,7 +442,7 @@ bool ProductHelperHw::isPrimaryContextsAggregationSupported() const template bool ProductHelperHw::isDcFlushAllowed() const { using GfxProduct = typename HwMapper::GfxProduct; - bool dcFlushAllowed = GfxProduct::isDcFlushAllowed && !this->mitigateDcFlush(); + bool dcFlushAllowed = GfxProduct::isDcFlushAllowed; if (debugManager.flags.AllowDcFlush.get() != -1) { dcFlushAllowed = debugManager.flags.AllowDcFlush.get(); @@ -451,51 +451,6 @@ bool ProductHelperHw::isDcFlushAllowed() const { return dcFlushAllowed; } -template -bool ProductHelperHw::mitigateDcFlush() const { - return false; -} - -template -bool ProductHelperHw::isDcFlushMitigated() const { - using GfxProduct = typename HwMapper::GfxProduct; - bool dcFlushAllowed = GfxProduct::isDcFlushAllowed; - return this->isDcFlushAllowed() != dcFlushAllowed; -} - -template -bool ProductHelperHw::overrideUsageForDcFlushMitigation(AllocationType allocationType) const { - return this->isDcFlushMitigated() && (this->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType) || overridePatToUCAndOneWayCohForDcFlushMitigation(allocationType)); -} - -template -bool ProductHelperHw::overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const { - return this->isDcFlushMitigated() && - (this->overrideCacheableForDcFlushMitigation(allocationType) || - allocationType == AllocationType::timestampPacketTagBuffer || - allocationType == AllocationType::tagBuffer || - allocationType == AllocationType::gpuTimestampDeviceBuffer); -} - -template -bool ProductHelperHw::overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const { - return this->isDcFlushMitigated() && - (allocationType == AllocationType::internalHeap || - allocationType == AllocationType::linearStream); -} - -template -bool ProductHelperHw::overrideCacheableForDcFlushMitigation(AllocationType allocationType) const { - return this->isDcFlushMitigated() && - (allocationType == AllocationType::externalHostPtr || - allocationType == AllocationType::bufferHostMemory || - allocationType == AllocationType::mapAllocation || - allocationType == AllocationType::svmCpu || - allocationType == AllocationType::svmZeroCopy || - allocationType == AllocationType::internalHostMemory || - allocationType == AllocationType::printfSurface); -} - template uint32_t ProductHelperHw::computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const { return hwInfo.gtSystemInfo.MaxSubSlicesSupported; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index dd7effb052..363c2ffac8 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -73,12 +73,6 @@ class ProductHelperHw : public ProductHelper { bool isPrimaryContextsAggregationSupported() const override; bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const override; bool isDcFlushAllowed() const override; - bool isDcFlushMitigated() const override; - bool mitigateDcFlush() const override; - bool overrideUsageForDcFlushMitigation(AllocationType allocationType) const override; - bool overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const override; - bool overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const override; - bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const override; uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override; bool getUuid(NEO::DriverModel *driverModel, uint32_t subDeviceCount, uint32_t deviceIndex, std::array &uuid) const override; bool isFlushTaskAllowed() const override; diff --git a/shared/source/os_interface/windows/wddm_memory_manager.cpp b/shared/source/os_interface/windows/wddm_memory_manager.cpp index 3ba853279c..0676c4e2e1 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -241,10 +241,6 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryUsingKmdAndMapItToC gmmRequirements.overriderCacheable.enableOverride = true; gmmRequirements.overriderCacheable.value = true; } - if (productHelper.overrideCacheableForDcFlushMitigation(allocationData.type)) { - gmmRequirements.overriderPreferNoCpuAccess.enableOverride = true; - gmmRequirements.overriderPreferNoCpuAccess.value = false; - } auto gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), nullptr, sizeAligned, 0u, @@ -471,10 +467,6 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(co gmmRequirements.overriderCacheable.enableOverride = true; gmmRequirements.overriderCacheable.value = true; } - if (productHelper.overrideCacheableForDcFlushMitigation(allocationData.type)) { - gmmRequirements.overriderPreferNoCpuAccess.enableOverride = true; - gmmRequirements.overriderPreferNoCpuAccess.value = false; - } auto gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), alignedPtr, alignedSize, 0u, CacheSettingsHelper::getGmmUsageTypeForUserPtr(allocationData.flags.flushL3, allocationData.hostPtr, allocationData.size, productHelper), {}, gmmRequirements); diff --git a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl index ea45ccbf6b..557ab6100a 100644 --- a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl +++ b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl @@ -15,7 +15,7 @@ namespace NEO { template <> bool ProductHelperHw::overrideAllocationCpuCacheable(const AllocationData &allocationData) const { - return GraphicsAllocation::isAccessedFromCommandStreamer(allocationData.type) || this->overrideCacheableForDcFlushMitigation(allocationData.type); + return GraphicsAllocation::isAccessedFromCommandStreamer(allocationData.type); } template <> diff --git a/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp b/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp index 001ba11e8d..3d56e05a06 100644 --- a/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp +++ b/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp @@ -16,27 +16,6 @@ constexpr static auto gfxProduct = IGFX_LUNARLAKE; namespace NEO { -template <> -uint64_t ProductHelperHw::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const { - if (this->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType)) { - if (debugManager.flags.OverrideReadWritePatForDcFlushMitigation.get() != -1) { - return debugManager.flags.OverrideReadWritePatForDcFlushMitigation.get(); - } - - return 2; // L3: WB, L4: UC, 2-Way coh - } - - if (this->overridePatToUCAndOneWayCohForDcFlushMitigation(allocationType)) { - if (debugManager.flags.OverrideWriteOnlyPatForDcFlushMitigation.get() != -1) { - return debugManager.flags.OverrideWriteOnlyPatForDcFlushMitigation.get(); - } - - return 1; // L3: WB, L4: UC, 1-Way coh - } - - return patIndex; -} - template <> bool ProductHelperHw::restartDirectSubmissionForHostptrFree() const { return true; diff --git a/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl b/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl index a384b1756a..7aed166da9 100644 --- a/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl +++ b/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl @@ -11,7 +11,7 @@ namespace NEO { template <> bool ProductHelperHw::overrideAllocationCpuCacheable(const AllocationData &allocationData) const { - return GraphicsAllocation::isAccessedFromCommandStreamer(allocationData.type) || this->overrideCacheableForDcFlushMitigation(allocationData.type); + return GraphicsAllocation::isAccessedFromCommandStreamer(allocationData.type); } template <> diff --git a/shared/test/common/base_ult_config_listener.cpp b/shared/test/common/base_ult_config_listener.cpp index aefa1d2095..203abc97dd 100644 --- a/shared/test/common/base_ult_config_listener.cpp +++ b/shared/test/common/base_ult_config_listener.cpp @@ -58,7 +58,7 @@ void BaseUltConfigListener::OnTestEnd(const ::testing::TestInfo &) { // Ensure that global state is restored UltHwConfig expectedState{}; - static_assert(sizeof(UltHwConfig) == (17 * sizeof(bool) + sizeof(const char *) + sizeof(ExecutionEnvironment *) + sizeof(UltHwConfig::padding)), ""); // Ensure that there is no internal padding + static_assert(sizeof(UltHwConfig) == (16 * sizeof(bool) + sizeof(const char *) + sizeof(ExecutionEnvironment *)), ""); // Ensure that there is no internal padding EXPECT_EQ(0, memcmp(&expectedState, &ultHwConfig, sizeof(UltHwConfig))); EXPECT_EQ(0, memcmp(&referencedHwInfo.platform, &defaultHwInfo->platform, sizeof(PLATFORM))); diff --git a/shared/test/common/helpers/ult_hw_config.h b/shared/test/common/helpers/ult_hw_config.h index e5af3d23c2..5f7f29036a 100644 --- a/shared/test/common/helpers/ult_hw_config.h +++ b/shared/test/common/helpers/ult_hw_config.h @@ -25,7 +25,6 @@ struct UltHwConfig { bool useWaitForTimestamps = false; bool useBlitSplit = false; bool useFirstSubmissionInitDevice = false; - bool useGpuCopyForDcFlushMitigation = false; bool csrFailInitDirectSubmission = false; bool csrBaseCallDirectSubmissionAvailable = false; @@ -36,8 +35,6 @@ struct UltHwConfig { bool csrBaseCallCreatePreemption = true; bool csrCreatePreemptionReturnValue = true; - - uint8_t padding[7] = {}; }; extern UltHwConfig ultHwConfig; diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index 0eafd78cb3..cfed492081 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -302,11 +302,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw { downloadAllocationCalled = true; } - bool checkDcFlushRequiredForDcMitigationAndReset() override { - this->registeredDcFlushForDcFlushMitigation = this->requiresDcFlush; - return BaseClass::checkDcFlushRequiredForDcMitigationAndReset(); - } - WaitStatus waitForCompletionWithTimeout(const WaitParams ¶ms, TaskCountType taskCountToWait) override { std::lock_guard guard(mutex); latestWaitForCompletionWithTimeoutTaskCount.store(taskCountToWait); @@ -526,7 +521,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw { SubmissionStatus sendRenderStateCacheFlush() override { this->renderStateCacheFlushed = true; - this->renderStateCacheDcFlushForced = this->requiresDcFlush; if (callBaseSendRenderStateCacheFlush) { return BaseClass::sendRenderStateCacheFlush(); } @@ -637,7 +631,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw { std::atomic latestDownloadAllocationsBlocking = false; bool renderStateCacheFlushed = false; - bool renderStateCacheDcFlushForced = false; bool cpuCopyForHostPtrSurfaceAllowed = false; bool createPageTableManagerCalled = false; bool recordFlushedBatchBuffer = false; @@ -667,7 +660,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw { bool isKmdWaitOnTaskCountAllowedValue = false; bool stopDirectSubmissionCalled = false; bool stopDirectSubmissionCalledBlocking = false; - bool registeredDcFlushForDcFlushMitigation = false; bool isUserFenceWaitSupported = false; bool isAnyDirectSubmissionEnabledCallBase = true; bool isAnyDirectSubmissionEnabledResult = true; diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index 17cfb61aa7..7f734db770 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -267,36 +267,6 @@ bool ProductHelperHw::isDcFlushAllowed() const { return true; } -template <> -bool ProductHelperHw::isDcFlushMitigated() const { - return false; -} - -template <> -bool ProductHelperHw::mitigateDcFlush() const { - return false; -} - -template <> -bool ProductHelperHw::overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const { - return false; -} - -template <> -bool ProductHelperHw::overrideUsageForDcFlushMitigation(AllocationType allocationType) const { - return false; -} - -template <> -bool ProductHelperHw::overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const { - return false; -} - -template <> -bool ProductHelperHw::overrideCacheableForDcFlushMitigation(AllocationType allocationType) const { - return false; -} - template <> uint32_t ProductHelperHw::computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const { return hwInfo.gtSystemInfo.MaxSubSlicesSupported; diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index b102ff5e06..6b856fc705 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -578,8 +578,6 @@ ForceInOrderEvents = -1 EnableInOrderRelaxedOrderingForEventsChaining = -1 OverridePatIndexForSystemMemory = -1 OverridePatIndexForDeviceMemory = -1 -OverrideReadWritePatForDcFlushMitigation = -1 -OverrideWriteOnlyPatForDcFlushMitigation = -1 PrintGmmCompressionParams = 0 SkipInOrderNonWalkerSignalingAllowed = 0 PrintKernelDispatchParameters = 0 diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index ba96ac25c2..52bc815449 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -3572,37 +3572,6 @@ HWTEST_F(CommandStreamReceiverHwTest, givenFlushPipeControlWhenFlushWithStateCac EXPECT_TRUE(UnitTestHelper::findStateCacheFlushPipeControl(commandStreamReceiver, commandStreamReceiver.commandStream)); } -HWTEST_F(CommandStreamReceiverHwTest, givenDcFlushForcedWhenSendRenderStateCacheFlushThenExpectDcFlush) { - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); - - commandStreamReceiver.registerDcFlushForDcMitigation(); - commandStreamReceiver.sendRenderStateCacheFlush(); - - HardwareParse hwParserCsr; - hwParserCsr.parsePipeControl = true; - hwParserCsr.parseCommands(commandStreamReceiver.commandStream, 0); - hwParserCsr.findHardwareCommands(); - - bool stateCacheFlushFound = false; - auto itorPipeControl = hwParserCsr.pipeControlList.begin(); - while (itorPipeControl != hwParserCsr.pipeControlList.end()) { - auto pipeControl = reinterpret_cast(*itorPipeControl); - - if (pipeControl->getDcFlushEnable() && - pipeControl->getRenderTargetCacheFlushEnable() && - pipeControl->getStateCacheInvalidationEnable() && - pipeControl->getTextureCacheInvalidationEnable() && - ((commandStreamReceiver.isTlbFlushRequiredForStateCacheFlush() && pipeControl->getTlbInvalidate()) || (!commandStreamReceiver.isTlbFlushRequiredForStateCacheFlush() && !pipeControl->getTlbInvalidate()))) { - stateCacheFlushFound = true; - break; - } - itorPipeControl++; - } - - EXPECT_TRUE(stateCacheFlushFound); -} - HWTEST2_F(CommandStreamReceiverHwTest, givenRayTracingAllocationPresentWhenFlushingTaskThenDispatchBtdStateCommandOnceAndResidentAlways, IsHeapfulSupportedAndAtLeastXeHpCore) { diff --git a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp index a0d6f6413a..ccc7655023 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -681,10 +681,6 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - if (productHelper.isDcFlushMitigated()) { - GTEST_SKIP(); - } - HardwareInfo hwInfo; hwInfo.capabilityTable.isIntegratedDevice = false; @@ -808,68 +804,33 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); - auto uncachedGmmUsageType = productHelper.isNewCoherencyModelSupported() ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper, &hwInfo); auto expectedUsage = GMM_RESOURCE_USAGE_UNKNOWN; - if (productHelper.isDcFlushMitigated()) { - switch (allocationType) { - case AllocationType::bufferHostMemory: - case AllocationType::externalHostPtr: - case AllocationType::gpuTimestampDeviceBuffer: - case AllocationType::internalHostMemory: - case AllocationType::mapAllocation: - case AllocationType::printfSurface: - case AllocationType::svmCpu: - case AllocationType::svmZeroCopy: - case AllocationType::tagBuffer: - case AllocationType::timestampPacketTagBuffer: - expectedUsage = uncachedGmmUsageType; - break; - - case AllocationType::linearStream: - case AllocationType::internalHeap: - expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED; - break; - case AllocationType::constantSurface: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; - break; - case AllocationType::image: - expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; - break; - case AllocationType::fillPattern: - expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; - break; - default: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; - break; - } - } else { - switch (allocationType) { - case AllocationType::constantSurface: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; - break; - case AllocationType::image: - expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; - break; - case AllocationType::internalHeap: - case AllocationType::linearStream: - expectedUsage = GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; - break; - case AllocationType::bufferHostMemory: - case AllocationType::externalHostPtr: - case AllocationType::fillPattern: - case AllocationType::internalHostMemory: - case AllocationType::mapAllocation: - case AllocationType::svmCpu: - case AllocationType::svmZeroCopy: - case AllocationType::tagBuffer: - expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; - break; - default: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; - break; - } + switch (allocationType) { + case AllocationType::constantSurface: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; + break; + case AllocationType::image: + expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; + break; + case AllocationType::internalHeap: + case AllocationType::linearStream: + expectedUsage = GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; + break; + case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::fillPattern: + case AllocationType::internalHostMemory: + case AllocationType::mapAllocation: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: + case AllocationType::tagBuffer: + expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + break; + default: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; + break; } EXPECT_EQ(expectedUsage, usage); @@ -879,89 +840,44 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); - auto uncachedGmmUsageType = productHelper.isNewCoherencyModelSupported() ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper, &hwInfo); auto expectedUsage = GMM_RESOURCE_USAGE_UNKNOWN; - if (productHelper.isDcFlushMitigated()) { - switch (allocationType) { - case AllocationType::bufferHostMemory: - case AllocationType::externalHostPtr: - case AllocationType::gpuTimestampDeviceBuffer: - case AllocationType::internalHostMemory: - case AllocationType::mapAllocation: - case AllocationType::printfSurface: - case AllocationType::svmCpu: - case AllocationType::svmZeroCopy: - case AllocationType::tagBuffer: - case AllocationType::timestampPacketTagBuffer: - expectedUsage = uncachedGmmUsageType; + switch (allocationType) { + case AllocationType::constantSurface: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; + break; + case AllocationType::image: + expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; + break; + case AllocationType::internalHeap: + case AllocationType::linearStream: + expectedUsage = GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; + break; + case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::fillPattern: + case AllocationType::internalHostMemory: + case AllocationType::mapAllocation: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: + case AllocationType::tagBuffer: + expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + break; + case AllocationType::semaphoreBuffer: + case AllocationType::ringBuffer: + case AllocationType::commandBuffer: + if (productHelper.isResourceUncachedForCS(allocationType)) { + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; break; - case AllocationType::linearStream: - case AllocationType::internalHeap: - expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED; - break; - case AllocationType::constantSurface: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; - break; - case AllocationType::image: - expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; - break; - case AllocationType::fillPattern: + } else if (allocationType == AllocationType::semaphoreBuffer) { expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; - case AllocationType::semaphoreBuffer: - case AllocationType::ringBuffer: - case AllocationType::commandBuffer: - if (productHelper.isResourceUncachedForCS(allocationType)) { - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; - break; - } else if (allocationType == AllocationType::semaphoreBuffer) { - expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; - break; - } - [[fallthrough]]; - default: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; - break; - } - } else { - switch (allocationType) { - case AllocationType::constantSurface: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; - break; - case AllocationType::image: - expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; - break; - case AllocationType::internalHeap: - case AllocationType::linearStream: - expectedUsage = GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; - break; - case AllocationType::bufferHostMemory: - case AllocationType::externalHostPtr: - case AllocationType::fillPattern: - case AllocationType::internalHostMemory: - case AllocationType::mapAllocation: - case AllocationType::svmCpu: - case AllocationType::svmZeroCopy: - case AllocationType::tagBuffer: - expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; - break; - case AllocationType::semaphoreBuffer: - case AllocationType::ringBuffer: - case AllocationType::commandBuffer: - if (productHelper.isResourceUncachedForCS(allocationType)) { - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; - break; - } else if (allocationType == AllocationType::semaphoreBuffer) { - expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; - break; - } - [[fallthrough]]; - default: - expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; - break; } + [[fallthrough]]; + default: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; + break; } EXPECT_EQ(expectedUsage, usage); @@ -1055,10 +971,6 @@ TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncac MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - if (productHelper.isDcFlushMitigated()) { - GTEST_SKIP(); - } - constexpr int64_t bufferMask = 1 << (static_cast(AllocationType::buffer) - 1); constexpr int64_t imageMask = 1 << (static_cast(AllocationType::image) - 1); 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 eefdce14cc..c957006dec 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -322,36 +322,6 @@ HWTEST_F(ProductHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHw EXPECT_EQ(AubMemDump::SteppingValues::A, mockProductHelper.getAubStreamSteppingFromHwRevId(pInHwInfo)); } -HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatToUCAndTwoWayCohForDcFlushMitigationThenReturnCorrectValue) { - DebugManagerStateRestore restorer; - if (!productHelper->isDcFlushMitigated()) { - for (auto i = 0; i < static_cast(AllocationType::count); ++i) { - auto allocationType = static_cast(i); - EXPECT_FALSE(productHelper->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType)); - } - } - debugManager.flags.AllowDcFlush.set(0); - for (auto i = 0; i < static_cast(AllocationType::count); ++i) { - auto allocationType = static_cast(i); - if (allocationType == AllocationType::externalHostPtr || - allocationType == AllocationType::bufferHostMemory || - allocationType == AllocationType::mapAllocation || - allocationType == AllocationType::svmCpu || - allocationType == AllocationType::svmZeroCopy || - allocationType == AllocationType::internalHostMemory || - allocationType == AllocationType::timestampPacketTagBuffer || - allocationType == AllocationType::tagBuffer || - allocationType == AllocationType::gpuTimestampDeviceBuffer || - allocationType == AllocationType::linearStream || - allocationType == AllocationType::internalHeap || - allocationType == AllocationType::printfSurface) { - EXPECT_EQ(productHelper->overrideUsageForDcFlushMitigation(allocationType), productHelper->isDcFlushMitigated()); - } else { - EXPECT_FALSE(productHelper->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType)); - } - } -} - HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedForDefaultEngineTypeAdjustmentThenFalseIsReturned) { EXPECT_FALSE(productHelper->isDefaultEngineTypeAdjustmentRequired(pInHwInfo)); diff --git a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index eaabb617f1..b5c13e58bf 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -2998,12 +2998,7 @@ HWTEST_F(WddmMemoryManagerTest, givenInternalHeapOrLinearStreamTypeWhenAllocatin auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); ASSERT_NE(nullptr, allocation); - - if (rootDeviceEnvironment->getProductHelper().isDcFlushMitigated()) { - EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED); - } else { - EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER); - } + EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER); memoryManager->freeGraphicsMemory(allocation); } @@ -3014,12 +3009,7 @@ HWTEST_F(WddmMemoryManagerTest, givenInternalHeapOrLinearStreamTypeWhenAllocatin auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, nullptr); ASSERT_NE(nullptr, allocation); - - if (rootDeviceEnvironment->getProductHelper().isDcFlushMitigated()) { - EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED); - } else { - EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER); - } + EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER); memoryManager->freeGraphicsMemory(allocation); } diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/gfx_core_helper_tests_lnl.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/gfx_core_helper_tests_lnl.cpp index 0ede715455..536436954a 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/gfx_core_helper_tests_lnl.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/gfx_core_helper_tests_lnl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -29,10 +29,6 @@ LNLTEST_F(GfxCoreHelperTestsLnl, givenCommandBufferAllocationTypeWhenGetAllocati EXPECT_TRUE(allocData.flags.useSystemMemory); } -LNLTEST_F(GfxCoreHelperTestsLnl, WhenAskingForDcFlushThenReturnTrue) { - EXPECT_NE(MemorySynchronizationCommands::getDcFlushEnable(true, this->pDevice->getRootDeviceEnvironment()), this->pDevice->getRootDeviceEnvironment().getProductHelper().isDcFlushMitigated()); -} - LNLTEST_F(GfxCoreHelperTestsLnl, givenGetDeviceTimestampWidthCalledThenReturnCorrectValue) { DebugManagerStateRestore restore; diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp index 9a72131867..3019a9a7a5 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp @@ -117,43 +117,6 @@ LNLTEST_F(LnlProductHelper, givenProductHelperWhenCheckoverrideAllocationCpuCach EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); } -LNLTEST_F(LnlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideCacheable) { - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(1); - - AllocationData allocationData{}; - allocationData.type = AllocationType::externalHostPtr; - EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); - - debugManager.flags.AllowDcFlush.set(0); - - for (auto i = 0; i < static_cast(AllocationType::count); ++i) { - auto allocationType = static_cast(i); - allocationData.type = allocationType; - switch (allocationData.type) { - case AllocationType::commandBuffer: - case AllocationType::ringBuffer: - case AllocationType::semaphoreBuffer: - EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); - break; - case AllocationType::externalHostPtr: - case AllocationType::bufferHostMemory: - case AllocationType::mapAllocation: - case AllocationType::svmCpu: - case AllocationType::svmZeroCopy: - case AllocationType::internalHostMemory: - case AllocationType::printfSurface: - EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); - EXPECT_TRUE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); - break; - default: - EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); - EXPECT_FALSE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); - break; - } - } -} - LNLTEST_F(LnlProductHelper, givenProductHelperWhenCheckBlitEnqueuePreferredThenReturnCorrectValue) { EXPECT_TRUE(productHelper->blitEnqueuePreferred(true)); EXPECT_FALSE(productHelper->blitEnqueuePreferred(false)); diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/windows/product_helper_tests_lnl_windows.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/windows/product_helper_tests_lnl_windows.cpp index 284c236a69..8d660b64d5 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/windows/product_helper_tests_lnl_windows.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/windows/product_helper_tests_lnl_windows.cpp @@ -19,57 +19,6 @@ using namespace NEO; using LnlProductHelperWindows = ProductHelperTest; -LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenDcFlushMitigationThenReturnFalse) { - EXPECT_FALSE(productHelper->mitigateDcFlush()); - EXPECT_FALSE(productHelper->isDcFlushMitigated()); -} - -LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledThenCorrectValueIsReturned) { - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(1); - - uint64_t expectedPatIndex = 6u; - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::bufferHostMemory)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::mapAllocation)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::svmCpu)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::svmZeroCopy)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::linearStream)); - EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHeap)); - - debugManager.flags.AllowDcFlush.set(0); - - uint64_t expectedPatIndexOverride = 2u; - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::bufferHostMemory)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::mapAllocation)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::svmCpu)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::svmZeroCopy)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer)); - - expectedPatIndexOverride = 1u; - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::linearStream)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHeap)); - - expectedPatIndexOverride = 19u; - debugManager.flags.OverrideReadWritePatForDcFlushMitigation.set(static_cast(expectedPatIndexOverride)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::bufferHostMemory)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::mapAllocation)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::svmCpu)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::svmZeroCopy)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer)); - - expectedPatIndexOverride = 33u; - debugManager.flags.OverrideWriteOnlyPatForDcFlushMitigation.set(static_cast(expectedPatIndexOverride)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::linearStream)); - EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHeap)); -} - LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenCheckIsCopyBufferRectSplitSupportedThenReturnsTrue) { EXPECT_TRUE(productHelper->isCopyBufferRectSplitSupported()); } diff --git a/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp b/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp index 41278bf512..bfb9174042 100644 --- a/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp +++ b/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp @@ -57,43 +57,6 @@ PTLTEST_F(PtlProductHelper, givenProductHelperWhenCheckoverrideAllocationCpuCach EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); } -PTLTEST_F(PtlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideCacheable) { - DebugManagerStateRestore restorer; - debugManager.flags.AllowDcFlush.set(1); - - AllocationData allocationData{}; - allocationData.type = AllocationType::externalHostPtr; - EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); - - debugManager.flags.AllowDcFlush.set(0); - - for (auto i = 0; i < static_cast(AllocationType::count); ++i) { - auto allocationType = static_cast(i); - allocationData.type = allocationType; - switch (allocationData.type) { - case AllocationType::commandBuffer: - case AllocationType::ringBuffer: - case AllocationType::semaphoreBuffer: - EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); - break; - case AllocationType::externalHostPtr: - case AllocationType::bufferHostMemory: - case AllocationType::mapAllocation: - case AllocationType::svmCpu: - case AllocationType::svmZeroCopy: - case AllocationType::internalHostMemory: - case AllocationType::printfSurface: - EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); - EXPECT_TRUE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); - break; - default: - EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); - EXPECT_FALSE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); - break; - } - } -} - PTLTEST_F(PtlProductHelper, givenProductHelperWhenCallIsCachingOnCpuAvailableThenFalseIsReturned) { EXPECT_FALSE(productHelper->isCachingOnCpuAvailable()); }