mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: remove redundant code
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a233f2f53b
commit
d6bd0262e9
@@ -49,7 +49,6 @@ enum class DirectSubmissionSfenceMode : int32_t {
|
||||
|
||||
namespace UllsDefaults {
|
||||
inline constexpr bool defaultDisableCacheFlush = true;
|
||||
inline constexpr bool defaultDisableMonitorFence = true;
|
||||
} // namespace UllsDefaults
|
||||
|
||||
struct BatchBuffer;
|
||||
@@ -268,7 +267,6 @@ class DirectSubmissionHw {
|
||||
bool ringStart = false;
|
||||
bool disableCpuCacheFlush = true;
|
||||
bool disableCacheFlush = false;
|
||||
bool disableMonitorFence = false;
|
||||
bool partitionedMode = false;
|
||||
bool partitionConfigSet = true;
|
||||
bool miMemFenceRequired = false;
|
||||
|
||||
@@ -50,7 +50,6 @@ DirectSubmissionHw<GfxFamily, Dispatcher>::DirectSubmissionHw(const DirectSubmis
|
||||
auto &compilerProductHelper = inputParams.rootDeviceEnvironment.getHelper<CompilerProductHelper>();
|
||||
|
||||
disableCacheFlush = UllsDefaults::defaultDisableCacheFlush;
|
||||
disableMonitorFence = UllsDefaults::defaultDisableMonitorFence;
|
||||
|
||||
if (debugManager.flags.DirectSubmissionMaxRingBuffers.get() != -1) {
|
||||
this->maxRingBufferCount = debugManager.flags.DirectSubmissionMaxRingBuffers.get();
|
||||
@@ -309,9 +308,7 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::stopRingBuffer(bool blocking) {
|
||||
|
||||
void *flushPtr = ringCommandStream.getSpace(0);
|
||||
Dispatcher::dispatchCacheFlush(ringCommandStream, this->rootDeviceEnvironment, gpuVaForMiFlush);
|
||||
if (disableMonitorFence) {
|
||||
dispatchStopRingBufferSection();
|
||||
}
|
||||
dispatchStopRingBufferSection();
|
||||
Dispatcher::dispatchStopCommandBuffer(ringCommandStream);
|
||||
|
||||
auto bytesToPad = Dispatcher::getSizeStartCommandBuffer() - Dispatcher::getSizeStopCommandBuffer();
|
||||
@@ -394,21 +391,15 @@ inline size_t DirectSubmissionHw<GfxFamily, Dispatcher>::getSizeStartSection() {
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
inline void DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchSwitchRingBufferSection(uint64_t nextBufferGpuAddress) {
|
||||
if (disableMonitorFence) {
|
||||
TagData currentTagData = {};
|
||||
getTagAddressValueForRingSwitch(currentTagData);
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, this->rootDeviceEnvironment, this->partitionedMode, this->dcFlushRequired, this->notifyKmdDuringMonitorFence);
|
||||
}
|
||||
TagData currentTagData = {};
|
||||
getTagAddressValueForRingSwitch(currentTagData);
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, this->rootDeviceEnvironment, this->partitionedMode, this->dcFlushRequired, this->notifyKmdDuringMonitorFence);
|
||||
Dispatcher::dispatchStartCommandBuffer(ringCommandStream, nextBufferGpuAddress);
|
||||
}
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
inline size_t DirectSubmissionHw<GfxFamily, Dispatcher>::getSizeSwitchRingBufferSection() {
|
||||
size_t size = Dispatcher::getSizeStartCommandBuffer();
|
||||
if (disableMonitorFence) {
|
||||
size += Dispatcher::getSizeMonitorFence(rootDeviceEnvironment);
|
||||
}
|
||||
return size;
|
||||
return Dispatcher::getSizeStartCommandBuffer() + Dispatcher::getSizeMonitorFence(rootDeviceEnvironment);
|
||||
}
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
@@ -416,10 +407,7 @@ inline size_t DirectSubmissionHw<GfxFamily, Dispatcher>::getSizeEnd(bool relaxed
|
||||
size_t size = Dispatcher::getSizeStopCommandBuffer() +
|
||||
Dispatcher::getSizeCacheFlush(rootDeviceEnvironment) +
|
||||
(Dispatcher::getSizeStartCommandBuffer() - Dispatcher::getSizeStopCommandBuffer()) +
|
||||
MemoryConstants::cacheLineSize;
|
||||
if (disableMonitorFence) {
|
||||
size += dispatchStopRingBufferSectionSize();
|
||||
}
|
||||
MemoryConstants::cacheLineSize + dispatchStopRingBufferSectionSize();
|
||||
if (this->relaxedOrderingEnabled && relaxedOrderingSchedulerRequired) {
|
||||
size += getSizeDispatchRelaxedOrderingQueueStall();
|
||||
}
|
||||
@@ -780,7 +768,7 @@ inline GraphicsAllocation *DirectSubmissionHw<GfxFamily, Dispatcher>::switchRing
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchMonitorFenceRequired(bool requireMonitorFence) {
|
||||
return !this->disableMonitorFence;
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
|
||||
@@ -237,9 +237,7 @@ inline void DrmDirectSubmission<GfxFamily, Dispatcher>::handleResidencyContainer
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
void DrmDirectSubmission<GfxFamily, Dispatcher>::handleStopRingBuffer() {
|
||||
if (this->disableMonitorFence) {
|
||||
this->currentTagData.tagValue++;
|
||||
}
|
||||
this->currentTagData.tagValue++;
|
||||
}
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
@@ -256,19 +254,17 @@ size_t DrmDirectSubmission<GfxFamily, Dispatcher>::dispatchStopRingBufferSection
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
void DrmDirectSubmission<GfxFamily, Dispatcher>::handleSwitchRingBuffers(ResidencyContainer *allocationsForResidency) {
|
||||
if (this->disableMonitorFence) {
|
||||
if (this->ringStart) {
|
||||
this->currentTagData.tagValue++;
|
||||
}
|
||||
if (this->ringStart) {
|
||||
this->currentTagData.tagValue++;
|
||||
}
|
||||
|
||||
bool updateCompletionFences = true;
|
||||
if (debugManager.flags.EnableRingSwitchTagUpdateWa.get() != -1) {
|
||||
updateCompletionFences = !debugManager.flags.EnableRingSwitchTagUpdateWa.get() || this->ringStart;
|
||||
}
|
||||
bool updateCompletionFences = true;
|
||||
if (debugManager.flags.EnableRingSwitchTagUpdateWa.get() != -1) {
|
||||
updateCompletionFences = !debugManager.flags.EnableRingSwitchTagUpdateWa.get() || this->ringStart;
|
||||
}
|
||||
|
||||
if (updateCompletionFences) {
|
||||
this->ringBuffers[this->previousRingBuffer].completionFence = this->currentTagData.tagValue;
|
||||
}
|
||||
if (updateCompletionFences) {
|
||||
this->ringBuffers[this->previousRingBuffer].completionFence = this->currentTagData.tagValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,17 +126,13 @@ bool WddmDirectSubmission<GfxFamily, Dispatcher>::handleResidency() {
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
void WddmDirectSubmission<GfxFamily, Dispatcher>::handleStopRingBuffer() {
|
||||
if (this->disableMonitorFence) {
|
||||
updateTagValueImplForSwitchRingBuffer(this->currentRingBuffer);
|
||||
updateTagValueImpl(this->currentRingBuffer);
|
||||
}
|
||||
updateTagValueImplForSwitchRingBuffer(this->currentRingBuffer);
|
||||
updateTagValueImpl(this->currentRingBuffer);
|
||||
}
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
void WddmDirectSubmission<GfxFamily, Dispatcher>::handleSwitchRingBuffers(ResidencyContainer *allocationsForResidency) {
|
||||
if (this->disableMonitorFence) {
|
||||
updateTagValueImplForSwitchRingBuffer(this->previousRingBuffer);
|
||||
}
|
||||
updateTagValueImplForSwitchRingBuffer(this->previousRingBuffer);
|
||||
}
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
@@ -160,7 +156,7 @@ uint64_t WddmDirectSubmission<GfxFamily, Dispatcher>::updateTagValue(bool requir
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
bool WddmDirectSubmission<GfxFamily, Dispatcher>::dispatchMonitorFenceRequired(bool requireMonitorFence) {
|
||||
return !this->disableMonitorFence || requireMonitorFence;
|
||||
return requireMonitorFence;
|
||||
}
|
||||
|
||||
template <typename GfxFamily, typename Dispatcher>
|
||||
|
||||
@@ -29,7 +29,6 @@ struct MockDirectSubmissionHw : public DirectSubmissionHw<GfxFamily, Dispatcher>
|
||||
using BaseClass::DirectSubmissionHw;
|
||||
using BaseClass::disableCacheFlush;
|
||||
using BaseClass::disableCpuCacheFlush;
|
||||
using BaseClass::disableMonitorFence;
|
||||
using BaseClass::dispatchDisablePrefetcher;
|
||||
using BaseClass::dispatchMonitorFenceRequired;
|
||||
using BaseClass::dispatchPartitionRegisterConfiguration;
|
||||
|
||||
@@ -551,7 +551,6 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenGetEndSizeThenExpectCorr
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
|
||||
directSubmission.disableMonitorFence = false;
|
||||
|
||||
size_t expectedSize = Dispatcher::getSizeStopCommandBuffer() +
|
||||
Dispatcher::getSizeCacheFlush(directSubmission.rootDeviceEnvironment) +
|
||||
|
||||
@@ -227,8 +227,6 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenDebugFlagSetToTrueWhenCrea
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,
|
||||
givenDirectSubmissionInPartitionModeWhenDispatchingCommandBufferThenExpectDispatchPartitionedPipeControlInCommandBuffer) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using POST_SYNC_OPERATION = typename FamilyType::PIPE_CONTROL::POST_SYNC_OPERATION;
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
using MI_LOAD_REGISTER_MEM = typename FamilyType::MI_LOAD_REGISTER_MEM;
|
||||
|
||||
@@ -244,7 +242,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,
|
||||
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(directSubmission.partitionConfigSet);
|
||||
directSubmission.partitionConfigSet = false;
|
||||
directSubmission.disableMonitorFence = false;
|
||||
directSubmission.partitionedMode = true;
|
||||
directSubmission.workPartitionAllocation = ultCsr->getWorkPartitionAllocation();
|
||||
|
||||
@@ -286,25 +283,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,
|
||||
|
||||
EXPECT_EQ(directSubmission.getSizeDispatch(false, false, directSubmission.dispatchMonitorFenceRequired(false)) - directSubmission.getSizeNewResourceHandler(), directSubmission.ringCommandStream.getUsed());
|
||||
EXPECT_TRUE(directSubmission.ringStart);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parsePipeControl = true;
|
||||
hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, 0);
|
||||
hwParse.findHardwareCommands<FamilyType>();
|
||||
|
||||
bool foundFenceUpdate = false;
|
||||
for (auto &it : hwParse.pipeControlList) {
|
||||
PIPE_CONTROL *pipeControl = reinterpret_cast<PIPE_CONTROL *>(it);
|
||||
if (pipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
||||
foundFenceUpdate = true;
|
||||
EXPECT_EQ(directSubmission.tagAddressSetValue, NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
|
||||
uint64_t data = pipeControl->getImmediateData();
|
||||
EXPECT_EQ(directSubmission.tagValueSetValue, data);
|
||||
EXPECT_TRUE(pipeControl->getWorkloadPartitionIdOffsetEnable());
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(foundFenceUpdate);
|
||||
}
|
||||
|
||||
HWTEST_F(DirectSubmissionDispatchBufferTest, givenCopyCommandBufferIntoRingWhenDispatchCommandBufferThenCopyTaskStream) {
|
||||
@@ -831,111 +809,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,
|
||||
EXPECT_EQ(gpuAddress, loadRegisterMem->getMemoryAddress());
|
||||
}
|
||||
|
||||
HWTEST_F(DirectSubmissionDispatchBufferTest,
|
||||
givenRenderDirectSubmissionWhenDispatchWorkloadCalledWithMonitorFenceThenExpectPostSyncOperationWithoutNotifyFlag) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
FlushStampTracker flushStamp(true);
|
||||
|
||||
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
|
||||
directSubmission.disableMonitorFence = false;
|
||||
|
||||
bool ret = directSubmission.initialize(true);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
size_t sizeUsedBefore = directSubmission.ringCommandStream.getUsed();
|
||||
ret = directSubmission.dispatchCommandBuffer(batchBuffer, flushStamp);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parsePipeControl = true;
|
||||
hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, sizeUsedBefore);
|
||||
hwParse.findHardwareCommands<FamilyType>();
|
||||
|
||||
bool foundFenceUpdate = false;
|
||||
for (auto it = hwParse.pipeControlList.begin(); it != hwParse.pipeControlList.end(); it++) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
if (pipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
||||
foundFenceUpdate = true;
|
||||
EXPECT_FALSE(pipeControl->getNotifyEnable());
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(foundFenceUpdate);
|
||||
}
|
||||
|
||||
HWTEST_F(DirectSubmissionDispatchBufferTest,
|
||||
givenBlitterDirectSubmissionWhenDispatchWorkloadCalledWithMonitorFenceThenExpectPostSyncOperationWithoutNotifyFlag) {
|
||||
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
|
||||
using Dispatcher = BlitterDispatcher<FamilyType>;
|
||||
|
||||
FlushStampTracker flushStamp(true);
|
||||
|
||||
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
|
||||
directSubmission.disableMonitorFence = false;
|
||||
|
||||
bool ret = directSubmission.initialize(true);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
size_t sizeUsedBefore = directSubmission.ringCommandStream.getUsed();
|
||||
ret = directSubmission.dispatchCommandBuffer(batchBuffer, flushStamp);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, sizeUsedBefore);
|
||||
hwParse.findHardwareCommands<FamilyType>();
|
||||
auto miFlushList = hwParse.getCommandsList<MI_FLUSH_DW>();
|
||||
|
||||
bool foundFenceUpdate = false;
|
||||
for (auto it = miFlushList.begin(); it != miFlushList.end(); it++) {
|
||||
auto miFlush = genCmdCast<MI_FLUSH_DW *>(*it);
|
||||
if (miFlush->getPostSyncOperation() == MI_FLUSH_DW::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA_QWORD) {
|
||||
foundFenceUpdate = true;
|
||||
EXPECT_FALSE(miFlush->getNotifyEnable());
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(foundFenceUpdate);
|
||||
}
|
||||
|
||||
HWTEST_F(DirectSubmissionDispatchBufferTest,
|
||||
givenRenderDirectSubmissionWhenDispatchWorkloadCalledWithMonitorFenceAndNotifyEnableRequiredThenExpectPostSyncOperationWithNotifyFlag) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
FlushStampTracker flushStamp(true);
|
||||
|
||||
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
|
||||
directSubmission.disableMonitorFence = false;
|
||||
directSubmission.notifyKmdDuringMonitorFence = true;
|
||||
|
||||
bool ret = directSubmission.initialize(true);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
size_t sizeUsedBefore = directSubmission.ringCommandStream.getUsed();
|
||||
ret = directSubmission.dispatchCommandBuffer(batchBuffer, flushStamp);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parsePipeControl = true;
|
||||
hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, sizeUsedBefore);
|
||||
hwParse.findHardwareCommands<FamilyType>();
|
||||
|
||||
bool foundFenceUpdate = false;
|
||||
for (auto it = hwParse.pipeControlList.begin(); it != hwParse.pipeControlList.end(); it++) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
if (pipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
||||
foundFenceUpdate = true;
|
||||
EXPECT_TRUE(pipeControl->getNotifyEnable());
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(foundFenceUpdate);
|
||||
}
|
||||
|
||||
HWTEST_F(DirectSubmissionDispatchBufferTest, givenRingBufferRestartRequestWhenDispatchCommandBuffer) {
|
||||
FlushStampTracker flushStamp(true);
|
||||
MockDirectSubmissionHw<FamilyType, BlitterDispatcher<FamilyType>> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
|
||||
|
||||
@@ -79,7 +79,6 @@ struct MockDrmDirectSubmission : public DrmDirectSubmission<GfxFamily, Dispatche
|
||||
using BaseClass::completionFenceValue;
|
||||
using BaseClass::currentRingBuffer;
|
||||
using BaseClass::currentTagData;
|
||||
using BaseClass::disableMonitorFence;
|
||||
using BaseClass::dispatchMonitorFenceRequired;
|
||||
using BaseClass::dispatchSwitchRingBufferSection;
|
||||
using BaseClass::DrmDirectSubmission;
|
||||
@@ -741,7 +740,6 @@ HWTEST_F(DrmDirectSubmissionTest, givenDisabledMonitorFenceWhenDispatchSwitchRin
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
directSubmission.disableMonitorFence = true;
|
||||
directSubmission.ringStart = true;
|
||||
|
||||
bool ret = directSubmission.allocateResources();
|
||||
@@ -766,7 +764,6 @@ HWTEST_F(DrmDirectSubmissionTest, givenDisabledMonitorFenceWhenUpdateTagValueThe
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
directSubmission.disableMonitorFence = true;
|
||||
directSubmission.ringStart = true;
|
||||
|
||||
bool ret = directSubmission.allocateResources();
|
||||
@@ -1231,8 +1228,6 @@ HWTEST_F(DrmDirectSubmissionTest,
|
||||
|
||||
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> drmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_FALSE(drmDirectSubmission.inputMonitorFenceDispatchRequirement);
|
||||
drmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
FlushStampTracker flushStamp(true);
|
||||
|
||||
EXPECT_TRUE(drmDirectSubmission.initialize(false));
|
||||
@@ -1289,7 +1284,6 @@ HWTEST_F(DrmDirectSubmissionTest,
|
||||
|
||||
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> drmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(drmDirectSubmission.inputMonitorFenceDispatchRequirement);
|
||||
drmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
FlushStampTracker flushStamp(true);
|
||||
|
||||
@@ -1382,11 +1376,7 @@ HWTEST2_F(DrmDirectSubmissionTest, givenRelaxedOrderingSchedulerRequiredWhenAski
|
||||
size_t expectedBaseEndSize = Dispatcher::getSizeStopCommandBuffer() +
|
||||
Dispatcher::getSizeCacheFlush(directSubmission.rootDeviceEnvironment) +
|
||||
(Dispatcher::getSizeStartCommandBuffer() - Dispatcher::getSizeStopCommandBuffer()) +
|
||||
MemoryConstants::cacheLineSize;
|
||||
if (directSubmission.disableMonitorFence) {
|
||||
expectedBaseEndSize += Dispatcher::getSizeMonitorFence(device->getRootDeviceEnvironment());
|
||||
}
|
||||
|
||||
MemoryConstants::cacheLineSize + Dispatcher::getSizeMonitorFence(device->getRootDeviceEnvironment());
|
||||
EXPECT_EQ(expectedBaseEndSize + directSubmission.getSizeDispatchRelaxedOrderingQueueStall(), directSubmission.getSizeEnd(true));
|
||||
EXPECT_EQ(expectedBaseEndSize, directSubmission.getSizeEnd(false));
|
||||
}
|
||||
@@ -529,11 +529,6 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSwitchingRingBufferStartedAndWai
|
||||
EXPECT_NE(expectedWaitFence, wddm->waitFromCpuResult.uint64ParamPassed);
|
||||
}
|
||||
|
||||
HWTEST_F(WddmDirectSubmissionTest, whenCreateWddmDirectSubmissionThenDisableMonitorFence) {
|
||||
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(wddmDirectSubmission.disableMonitorFence);
|
||||
}
|
||||
|
||||
HWTEST_F(WddmDirectSubmissionTest, givenWddmDisableMonitorFenceAndStallingCmdsWhenUpdatingTagValueThenUpdateCompletionFence) {
|
||||
uint64_t address = 0xFF00FF0000ull;
|
||||
uint64_t value = 0x12345678ull;
|
||||
@@ -542,7 +537,6 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmDisableMonitorFenceAndStallingCmdsWh
|
||||
contextFence.currentFenceValue = value;
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
EXPECT_TRUE(wddmDirectSubmission.allocateOsResources());
|
||||
|
||||
uint64_t actualTagValue = wddmDirectSubmission.updateTagValue(wddmDirectSubmission.dispatchMonitorFenceRequired(true));
|
||||
@@ -627,7 +621,6 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmDisableMonitorFenceWhenHandleStopRin
|
||||
uint64_t value = 0x12345678ull;
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
wddmDirectSubmission.ringBufferEndCompletionTagData.tagValue = value;
|
||||
wddmDirectSubmission.handleStopRingBuffer();
|
||||
EXPECT_EQ(value + 1, wddmDirectSubmission.ringBufferEndCompletionTagData.tagValue);
|
||||
@@ -637,7 +630,6 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmDisableMonitorFenceWhenHandleSwitchR
|
||||
uint64_t value = 0x12345678ull;
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
wddmDirectSubmission.ringBufferEndCompletionTagData.tagValue = value;
|
||||
wddmDirectSubmission.handleSwitchRingBuffers(nullptr);
|
||||
EXPECT_EQ(value + 1, wddmDirectSubmission.ringBuffers[wddmDirectSubmission.currentRingBuffer].completionFenceForSwitch);
|
||||
@@ -808,7 +800,6 @@ HWTEST_F(WddmDirectSubmissionTest,
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(wddmDirectSubmission.inputMonitorFenceDispatchRequirement);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
bool ret = wddmDirectSubmission.initialize(true);
|
||||
EXPECT_TRUE(ret);
|
||||
@@ -873,7 +864,6 @@ HWTEST_F(WddmDirectSubmissionTest,
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(wddmDirectSubmission.inputMonitorFenceDispatchRequirement);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
bool ret = wddmDirectSubmission.initialize(true);
|
||||
EXPECT_TRUE(ret);
|
||||
@@ -906,42 +896,11 @@ HWTEST_F(WddmDirectSubmissionTest,
|
||||
memoryManager->freeGraphicsMemory(clientCommandBuffer);
|
||||
}
|
||||
|
||||
HWTEST_F(WddmDirectSubmissionTest,
|
||||
givenDisableMonitorFenceIsFalseWhenDispatchArgumentIsFalseThenDispatchMonitorFenceReturnsTrue) {
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
wddmDirectSubmission.disableMonitorFence = false;
|
||||
|
||||
EXPECT_TRUE(wddmDirectSubmission.dispatchMonitorFenceRequired(false));
|
||||
}
|
||||
|
||||
HWTEST_F(WddmDirectSubmissionTest,
|
||||
givenDisableMonitorFenceIsFalseWhenDispatchArgumentIsTrueThenDispatchMonitorFenceReturnsTrue) {
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
wddmDirectSubmission.disableMonitorFence = false;
|
||||
|
||||
EXPECT_TRUE(wddmDirectSubmission.dispatchMonitorFenceRequired(true));
|
||||
}
|
||||
|
||||
HWTEST_F(WddmDirectSubmissionTest,
|
||||
givenDisableMonitorFenceIsTrueWhenDispatchArgumentIsFalseThenDispatchMonitorFenceReturnsFalse) {
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
EXPECT_FALSE(wddmDirectSubmission.dispatchMonitorFenceRequired(false));
|
||||
}
|
||||
|
||||
HWTEST_F(WddmDirectSubmissionTest,
|
||||
givenDisableMonitorFenceIsTrueWhenDispatchArgumentIsTrueThenDispatchMonitorFenceReturnsTrue) {
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
EXPECT_TRUE(wddmDirectSubmission.dispatchMonitorFenceRequired(true));
|
||||
}
|
||||
@@ -981,7 +940,6 @@ HWTEST_F(WddmDirectSubmissionTest,
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_FALSE(wddmDirectSubmission.inputMonitorFenceDispatchRequirement);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
bool ret = wddmDirectSubmission.initialize(true);
|
||||
EXPECT_TRUE(ret);
|
||||
@@ -1043,7 +1001,6 @@ HWTEST_F(WddmDirectSubmissionTest,
|
||||
|
||||
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(wddmDirectSubmission.inputMonitorFenceDispatchRequirement);
|
||||
wddmDirectSubmission.disableMonitorFence = true;
|
||||
|
||||
bool ret = wddmDirectSubmission.initialize(true);
|
||||
EXPECT_TRUE(ret);
|
||||
@@ -1257,10 +1214,7 @@ HWTEST2_F(WddmDirectSubmissionTest, givenRelaxedOrderingSchedulerRequiredWhenAsk
|
||||
size_t expectedBaseEndSize = Dispatcher::getSizeStopCommandBuffer() +
|
||||
Dispatcher::getSizeCacheFlush(directSubmission.rootDeviceEnvironment) +
|
||||
(Dispatcher::getSizeStartCommandBuffer() - Dispatcher::getSizeStopCommandBuffer()) +
|
||||
MemoryConstants::cacheLineSize;
|
||||
if (directSubmission.disableMonitorFence) {
|
||||
expectedBaseEndSize += 2 * Dispatcher::getSizeMonitorFence(device->getRootDeviceEnvironment());
|
||||
}
|
||||
MemoryConstants::cacheLineSize + 2 * Dispatcher::getSizeMonitorFence(device->getRootDeviceEnvironment());
|
||||
EXPECT_EQ(expectedBaseEndSize + directSubmission.getSizeDispatchRelaxedOrderingQueueStall(), directSubmission.getSizeEnd(true));
|
||||
EXPECT_EQ(expectedBaseEndSize, directSubmission.getSizeEnd(false));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ struct MockWddmDirectSubmission : public WddmDirectSubmission<GfxFamily, Dispatc
|
||||
using BaseClass::completionFenceAllocation;
|
||||
using BaseClass::currentRingBuffer;
|
||||
using BaseClass::detectGpuHang;
|
||||
using BaseClass::disableMonitorFence;
|
||||
using BaseClass::dispatchMonitorFenceRequired;
|
||||
using BaseClass::getSizeDisablePrefetcher;
|
||||
using BaseClass::getSizeDispatch;
|
||||
|
||||
Reference in New Issue
Block a user