Make enqueue blocking if parent kernel requires aux translation

Change-Id: I678e1045d84f15e30223a99438bbb7057e172cff
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2018-08-29 14:16:04 +02:00
parent 83237bd253
commit 41914d3058
2 changed files with 31 additions and 0 deletions

View File

@@ -1589,7 +1589,13 @@ struct EnqueueAuxKernelTests : public EnqueueKernelTest {
dispatchAuxTranslationInputs.emplace_back(lastKernel, multiDispatchInfo.size(), buffersForAuxTranslation, auxTranslationDirection);
}
void waitUntilComplete(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep) override {
waitCalled++;
CommandQueueHw<FamilyType>::waitUntilComplete(taskCountToWait, flushStampToWait, useQuickKmdSleep);
}
std::vector<std::tuple<Kernel *, size_t, BuffersForAuxTranslation, AuxTranslationDirection>> dispatchAuxTranslationInputs;
uint32_t waitCalled = 0;
};
};
@@ -1737,3 +1743,25 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelWhenAuxTrans
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, buffer2.getGraphicsAllocation()->getAllocationType());
}
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelWhenAuxTranslationIsRequiredThenMakeEnqueueBlocking) {
if (pDevice->getSupportedClVersion() >= 20) {
MyCmdQ<FamilyType> cmdQ(context, pDevice);
size_t gws[3] = {1, 0, 0};
cl_queue_properties queueProperties = {};
auto mockDevQueue = std::make_unique<MockDeviceQueueHw<FamilyType>>(context, pDevice, queueProperties);
context->setDefaultDeviceQueue(mockDevQueue.get());
std::unique_ptr<MockParentKernel> parentKernel(MockParentKernel::create(*context, false, false, false, false, false));
parentKernel->initialize();
parentKernel->auxTranslationRequired = false;
cmdQ.enqueueKernel(parentKernel.get(), 1, nullptr, gws, nullptr, 0, nullptr, nullptr);
EXPECT_EQ(0u, cmdQ.waitCalled);
mockDevQueue->getIgilQueue()->m_controls.m_CriticalSection = 0;
parentKernel->auxTranslationRequired = true;
cmdQ.enqueueKernel(parentKernel.get(), 1, nullptr, gws, nullptr, 0, nullptr, nullptr);
EXPECT_EQ(1u, cmdQ.waitCalled);
}
}