Refactor passing GlobalFenceAllocation to DirectSubmission

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski 2022-04-07 13:03:01 +00:00 committed by Compute-Runtime-Automation
parent 6f0f15a0b8
commit fc4eaa1894
19 changed files with 154 additions and 157 deletions

View File

@ -1374,7 +1374,7 @@ HWTEST_F(BcsTests, givenBlitterDirectSubmissionEnabledWhenProgrammingBlitterThen
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
using DirectSubmission = MockDirectSubmissionHw<FamilyType, BlitterDispatcher<FamilyType>>;
csr.blitterDirectSubmission = std::make_unique<DirectSubmission>(*pDevice, *csr.osContext);
csr.blitterDirectSubmission = std::make_unique<DirectSubmission>(*pDevice, *csr.osContext, csr.getGlobalFenceAllocation());
csr.recordFlusheBatchBuffer = true;
DirectSubmission *directSubmission = reinterpret_cast<DirectSubmission *>(csr.blitterDirectSubmission.get());
bool initRet = directSubmission->initialize(true, false);
@ -1417,7 +1417,7 @@ HWTEST_F(BcsTests, givenBlitterDirectSubmissionEnabledWhenFlushTagUpdateThenBatc
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
using DirectSubmission = MockDirectSubmissionHw<FamilyType, BlitterDispatcher<FamilyType>>;
csr.blitterDirectSubmission = std::make_unique<DirectSubmission>(*pDevice, *csr.osContext);
csr.blitterDirectSubmission = std::make_unique<DirectSubmission>(*pDevice, *csr.osContext, csr.getGlobalFenceAllocation());
csr.recordFlusheBatchBuffer = true;
DirectSubmission *directSubmission = reinterpret_cast<DirectSubmission *>(csr.blitterDirectSubmission.get());
bool initRet = directSubmission->initialize(true, false);

View File

@ -654,8 +654,8 @@ struct DrmDirectSubmissionFunctionsCalled {
template <typename GfxFamily>
struct MockDrmDirectSubmissionToTestDtor : public DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>> {
MockDrmDirectSubmissionToTestDtor<GfxFamily>(Device &device, OsContext &osContext, DrmDirectSubmissionFunctionsCalled &functionsCalled)
: DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext), functionsCalled(functionsCalled) {
MockDrmDirectSubmissionToTestDtor<GfxFamily>(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation, DrmDirectSubmissionFunctionsCalled &functionsCalled)
: DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext, globalFenceAllocation), functionsCalled(functionsCalled) {
}
~MockDrmDirectSubmissionToTestDtor() override {
if (ringStart) {
@ -680,7 +680,8 @@ struct MockDrmDirectSubmissionToTestDtor : public DrmDirectSubmission<GfxFamily,
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenEnabledDirectSubmissionWhenDtorIsCalledButRingIsNotStartedThenDontCallStopRingBufferNorWaitForTagValue) {
DrmDirectSubmissionFunctionsCalled functionsCalled{};
auto directSubmission = std::make_unique<MockDrmDirectSubmissionToTestDtor<FamilyType>>(*device.get(), *device->getDefaultEngine().osContext, functionsCalled);
auto directSubmission = std::make_unique<MockDrmDirectSubmissionToTestDtor<FamilyType>>(*device.get(), *device->getDefaultEngine().osContext,
device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation(), functionsCalled);
ASSERT_NE(nullptr, directSubmission);
EXPECT_FALSE(directSubmission->ringStart);
@ -694,14 +695,15 @@ HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenEnabledDirectSubmi
template <typename GfxFamily>
struct MockDrmDirectSubmissionToTestRingStop : public DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>> {
MockDrmDirectSubmissionToTestRingStop<GfxFamily>(Device &device, OsContext &osContext)
: DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext) {
MockDrmDirectSubmissionToTestRingStop<GfxFamily>(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation)
: DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext, globalFenceAllocation) {
}
using DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>::ringStart;
};
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenEnabledDirectSubmissionWhenStopRingBufferIsCalledThenClearRingStart) {
auto directSubmission = std::make_unique<MockDrmDirectSubmissionToTestRingStop<FamilyType>>(*device.get(), *device->getDefaultEngine().osContext);
auto directSubmission = std::make_unique<MockDrmDirectSubmissionToTestRingStop<FamilyType>>(*device.get(), *device->getDefaultEngine().osContext,
device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
ASSERT_NE(nullptr, directSubmission);
directSubmission->stopRingBuffer();
@ -710,8 +712,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenEnabledDirectSubmi
template <typename GfxFamily>
struct MockDrmDirectSubmissionDispatchCommandBuffer : public DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>> {
MockDrmDirectSubmissionDispatchCommandBuffer<GfxFamily>(Device &device, OsContext &osContext)
: DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext) {
MockDrmDirectSubmissionDispatchCommandBuffer<GfxFamily>(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation)
: DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext, globalFenceAllocation) {
}
ADDMETHOD_NOBASE(dispatchCommandBuffer, bool, false,
@ -720,8 +722,8 @@ struct MockDrmDirectSubmissionDispatchCommandBuffer : public DrmDirectSubmission
template <typename GfxFamily>
struct MockDrmBlitterDirectSubmissionDispatchCommandBuffer : public DrmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>> {
MockDrmBlitterDirectSubmissionDispatchCommandBuffer<GfxFamily>(Device &device, OsContext &osContext)
: DrmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>(device, osContext) {
MockDrmBlitterDirectSubmissionDispatchCommandBuffer<GfxFamily>(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation)
: DrmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>(device, osContext, globalFenceAllocation) {
}
ADDMETHOD_NOBASE(dispatchCommandBuffer, bool, false,
@ -729,7 +731,8 @@ struct MockDrmBlitterDirectSubmissionDispatchCommandBuffer : public DrmDirectSub
};
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenDirectSubmissionFailsThenFlushReturnsError) {
static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->directSubmission = std::make_unique<MockDrmDirectSubmissionDispatchCommandBuffer<FamilyType>>(*device.get(), *device->getDefaultEngine().osContext);
static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->directSubmission = std::make_unique<MockDrmDirectSubmissionDispatchCommandBuffer<FamilyType>>(*device.get(), *device->getDefaultEngine().osContext,
device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
auto directSubmission = static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->directSubmission.get();
static_cast<MockDrmDirectSubmissionDispatchCommandBuffer<FamilyType> *>(directSubmission)->dispatchCommandBufferResult = false;
@ -746,7 +749,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenDirectSubmissionFa
}
HWTEST_TEMPLATED_F(DrmCommandStreamBlitterDirectSubmissionTest, givenBlitterDirectSubmissionFailsThenFlushReturnsError) {
static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->blitterDirectSubmission = std::make_unique<MockDrmBlitterDirectSubmissionDispatchCommandBuffer<FamilyType>>(*device.get(), *device->getDefaultEngine().osContext);
static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->blitterDirectSubmission = std::make_unique<MockDrmBlitterDirectSubmissionDispatchCommandBuffer<FamilyType>>(*device.get(),
*device->getDefaultEngine().osContext,
device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
auto blitterDirectSubmission = static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->blitterDirectSubmission.get();
static_cast<MockDrmBlitterDirectSubmissionDispatchCommandBuffer<FamilyType> *>(blitterDirectSubmission)->dispatchCommandBufferResult = false;

View File

@ -119,12 +119,12 @@ struct MockWddmCsr : public WddmCommandStreamReceiver<GfxFamily> {
if (DebugManager.flags.EnableDirectSubmission.get() == 1) {
if (!initBlitterDirectSubmission) {
directSubmission = std::make_unique<
MockWddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>>(device, osContext);
MockWddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>>(device, osContext, globalFenceAllocation);
ret = directSubmission->initialize(true, false);
this->dispatchMode = DispatchMode::ImmediateDispatch;
} else {
blitterDirectSubmission = std::make_unique<
MockWddmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>>(device, osContext);
MockWddmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>>(device, osContext, globalFenceAllocation);
blitterDirectSubmission->initialize(true, false);
}
}
@ -1056,8 +1056,8 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontIn
template <typename GfxFamily>
struct MockWddmDrmDirectSubmissionDispatchCommandBuffer : public MockWddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>> {
MockWddmDrmDirectSubmissionDispatchCommandBuffer<GfxFamily>(Device &device, OsContext &osContext)
: MockWddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext) {
MockWddmDrmDirectSubmissionDispatchCommandBuffer<GfxFamily>(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation)
: MockWddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>(device, osContext, globalFenceAllocation) {
}
bool dispatchCommandBuffer(BatchBuffer &batchBuffer, FlushStampTracker &flushStamp) override {
@ -1092,7 +1092,7 @@ TEST_F(WddmCommandStreamMockGdiTest, givenDirectSubmissionFailsThenFlushReturnsE
nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(),
&cs, commandBuffer->getUnderlyingBuffer(), false};
csr->directSubmission = std::make_unique<MockSubmission>(*device.get(), *osContext);
csr->directSubmission = std::make_unique<MockSubmission>(*device.get(), *osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
auto res = csr->flush(batchBuffer, csr->getResidencyAllocations());
EXPECT_EQ(NEO::SubmissionStatus::FAILED, res);

View File

@ -1317,11 +1317,11 @@ inline bool CommandStreamReceiverHw<GfxFamily>::initDirectSubmission(Device &dev
auto lock = this->obtainUniqueOwnership();
if (!this->isAnyDirectSubmissionEnabled()) {
if (EngineHelpers::isBcs(osContext.getEngineType())) {
blitterDirectSubmission = DirectSubmissionHw<GfxFamily, BlitterDispatcher<GfxFamily>>::create(device, osContext);
blitterDirectSubmission = DirectSubmissionHw<GfxFamily, BlitterDispatcher<GfxFamily>>::create(device, osContext, this->globalFenceAllocation);
ret = blitterDirectSubmission->initialize(submitOnInit, this->isUsedNotifyEnableForPostSync());
} else {
directSubmission = DirectSubmissionHw<GfxFamily, RenderDispatcher<GfxFamily>>::create(device, osContext);
directSubmission = DirectSubmissionHw<GfxFamily, RenderDispatcher<GfxFamily>>::create(device, osContext, this->globalFenceAllocation);
ret = directSubmission->initialize(submitOnInit, this->isUsedNotifyEnableForPostSync());
}
auto directSubmissionController = executionEnvironment.initializeDirectSubmissionController();

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -9,7 +9,7 @@
namespace NEO {
template <typename GfxFamily, typename Dispatcher>
inline std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> DirectSubmissionHw<GfxFamily, Dispatcher>::create(Device &device, OsContext &osContext) {
return std::make_unique<DrmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext);
inline std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> DirectSubmissionHw<GfxFamily, Dispatcher>::create(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation) {
return std::make_unique<DrmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext, globalFenceAllocation);
}
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -10,11 +10,11 @@
namespace NEO {
template <typename GfxFamily, typename Dispatcher>
inline std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> DirectSubmissionHw<GfxFamily, Dispatcher>::create(Device &device, OsContext &osContext) {
inline std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> DirectSubmissionHw<GfxFamily, Dispatcher>::create(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation) {
if (device.getRootDeviceEnvironment().osInterface->getDriverModel()->getDriverModelType() == DriverModelType::DRM) {
return std::make_unique<DrmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext);
return std::make_unique<DrmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext, globalFenceAllocation);
} else {
return std::make_unique<WddmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext);
return std::make_unique<WddmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext, globalFenceAllocation);
}
}
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -9,7 +9,7 @@
namespace NEO {
template <typename GfxFamily, typename Dispatcher>
inline std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> DirectSubmissionHw<GfxFamily, Dispatcher>::create(Device &device, OsContext &osContext) {
return std::make_unique<WddmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext);
inline std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> DirectSubmissionHw<GfxFamily, Dispatcher>::create(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation) {
return std::make_unique<WddmDirectSubmission<GfxFamily, Dispatcher>>(device, osContext, globalFenceAllocation);
}
} // namespace NEO

View File

@ -60,8 +60,7 @@ class OsContext;
template <typename GfxFamily, typename Dispatcher>
class DirectSubmissionHw {
public:
DirectSubmissionHw(Device &device,
OsContext &osContext);
DirectSubmissionHw(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation);
virtual ~DirectSubmissionHw();
@ -73,7 +72,7 @@ class DirectSubmissionHw {
MOCKABLE_VIRTUAL bool dispatchCommandBuffer(BatchBuffer &batchBuffer, FlushStampTracker &flushStamp);
static std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> create(Device &device, OsContext &osContext);
static std::unique_ptr<DirectSubmissionHw<GfxFamily, Dispatcher>> create(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation);
protected:
static constexpr size_t prefetchSize = 8 * MemoryConstants::cacheLineSize;
@ -148,6 +147,7 @@ class DirectSubmissionHw {
Device &device;
OsContext &osContext;
const HardwareInfo *hwInfo = nullptr;
const GraphicsAllocation *globalFenceAllocation = nullptr;
GraphicsAllocation *ringBuffer = nullptr;
GraphicsAllocation *ringBuffer2 = nullptr;
GraphicsAllocation *semaphores = nullptr;

View File

@ -30,9 +30,8 @@
namespace NEO {
template <typename GfxFamily, typename Dispatcher>
DirectSubmissionHw<GfxFamily, Dispatcher>::DirectSubmissionHw(Device &device,
OsContext &osContext)
: device(device), osContext(osContext) {
DirectSubmissionHw<GfxFamily, Dispatcher>::DirectSubmissionHw(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation)
: device(device), osContext(osContext), globalFenceAllocation(globalFenceAllocation) {
hwInfo = &device.getHardwareInfo();
auto hwInfoConfig = HwInfoConfig::get(hwInfo->platform.eProductFamily);
@ -618,11 +617,8 @@ size_t DirectSubmissionHw<GfxFamily, Dispatcher>::getDiagnosticModeSection() {
template <typename GfxFamily, typename Dispatcher>
void DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchSystemMemoryFenceAddress() {
auto &engineControl = device.getEngine(this->osContext.getEngineType(), this->osContext.getEngineUsage());
UNRECOVERABLE_IF(engineControl.osContext->getContextId() != engineControl.osContext->getContextId());
EncodeMemoryFence<GfxFamily>::encodeSystemMemoryFence(ringCommandStream, engineControl.commandStreamReceiver->getGlobalFenceAllocation());
UNRECOVERABLE_IF(!this->globalFenceAllocation);
EncodeMemoryFence<GfxFamily>::encodeSystemMemoryFence(ringCommandStream, this->globalFenceAllocation);
}
template <typename GfxFamily, typename Dispatcher>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -16,8 +16,7 @@ class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
using DirectSubmissionHw<GfxFamily, Dispatcher>::ringCommandStream;
using DirectSubmissionHw<GfxFamily, Dispatcher>::switchRingBuffersAllocations;
DrmDirectSubmission(Device &device,
OsContext &osContext);
DrmDirectSubmission(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation);
~DrmDirectSubmission();

View File

@ -20,9 +20,8 @@
namespace NEO {
template <typename GfxFamily, typename Dispatcher>
DrmDirectSubmission<GfxFamily, Dispatcher>::DrmDirectSubmission(Device &device,
OsContext &osContext)
: DirectSubmissionHw<GfxFamily, Dispatcher>(device, osContext) {
DrmDirectSubmission<GfxFamily, Dispatcher>::DrmDirectSubmission(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation)
: DirectSubmissionHw<GfxFamily, Dispatcher>(device, osContext, globalFenceAllocation) {
this->disableMonitorFence = true;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -19,8 +19,7 @@ class Wddm;
template <typename GfxFamily, typename Dispatcher>
class WddmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
public:
WddmDirectSubmission(Device &device,
OsContext &osContext);
WddmDirectSubmission(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation);
~WddmDirectSubmission();

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -23,9 +23,8 @@ namespace NEO {
DECLARE_COMMAND_BUFFER(CommandBufferHeader, UMD_OCL, FALSE, FALSE, PERFTAG_OCL);
template <typename GfxFamily, typename Dispatcher>
WddmDirectSubmission<GfxFamily, Dispatcher>::WddmDirectSubmission(Device &device,
OsContext &osContext)
: DirectSubmissionHw<GfxFamily, Dispatcher>(device, osContext) {
WddmDirectSubmission<GfxFamily, Dispatcher>::WddmDirectSubmission(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation)
: DirectSubmissionHw<GfxFamily, Dispatcher>(device, osContext, globalFenceAllocation) {
osContextWin = reinterpret_cast<OsContextWin *>(&osContext);
wddm = osContextWin->getWddm();
commandBufferHeader = std::make_unique<COMMAND_BUFFER_HEADER_REC>();

View File

@ -31,7 +31,7 @@ HWTEST_F(DirectSubmissionTest, whenDebugCacheFlushDisabledSetThenExpectNoCpuCach
DebugManager.flags.DirectSubmissionDisableCpuCacheFlush.set(1);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(directSubmission.disableCpuCacheFlush);
uintptr_t expectedPtrVal = 0;
@ -51,7 +51,7 @@ HWTEST_F(DirectSubmissionTest, whenDebugCacheFlushDisabledNotSetThenExpectCpuCac
DebugManager.flags.DirectSubmissionDisableCpuCacheFlush.set(0);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_FALSE(directSubmission.disableCpuCacheFlush);
uintptr_t expectedPtrVal = 0xABCD00u;
@ -64,7 +64,7 @@ HWTEST_F(DirectSubmissionTest, whenDebugCacheFlushDisabledNotSetThenExpectCpuCac
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenStopThenRingIsNotStarted) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
csr.directSubmission.reset(&directSubmission);
@ -80,7 +80,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenStopThenRingIsNotStarted
HWTEST_F(DirectSubmissionTest, givenBlitterDirectSubmissionWhenStopThenRingIsNotStarted) {
MockDirectSubmissionHw<FamilyType, BlitterDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
std::unique_ptr<OsContext> osContext(OsContext::create(pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.get(), 0,
EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::Regular},
@ -103,7 +103,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenMakingResourcesResidentT
pDevice->getRootDeviceEnvironmentRef().memoryOperationsInterface.reset(mockMemoryOperations.get());
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -124,7 +124,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenMakingResourcesResidentT
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionInitializedWhenRingIsStartedThenExpectAllocationsCreatedAndCommandsDispatched) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(directSubmission.disableCpuCacheFlush);
bool ret = directSubmission.initialize(true, false);
@ -140,7 +140,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionInitializedWhenRingIsStarted
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionInitializedWhenRingIsNotStartedThenExpectAllocationsCreatedAndCommandsNotDispatched) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -156,7 +156,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionInitializedWhenRingIsNotStar
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionSwitchBuffersWhenCurrentIsPrimaryThenExpectNextSecondary) {
using RingBufferUse = typename MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>::RingBufferUse;
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -170,7 +170,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionSwitchBuffersWhenCurrentIsPr
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionSwitchBuffersWhenCurrentIsSecondaryThenExpectNextPrimary) {
using RingBufferUse = typename MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>::RingBufferUse;
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -186,7 +186,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionSwitchBuffersWhenCurrentIsSe
}
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionAllocateFailWhenRingIsStartedThenExpectRingNotStarted) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(directSubmission.disableCpuCacheFlush);
directSubmission.allocateOsResourcesReturn = false;
@ -199,7 +199,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionAllocateFailWhenRingIsStarte
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionSubmitFailWhenRingIsStartedThenExpectRingNotStartedCommandsDispatched) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.submitReturn = false;
bool ret = directSubmission.initialize(true, false);
@ -211,7 +211,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionSubmitFailWhenRingIsStartedT
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsStartedThenExpectNoStartCommandsDispatched) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -224,7 +224,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsStartedThenEx
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsNotStartedThenExpectStartCommandsDispatched) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -238,7 +238,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsNotStartedThe
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsNotStartedSubmitFailThenExpectStartCommandsDispatchedRingNotStarted) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -253,7 +253,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsNotStartedSub
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsNotStartedAndSwitchBufferIsNeededThenExpectRingAllocationChangedStartCommandsDispatched) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -280,7 +280,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStartWhenRingIsNotStartedAnd
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionStopWhenStopRingIsCalledThenExpectStopCommandDispatched) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -302,11 +302,11 @@ HWTEST_F(DirectSubmissionTest,
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> regularDirectSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
size_t regularSizeEnd = regularDirectSubmission.getSizeEnd();
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.allocateResources();
directSubmission.disableMonitorFence = true;
@ -348,7 +348,7 @@ HWTEST_F(DirectSubmissionTest,
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchSemaphoreThenExpectCorrectSizeUsed) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -359,7 +359,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchSemaphoreThenExp
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchStartSectionThenExpectCorrectSizeUsed) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -369,7 +369,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchStartSectionThen
}
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchSwitchRingBufferSectionThenExpectCorrectSizeUsed) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -381,7 +381,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchSwitchRingBuffer
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchFlushSectionThenExpectCorrectSizeUsed) {
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -393,7 +393,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchFlushSectionThen
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchTagUpdateSectionThenExpectCorrectSizeUsed) {
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher>
directSubmission(*pDevice, *osContext);
directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -405,7 +405,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchTagUpdateSection
HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenDispatchEndingSectionThenExpectCorrectSizeUsed) {
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -420,7 +420,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenGetDispatchSizeThenExpec
DebugManagerStateRestore restorer;
DebugManager.flags.DirectSubmissionDisableCacheFlush.set(0);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
size_t expectedSize = directSubmission.getSizeStartSection() +
Dispatcher::getSizeCacheFlush(*directSubmission.hwInfo) +
@ -436,7 +436,7 @@ HWTEST_F(DirectSubmissionTest,
DebugManagerStateRestore restorer;
DebugManager.flags.DirectSubmissionDisableCacheFlush.set(0);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.workloadMode = 1;
size_t expectedSize = Dispatcher::getSizeStoreDwordCommand() +
@ -454,7 +454,7 @@ HWTEST_F(DirectSubmissionTest,
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.workloadMode = 2;
size_t expectedSize = Dispatcher::getSizeCacheFlush(*directSubmission.hwInfo) +
Dispatcher::getSizeMonitorFence(*directSubmission.hwInfo) +
@ -468,7 +468,7 @@ HWTEST_F(DirectSubmissionTest,
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableCacheFlush = true;
size_t expectedSize = directSubmission.getSizeStartSection() +
Dispatcher::getSizeMonitorFence(*directSubmission.hwInfo) +
@ -483,7 +483,7 @@ HWTEST_F(DirectSubmissionTest,
DebugManagerStateRestore restorer;
DebugManager.flags.DirectSubmissionDisableCacheFlush.set(0);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableMonitorFence = true;
size_t expectedSize = directSubmission.getSizeStartSection() +
Dispatcher::getSizeCacheFlush(*directSubmission.hwInfo) +
@ -496,7 +496,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenGetEndSizeThenExpectCorr
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
size_t expectedSize = Dispatcher::getSizeStopCommandBuffer() +
Dispatcher::getSizeCacheFlush(*directSubmission.hwInfo) +
@ -510,7 +510,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionWhenSettingAddressInReturnCo
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -527,7 +527,7 @@ HWTEST_F(DirectSubmissionTest, whenDirectSubmissionInitializedThenExpectCreatedA
std::unique_ptr<MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>> directSubmission =
std::make_unique<MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>>(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission->initialize(false, false);
EXPECT_TRUE(ret);
@ -538,7 +538,7 @@ HWTEST_F(DirectSubmissionTest, whenDirectSubmissionInitializedThenExpectCreatedA
directSubmission = std::make_unique<
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>>(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
ret = directSubmission->initialize(false, false);
EXPECT_TRUE(ret);
@ -549,7 +549,7 @@ HWTEST_F(DirectSubmissionTest, whenDirectSubmissionInitializedThenExpectCreatedA
directSubmission = std::make_unique<
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>>(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
ret = directSubmission->initialize(false, false);
EXPECT_TRUE(ret);
nulledAllocation = directSubmission->semaphores;
@ -677,7 +677,7 @@ HWTEST_F(DirectSubmissionTest,
NEO::IoFunctions::mockFcloseCalled = 0u;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(UllsDefaults::defaultDisableCacheFlush);
EXPECT_FALSE(UllsDefaults::defaultDisableMonitorFence);
EXPECT_TRUE(directSubmission.disableCacheFlush);
@ -712,7 +712,7 @@ HWTEST_F(DirectSubmissionTest,
NEO::IoFunctions::mockFcloseCalled = 0u;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(UllsDefaults::defaultDisableCacheFlush);
EXPECT_FALSE(UllsDefaults::defaultDisableMonitorFence);
EXPECT_TRUE(directSubmission.disableCacheFlush);
@ -750,7 +750,7 @@ HWTEST_F(DirectSubmissionTest,
NEO::IoFunctions::mockVfptrinfCalled = 0u;
NEO::IoFunctions::mockFcloseCalled = 0u;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(UllsDefaults::defaultDisableCacheFlush);
EXPECT_FALSE(UllsDefaults::defaultDisableMonitorFence);
EXPECT_TRUE(directSubmission.disableCacheFlush);
@ -790,7 +790,7 @@ HWTEST_F(DirectSubmissionTest,
NEO::IoFunctions::mockVfptrinfCalled = 0u;
NEO::IoFunctions::mockFcloseCalled = 0u;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
uint32_t expectedSemaphoreValue = directSubmission.currentQueueWorkCount;
EXPECT_TRUE(UllsDefaults::defaultDisableCacheFlush);
EXPECT_FALSE(UllsDefaults::defaultDisableMonitorFence);
@ -886,7 +886,7 @@ HWTEST_F(DirectSubmissionTest,
NEO::IoFunctions::mockVfptrinfCalled = 0u;
NEO::IoFunctions::mockFcloseCalled = 0u;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
uint32_t expectedSemaphoreValue = directSubmission.currentQueueWorkCount;
EXPECT_TRUE(UllsDefaults::defaultDisableCacheFlush);
EXPECT_FALSE(UllsDefaults::defaultDisableMonitorFence);
@ -949,7 +949,7 @@ HWTEST_F(DirectSubmissionTest,
NEO::IoFunctions::mockFcloseCalled = 0u;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_NE(nullptr, directSubmission.diagnostic.get());
EXPECT_EQ(1u, NEO::IoFunctions::mockFopenCalled);
@ -1000,7 +1000,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DirectSubmissionTest,
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -1022,7 +1022,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionTest, givenDebugFlagSetWhenDispatch
using MI_ARB_CHECK = typename FamilyType::MI_ARB_CHECK;
using Dispatcher = BlitterDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.allocateResources();
EXPECT_TRUE(ret);

View File

@ -95,7 +95,7 @@ struct DirectSubmissionDispatchMiMemFenceTest : public DirectSubmissionDispatchB
};
HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenInitializingDirectSubmissionThenEnableMiMemFenceProgramming) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(miMemFenceSupported, directSubmission.miMemFenceRequired);
EXPECT_FALSE(directSubmission.systemMemoryFenceAddressSet);
@ -108,7 +108,7 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenIni
}
HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenDispatchingWithoutInitThenEnableMiMemFenceProgramming) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
FlushStampTracker flushStamp(true);
EXPECT_EQ(miMemFenceSupported, directSubmission.miMemFenceRequired);
@ -126,7 +126,7 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenDis
}
HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenSysMemFenceIsAlreadySentThenDontReprogram) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
FlushStampTracker flushStamp(true);
EXPECT_EQ(miMemFenceSupported, directSubmission.miMemFenceRequired);
@ -145,7 +145,7 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenDebugFlagSetWhenCreatingDi
DebugManagerStateRestore restorer;
DebugManager.flags.DirectSubmissionInsertExtraMiMemFenceCommands.set(0);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_FALSE(directSubmission.miMemFenceRequired);
EXPECT_FALSE(directSubmission.systemMemoryFenceAddressSet);
@ -172,7 +172,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,
ultCsr->createWorkPartitionAllocation(*pDevice);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(directSubmission.partitionConfigSet);
directSubmission.partitionConfigSet = false;
directSubmission.disableMonitorFence = false;
@ -245,11 +245,11 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
DebugManager.flags.DirectSubmissionDisableCacheFlush.set(0);
MockDirectSubmissionHw<FamilyType, Dispatcher> regularDirectSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
size_t regularSizeDispatch = regularDirectSubmission.getSizeDispatch();
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableMonitorFence = true;
bool ret = directSubmission.allocateResources();
@ -296,11 +296,11 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
DebugManager.flags.DirectSubmissionDisableCacheFlush.set(0);
MockDirectSubmissionHw<FamilyType, Dispatcher> regularDirectSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
size_t regularSizeDispatch = regularDirectSubmission.getSizeDispatch();
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableCacheFlush = true;
bool ret = directSubmission.allocateResources();
@ -345,12 +345,12 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
using Dispatcher = RenderDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> regularDirectSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
size_t regularSizeDispatch = regularDirectSubmission.getSizeDispatch();
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.workloadMode = 1;
bool ret = directSubmission.allocateResources();
@ -392,11 +392,11 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> regularDirectSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
size_t regularSizeDispatch = regularDirectSubmission.getSizeDispatch();
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.workloadMode = 2;
bool ret = directSubmission.allocateResources();
@ -432,7 +432,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -474,7 +474,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -511,7 +511,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -550,7 +550,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -588,7 +588,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest, givenDirectSubmissionPrintBuffersWh
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
testing::internal::CaptureStdout();
@ -622,7 +622,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(directSubmission.partitionConfigSet);
directSubmission.activeTiles = 2;
directSubmission.partitionedMode = true;
@ -686,7 +686,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(directSubmission.partitionConfigSet);
directSubmission.activeTiles = 2;
directSubmission.partitionedMode = true;
@ -738,7 +738,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableMonitorFence = false;
bool ret = directSubmission.initialize(true, true);
@ -774,7 +774,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableMonitorFence = false;
bool ret = directSubmission.initialize(true, true);
@ -813,7 +813,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, true);
EXPECT_TRUE(ret);
@ -838,7 +838,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
FlushStampTracker flushStamp(true);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.initialize(true, true);
EXPECT_TRUE(ret);
@ -860,7 +860,7 @@ HWTEST_F(DirectSubmissionDispatchBufferTest, givenDebugFlagSetWhenDispatchingWor
for (int32_t debugFlag : {-1, 0, 1, 2}) {
DebugManager.flags.DirectSubmissionInsertSfenceInstructionPriorToSubmission.set(debugFlag);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice, *osContext);
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice, *osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_TRUE(directSubmission.initialize(true, true));
auto initialCounterValue = CpuIntrinsicsTests::sfenceCounter.load();

View File

@ -20,7 +20,7 @@ XE_HP_CORE_TEST_F(DirectSubmissionTestXE_HP_CORE, givenBlitterUsedWhenDispatchin
using Dispatcher = BlitterDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(sizeof(MI_BATCH_BUFFER_START), directSubmission.getSizePrefetchMitigation());
@ -45,7 +45,7 @@ XE_HP_CORE_TEST_F(DirectSubmissionTestXE_HP_CORE, givenBlitterUsedWhenDispatchin
using Dispatcher = BlitterDispatcher<FamilyType>;
MockDirectSubmissionHw<FamilyType, Dispatcher> directSubmission(*pDevice,
*osContext);
*osContext, pDevice->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(sizeof(MI_ARB_CHECK), directSubmission.getSizeDisablePrefetcher());

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -78,7 +78,7 @@ struct MockDrmDirectSubmission : public DrmDirectSubmission<GfxFamily, Dispatche
using BaseClass::wait;
using BaseClass::workPartitionAllocation;
MockDrmDirectSubmission(Device &device, OsContext &osContext) : DrmDirectSubmission<GfxFamily, Dispatcher>(device, osContext) {
MockDrmDirectSubmission(Device &device, OsContext &osContext, const GraphicsAllocation *globalFenceAllocation) : DrmDirectSubmission<GfxFamily, Dispatcher>(device, osContext, globalFenceAllocation) {
this->disableMonitorFence = false;
}
};
@ -87,7 +87,7 @@ using namespace NEO;
HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenCallingLinuxImplementationThenExpectInitialImplementationValues) {
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> drmDirectSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
auto drm = static_cast<DrmMock *>(executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>());
EXPECT_TRUE(drm->isDirectSubmissionActive());
@ -114,7 +114,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenCallingLinuxImplem
HWTEST_F(DrmDirectSubmissionTest, whenCreateDirectSubmissionThenValidObjectIsReturned) {
auto directSubmission = DirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>::create(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_NE(directSubmission.get(), nullptr);
bool ret = directSubmission->initialize(false, false);
@ -126,7 +126,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenDisabledMonitorFenceWhenDispatchSwitchRin
using Dispatcher = RenderDispatcher<FamilyType>;
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableMonitorFence = true;
directSubmission.ringStart = true;
@ -153,7 +153,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenDisabledMonitorFenceWhenUpdateTagValueThe
using Dispatcher = RenderDispatcher<FamilyType>;
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
directSubmission.disableMonitorFence = true;
directSubmission.ringStart = true;
@ -185,7 +185,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenDirectSubmissionNewResourceTlbFlushWhenDi
DebugManager.flags.DirectSubmissionNewResourceTlbFlush.set(1);
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.allocateResources();
EXPECT_TRUE(ret);
@ -213,7 +213,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenNewResourceBoundhWhenDispatchCommandBuffe
DebugManager.flags.DirectSubmissionNewResourceTlbFlush.set(-1);
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.allocateResources();
EXPECT_TRUE(ret);
@ -244,7 +244,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenNoNewResourceBoundhWhenDispatchCommandBuf
DebugManager.flags.DirectSubmissionNewResourceTlbFlush.set(-1);
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.allocateResources();
EXPECT_TRUE(ret);
@ -274,7 +274,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenDirectSubmissionNewResourceTlbFlusZeroAnd
DebugManager.flags.DirectSubmissionNewResourceTlbFlush.set(0);
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = directSubmission.allocateResources();
EXPECT_TRUE(ret);
@ -300,7 +300,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmDirectSubmissionTest, givenMultipleActiveTilesWh
using Dispatcher = RenderDispatcher<FamilyType>;
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
uint32_t offset = directSubmission.postSyncOffset;
EXPECT_NE(0u, offset);
@ -338,7 +338,7 @@ HWTEST_F(DrmDirectSubmissionTest,
ultCsr->createWorkPartitionAllocation(*device);
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(2u, directSubmission.activeTiles);
EXPECT_TRUE(directSubmission.partitionedMode);
@ -363,7 +363,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenRenderDispatcherAndMultiTileDeviceWhenCre
ultCsr->createWorkPartitionAllocation(*device);
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(1u, directSubmission.activeTiles);
EXPECT_FALSE(directSubmission.partitionedMode);
@ -386,7 +386,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenBlitterDispatcherAndMultiTileDeviceWhenCr
EXPECT_EQ(2u, osContext->getDeviceBitfield().count());
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device.get(),
*osContext.get());
*osContext.get(), device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(1u, directSubmission.activeTiles);
EXPECT_FALSE(directSubmission.partitionedMode);

View File

@ -52,7 +52,7 @@ using WddmDirectSubmissionTest = WddmDirectSubmissionFixture;
HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenDirectIsInitializedAndStartedThenExpectProperCommandsDispatched) {
std::unique_ptr<MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>>> wddmDirectSubmission =
std::make_unique<MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>>>(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(1u, wddmDirectSubmission->commandBufferHeader->NeedsMidBatchPreEmptionSupport);
@ -84,7 +84,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenDirectIsInitializedAndNotStarted
device->setPreemptionMode(PreemptionMode::Disabled);
std::unique_ptr<MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>>> wddmDirectSubmission =
std::make_unique<MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>>>(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(0u, wddmDirectSubmission->commandBufferHeader->NeedsMidBatchPreEmptionSupport);
@ -111,7 +111,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenDirectIsInitializedAndNotStarted
HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSubmitingCmdBufferThenExpectPassWddmContextAndProperHeader) {
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = wddmDirectSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -130,7 +130,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSubmitingCmdBufferThenExpectPass
HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesThenExpectRingMonitorFenceCreatedAndAllocationsResident) {
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = wddmDirectSubmission.allocateResources();
EXPECT_TRUE(ret);
@ -149,7 +149,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesFenceCreation
ASSERT_NE(nullptr, ringBuffer);
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
DirectSubmissionAllocations allocations;
allocations.push_back(ringBuffer);
@ -168,7 +168,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesFenceCreation
HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenAllocateOsResourcesResidencyFailsThenExpectRingMonitorFenceCreatedAndAllocationsNotResident) {
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
wddm->callBaseMakeResident = false;
wddm->makeResidentStatus = false;
@ -190,7 +190,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenGettingTagDataThenExpectContextM
contextFence.currentFenceValue = value;
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
TagData tagData;
wddmDirectSubmission.getTagAddressValue(tagData);
@ -201,7 +201,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenGettingTagDataThenExpectContextM
HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenHandleResidencyThenExpectWddmWaitOnPaginfFenceFromCpuCalled) {
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
wddmDirectSubmission.handleResidency();
@ -216,7 +216,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenHandlingRingBufferCompletionThen
contextFence.currentFenceValue = value;
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
uint64_t completionValue = 0x12345679ull;
wddmDirectSubmission.handleCompletionRingBuffer(completionValue, contextFence);
@ -230,7 +230,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenHandlingRingBufferCompletionThen
HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSwitchingRingBufferStartedThenExpectDispatchSwitchCommandsLinearStreamUpdated) {
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = wddmDirectSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -256,7 +256,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSwitchingRingBufferStartedThenEx
HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSwitchingRingBufferNotStartedThenExpectNoSwitchCommandsLinearStreamUpdated) {
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = wddmDirectSubmission.initialize(false, false);
EXPECT_TRUE(ret);
@ -283,7 +283,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSwitchingRingBufferStartedAndWai
using RingBufferUse = typename MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>>::RingBufferUse;
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
bool ret = wddmDirectSubmission.initialize(true, false);
EXPECT_TRUE(ret);
@ -319,7 +319,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenUpdatingTagValueThenExpectComple
contextFence.currentFenceValue = value;
MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
uint64_t actualTagValue = wddmDirectSubmission.updateTagValue();
EXPECT_EQ(value, actualTagValue);
@ -348,7 +348,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmResidencyEnabledWhenCreatingDestroyi
std::unique_ptr<MockWddmDirectSubmission<FamilyType, Dispatcher>> wddmSubmission =
std::make_unique<MockWddmDirectSubmission<FamilyType, Dispatcher>>(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
EXPECT_EQ(1u, NEO::IoFunctions::mockFopenCalled);
EXPECT_EQ(2u, NEO::IoFunctions::mockVfptrinfCalled);
@ -375,7 +375,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmResidencyEnabledWhenAllocatingResour
NEO::IoFunctions::mockFcloseCalled = 0u;
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
wddm->callBaseMakeResident = true;
wddm->createPagingFenceLogger();
@ -406,7 +406,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmResidencyEnabledWhenHandleResidencyT
NEO::IoFunctions::mockFcloseCalled = 0u;
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
wddm->createPagingFenceLogger();
EXPECT_EQ(1u, NEO::IoFunctions::mockFopenCalled);
@ -435,7 +435,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmResidencyEnabledWhenSubmitToGpuThenS
NEO::IoFunctions::mockFcloseCalled = 0u;
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device.get(),
*osContext);
*osContext, device->getDefaultEngine().commandStreamReceiver->getGlobalFenceAllocation());
wddm->createPagingFenceLogger();
EXPECT_EQ(1u, NEO::IoFunctions::mockFopenCalled);

View File

@ -81,12 +81,12 @@ struct MockWddmCsrL0 : public WddmCommandStreamReceiver<GfxFamily> {
if (DebugManager.flags.EnableDirectSubmission.get() == 1) {
if (!initBlitterDirectSubmission) {
directSubmission = std::make_unique<
MockWddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>>(device, osContext);
MockWddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>>(device, osContext, globalFenceAllocation);
ret = directSubmission->initialize(true, false);
this->dispatchMode = DispatchMode::ImmediateDispatch;
} else {
blitterDirectSubmission = std::make_unique<
MockWddmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>>(device, osContext);
MockWddmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>>(device, osContext, globalFenceAllocation);
blitterDirectSubmission->initialize(true, false);
}
}