Enable batching on Drm CSR when local memory is enabled

Change-Id: I7504b82307f338343a799cb0370ba37f9722406f
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-05-15 13:52:11 +02:00
committed by sys_ocldev
parent 424de72f38
commit c4c7d72aa5
3 changed files with 43 additions and 1 deletions

View File

@ -1441,6 +1441,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithSingleBuffer
template <typename GfxFamily>
struct MockDrmCsr : public DrmCommandStreamReceiver<GfxFamily> {
using DrmCommandStreamReceiver<GfxFamily>::DrmCommandStreamReceiver;
using DrmCommandStreamReceiver<GfxFamily>::dispatchMode;
};
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreatePageTableMngrIsCalledThenCreatePageTableManager) {
@ -1454,6 +1455,33 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreate
EXPECT_EQ(executionEnvironment.rootDeviceEnvironments[1]->pageTableManager.get(), pageTableManager);
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenLocalMemoryEnabledWhenCreatingDrmCsrThenEnableBatching) {
{
DebugManagerStateRestore restore;
DebugManager.flags.EnableLocalMemory.set(1);
MockDrmCsr<FamilyType> csr1(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive);
EXPECT_EQ(DispatchMode::BatchedDispatch, csr1.dispatchMode);
DebugManager.flags.CsrDispatchMode.set(static_cast<int32_t>(DispatchMode::ImmediateDispatch));
MockDrmCsr<FamilyType> csr2(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive);
EXPECT_EQ(DispatchMode::ImmediateDispatch, csr2.dispatchMode);
}
{
DebugManagerStateRestore restore;
DebugManager.flags.EnableLocalMemory.set(0);
MockDrmCsr<FamilyType> csr1(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive);
EXPECT_EQ(DispatchMode::ImmediateDispatch, csr1.dispatchMode);
DebugManager.flags.CsrDispatchMode.set(static_cast<int32_t>(DispatchMode::BatchedDispatch));
MockDrmCsr<FamilyType> csr2(executionEnvironment, 0, gemCloseWorkerMode::gemCloseWorkerInactive);
EXPECT_EQ(DispatchMode::BatchedDispatch, csr2.dispatchMode);
}
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenPageTableManagerAndMapTrueWhenUpdateAuxTableIsCalledThenItReturnsTrue) {
auto mockMngr = new MockGmmPageTableMngr();
executionEnvironment.rootDeviceEnvironments[0]->pageTableManager.reset(mockMngr);

View File

@ -126,6 +126,7 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenPropertiesWithClQueueSlic
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
dispatchFlags.sliceCount = commandQueue->getSliceCount();
dispatchFlags.implicitFlush = true;
mockCsr->flushTask(commandStream,
0u,
@ -170,6 +171,7 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenSameSliceCountAsRecentlyS
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
dispatchFlags.sliceCount = commandQueue->getSliceCount();
dispatchFlags.implicitFlush = true;
mockCsr->lastSentSliceCount = newSliceCount;
mockCsr->flushTask(commandStream,