|
1 | 1 | /* |
2 | | - * Copyright (C) 2020-2024 Intel Corporation |
| 2 | + * Copyright (C) 2020-2025 Intel Corporation |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: MIT |
5 | 5 | * |
|
14 | 14 | #include "shared/test/common/cmd_parse/gen_cmd_parse.h" |
15 | 15 | #include "shared/test/common/helpers/mock_product_helper_hw.h" |
16 | 16 | #include "shared/test/common/helpers/raii_product_helper.h" |
| 17 | +#include "shared/test/common/libult/ult_command_stream_receiver.h" |
17 | 18 | #include "shared/test/common/mocks/mock_bindless_heaps_helper.h" |
18 | 19 | #include "shared/test/common/mocks/mock_gmm_helper.h" |
19 | 20 | #include "shared/test/common/mocks/mock_graphics_allocation.h" |
@@ -78,6 +79,37 @@ TEST_F(L0DebuggerTest, givenL0DebuggerWhenGettingStateSaveAreaHeaderThenValidSip |
78 | 79 | EXPECT_EQ(expectedStateSaveAreaHeader, stateSaveAreaHeader); |
79 | 80 | } |
80 | 81 |
|
| 82 | +HWTEST_F(L0DebuggerTest, givenL0DebuggerAndDirectSubmissionWhenDestroyCmdListThenFlushTagUpdateOnDcFlushPlatform) { |
| 83 | + auto &engine = device->getNEODevice()->getDefaultEngine(); |
| 84 | + engine.osContext->ensureContextInitialized(false); |
| 85 | + auto csr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(engine.commandStreamReceiver); |
| 86 | + csr->directSubmissionAvailable = true; |
| 87 | + csr->callBaseSendRenderStateCacheFlush = false; |
| 88 | + csr->flushReturnValue = NEO::SubmissionStatus::success; |
| 89 | + |
| 90 | + ze_result_t returnValue{}; |
| 91 | + L0::CommandList *commandList = L0::CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false); |
| 92 | + commandList->destroy(); |
| 93 | + |
| 94 | + if (device->getProductHelper().isDcFlushAllowed()) { |
| 95 | + EXPECT_TRUE(csr->renderStateCacheFlushed); |
| 96 | + } else { |
| 97 | + EXPECT_FALSE(csr->renderStateCacheFlushed); |
| 98 | + } |
| 99 | +} |
| 100 | + |
| 101 | +HWTEST_F(L0DebuggerTest, givenL0DebuggerWhenDestroyCmdListThenDoNotFlushTagUpdate) { |
| 102 | + auto &engine = device->getNEODevice()->getDefaultEngine(); |
| 103 | + engine.osContext->ensureContextInitialized(false); |
| 104 | + auto csr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(engine.commandStreamReceiver); |
| 105 | + |
| 106 | + ze_result_t returnValue{}; |
| 107 | + L0::CommandList *commandList = L0::CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false); |
| 108 | + commandList->destroy(); |
| 109 | + |
| 110 | + EXPECT_FALSE(csr->renderStateCacheFlushed); |
| 111 | +} |
| 112 | + |
81 | 113 | TEST_F(L0DebuggerTest, givenProgramDebuggingEnabledWhenDebuggerIsCreatedThenFusedEusAreDisabled) { |
82 | 114 | EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::online); |
83 | 115 | EXPECT_FALSE(neoDevice->getHardwareInfo().capabilityTable.fusedEuEnabled); |
|
0 commit comments