mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Kmd notify improvements [1/n]: Quick KMD sleep optimization
- KmdNotifyProperties struct for CapabilityTable that can be extended by incoming KmdNotify related optimizations - Quick KMD sleep optimization that is called from async events handler - Optimization makes a taskCount check in busy loop with much smaller delay than basic version of KMD Notify optimization Change-Id: I60c851c59895f0cf9de1e1f21e755a8b4c2fe900
This commit is contained in:
committed by
sys_ocldev
parent
029094437a
commit
516082e7c5
@@ -646,7 +646,7 @@ HWTEST_F(CommandQueueCSTest, getCSShouldReturnACSWithEnoughSizeCSRTraffic) {
|
||||
struct KmdNotifyTests : public ::testing::Test {
|
||||
|
||||
void SetUp() override {
|
||||
resetObjects(1, 1);
|
||||
resetObjects(1, 1, 1, 2);
|
||||
*device->getTagAddress() = taskCountToWait;
|
||||
}
|
||||
|
||||
@@ -656,7 +656,8 @@ struct KmdNotifyTests : public ::testing::Test {
|
||||
DeviceFactory::releaseDevices();
|
||||
}
|
||||
|
||||
void resetObjects(int32_t overrideEnable, int32_t overrideTimeout) {
|
||||
void resetObjects(int32_t overrideKmdNotifyEnable, int32_t overrideKmdNotifyDelay,
|
||||
int overrideQuickKmdSleepEnable, int32_t overrideQuickKmdSleepDelay) {
|
||||
if (cmdQ) {
|
||||
delete cmdQ;
|
||||
}
|
||||
@@ -665,8 +666,10 @@ struct KmdNotifyTests : public ::testing::Test {
|
||||
DeviceFactory::releaseDevices();
|
||||
}
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.OverrideEnableKmdNotify.set(overrideEnable);
|
||||
DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.set(overrideTimeout);
|
||||
DebugManager.flags.OverrideEnableKmdNotify.set(overrideKmdNotifyEnable);
|
||||
DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.set(overrideKmdNotifyDelay);
|
||||
DebugManager.flags.OverrideEnableQuickKmdSleep.set(overrideQuickKmdSleepEnable);
|
||||
DebugManager.flags.OverrideQuickKmdSleepDelayMicroseconds.set(overrideQuickKmdSleepDelay);
|
||||
size_t numDevices;
|
||||
HardwareInfo *hwInfo = nullptr;
|
||||
DeviceFactory::getDevices(&hwInfo, numDevices);
|
||||
@@ -702,18 +705,18 @@ HWTEST_F(KmdNotifyTests, givenTaskCountWhenWaitUntilCompletionCalledThenAlwaysTr
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(true, 1, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(false, 1, taskCountToWait)).Times(0);
|
||||
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait);
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait, false);
|
||||
}
|
||||
|
||||
HWTEST_F(KmdNotifyTests, givenTaskCountAndKmdNotifyDisabledWhenWaitUntilCompletionCalledThenTryCpuPollingWithoutTimeout) {
|
||||
resetObjects(0, 0);
|
||||
resetObjects(0, 0, 0, 0);
|
||||
auto csr = new ::testing::NiceMock<MyCsr<FamilyType>>(device->getHardwareInfo());
|
||||
device->resetCommandStreamReceiver(csr);
|
||||
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(false, 0, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
|
||||
EXPECT_CALL(*csr, waitForFlushStamp(::testing::_)).Times(0);
|
||||
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait);
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait, false);
|
||||
}
|
||||
|
||||
HWTEST_F(KmdNotifyTests, givenNotReadyTaskCountWhenWaitUntilCompletionCalledThenTryCpuPollingAndKmdWait) {
|
||||
@@ -727,7 +730,7 @@ HWTEST_F(KmdNotifyTests, givenNotReadyTaskCountWhenWaitUntilCompletionCalledThen
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(false, 1, taskCountToWait)).Times(1).WillOnce(::testing::Return(false));
|
||||
|
||||
//we have unrecoverable for this case, this will throw.
|
||||
EXPECT_THROW(cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait), std::exception);
|
||||
EXPECT_THROW(cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait, false), std::exception);
|
||||
}
|
||||
|
||||
HWTEST_F(KmdNotifyTests, givenReadyTaskCountWhenWaitUntilCompletionCalledThenTryCpuPollingAndDontCallKmdWait) {
|
||||
@@ -738,7 +741,38 @@ HWTEST_F(KmdNotifyTests, givenReadyTaskCountWhenWaitUntilCompletionCalledThenTry
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(true, 1, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
|
||||
EXPECT_CALL(*csr, waitForFlushStamp(::testing::_)).Times(0);
|
||||
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait);
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait, false);
|
||||
}
|
||||
|
||||
HWTEST_F(KmdNotifyTests, givenDefaultArgumentWhenWaitUntilCompleteIsCalledThenDisableQuickKmdSleep) {
|
||||
auto csr = new ::testing::NiceMock<MyCsr<FamilyType>>(device->getHardwareInfo());
|
||||
device->resetCommandStreamReceiver(csr);
|
||||
auto expectedTimeout = device->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds;
|
||||
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(true, expectedTimeout, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
|
||||
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait, false);
|
||||
}
|
||||
|
||||
HWTEST_F(KmdNotifyTests, givenEnabledQuickSleepWhenWaitUntilCompleteIsCalledThenChangeDelayValue) {
|
||||
auto csr = new ::testing::NiceMock<MyCsr<FamilyType>>(device->getHardwareInfo());
|
||||
device->resetCommandStreamReceiver(csr);
|
||||
auto expectedTimeout = device->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds;
|
||||
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(true, expectedTimeout, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
|
||||
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait, true);
|
||||
}
|
||||
|
||||
HWTEST_F(KmdNotifyTests, givenDisabledQuickSleepWhenWaitUntilCompleteWithQuickSleepRequestIsCalledThenUseBaseDelayValue) {
|
||||
resetObjects(1, 1, 0, 0);
|
||||
auto csr = new ::testing::NiceMock<MyCsr<FamilyType>>(device->getHardwareInfo());
|
||||
device->resetCommandStreamReceiver(csr);
|
||||
auto expectedTimeout = device->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds;
|
||||
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(true, expectedTimeout, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
|
||||
|
||||
cmdQ->waitUntilComplete(taskCountToWait, flushStampToWait, true);
|
||||
}
|
||||
|
||||
HWTEST_F(KmdNotifyTests, givenNotReadyTaskCountWhenPollForCompletionCalledThenTimeout) {
|
||||
@@ -766,11 +800,62 @@ HWTEST_F(KmdNotifyTests, givenZeroFlushStampWhenWaitIsCalledThenDisableTimeout)
|
||||
auto csr = new ::testing::NiceMock<MyCsr<FamilyType>>(device->getHardwareInfo());
|
||||
device->resetCommandStreamReceiver(csr);
|
||||
|
||||
EXPECT_TRUE(device->getHardwareInfo().capabilityTable.enableKmdNotify);
|
||||
EXPECT_TRUE(device->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(false, ::testing::_, taskCountToWait)).Times(1).WillOnce(::testing::Return(true));
|
||||
EXPECT_CALL(*csr, waitForFlushStamp(::testing::_)).Times(0);
|
||||
|
||||
csr->waitForTaskCountWithKmdNotifyFallback(taskCountToWait, 0);
|
||||
csr->waitForTaskCountWithKmdNotifyFallback(taskCountToWait, 0, false);
|
||||
}
|
||||
|
||||
struct WaitForQueueCompletionTests : public ::testing::Test {
|
||||
template <typename Family>
|
||||
struct MyCmdQueue : public CommandQueueHw<Family> {
|
||||
MyCmdQueue(Context *context, Device *device) : CommandQueueHw<Family>(context, device, nullptr){};
|
||||
void waitUntilComplete(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep) override {
|
||||
requestedUseQuickKmdSleep = useQuickKmdSleep;
|
||||
waitUntilCompleteCounter++;
|
||||
}
|
||||
bool isQueueBlocked() override {
|
||||
return false;
|
||||
}
|
||||
bool requestedUseQuickKmdSleep = false;
|
||||
uint32_t waitUntilCompleteCounter = 0;
|
||||
};
|
||||
|
||||
void SetUp() override {
|
||||
device.reset(Device::create<MockDevice>(*platformDevices));
|
||||
context.reset(new MockContext(device.get()));
|
||||
}
|
||||
|
||||
std::unique_ptr<MockDevice> device;
|
||||
std::unique_ptr<MockContext> context;
|
||||
};
|
||||
|
||||
HWTEST_F(WaitForQueueCompletionTests, givenBlockingCallAndUnblockedQueueWhenEnqueuedThenCallWaitWithoutQuickKmdSleepRequest) {
|
||||
std::unique_ptr<MyCmdQueue<FamilyType>> cmdQ(new MyCmdQueue<FamilyType>(context.get(), device.get()));
|
||||
uint32_t tmpPtr = 0;
|
||||
auto buffer = std::unique_ptr<Buffer>(BufferHelper<>::create(context.get()));
|
||||
cmdQ->enqueueReadBuffer(buffer.get(), CL_TRUE, 0, 1, &tmpPtr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(1u, cmdQ->waitUntilCompleteCounter);
|
||||
EXPECT_FALSE(cmdQ->requestedUseQuickKmdSleep);
|
||||
}
|
||||
|
||||
HWTEST_F(WaitForQueueCompletionTests, givenBlockingCallAndBlockedQueueWhenEnqueuedThenCallWaitWithoutQuickKmdSleepRequest) {
|
||||
std::unique_ptr<MyCmdQueue<FamilyType>> cmdQ(new MyCmdQueue<FamilyType>(context.get(), device.get()));
|
||||
std::unique_ptr<Event> blockingEvent(new Event(cmdQ.get(), CL_COMMAND_NDRANGE_KERNEL, 0, 0));
|
||||
cl_event clBlockingEvent = blockingEvent.get();
|
||||
uint32_t tmpPtr = 0;
|
||||
auto buffer = std::unique_ptr<Buffer>(BufferHelper<>::create(context.get()));
|
||||
cmdQ->enqueueReadBuffer(buffer.get(), CL_TRUE, 0, 1, &tmpPtr, 1, &clBlockingEvent, nullptr);
|
||||
EXPECT_EQ(1u, cmdQ->waitUntilCompleteCounter);
|
||||
EXPECT_FALSE(cmdQ->requestedUseQuickKmdSleep);
|
||||
}
|
||||
|
||||
HWTEST_F(WaitForQueueCompletionTests, whenFinishIsCalledThenCallWaitWithoutQuickKmdSleepRequest) {
|
||||
std::unique_ptr<MyCmdQueue<FamilyType>> cmdQ(new MyCmdQueue<FamilyType>(context.get(), device.get()));
|
||||
cmdQ->finish(false);
|
||||
EXPECT_EQ(1u, cmdQ->waitUntilCompleteCounter);
|
||||
EXPECT_FALSE(cmdQ->requestedUseQuickKmdSleep);
|
||||
}
|
||||
|
||||
constexpr char sipPattern[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 39, 41};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -47,7 +47,7 @@ class AsyncEventsHandlerTests : public ::testing::Test {
|
||||
this->updateTaskCount(taskCount);
|
||||
}
|
||||
|
||||
MOCK_METHOD1(wait, bool(bool blocking));
|
||||
MOCK_METHOD2(wait, bool(bool blocking, bool quickKmdSleep));
|
||||
};
|
||||
|
||||
static void CL_CALLBACK callbackFcn(cl_event e, cl_int status, void *data) {
|
||||
@@ -349,19 +349,19 @@ TEST_F(AsyncEventsHandlerTests, givenEventWithoutCallbacksWhenProcessedThenDontR
|
||||
event2->setStatus(CL_COMPLETE);
|
||||
}
|
||||
|
||||
TEST_F(AsyncEventsHandlerTests, givenSleepCandidateWhenProcessedThenCallWait) {
|
||||
TEST_F(AsyncEventsHandlerTests, givenSleepCandidateWhenProcessedThenCallWaitWithQuickKmdSleepRequest) {
|
||||
event1->setTaskStamp(0, 1);
|
||||
event1->addCallback(&this->callbackFcn, CL_COMPLETE, &counter);
|
||||
handler->registerEvent(event1);
|
||||
handler->allowAsyncProcess.store(true);
|
||||
|
||||
// break infinite loop after first iteartion
|
||||
auto unsetAsyncFlag = [&](bool arg) {
|
||||
auto unsetAsyncFlag = [&](bool blocking, bool quickKmdSleep) {
|
||||
handler->allowAsyncProcess.store(false);
|
||||
return true;
|
||||
};
|
||||
|
||||
EXPECT_CALL(*event1, wait(true)).Times(1).WillOnce(Invoke(unsetAsyncFlag));
|
||||
EXPECT_CALL(*event1, wait(true, true)).Times(1).WillOnce(Invoke(unsetAsyncFlag));
|
||||
|
||||
handler->asyncProcess();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -88,8 +88,8 @@ struct InternalsEventTest
|
||||
};
|
||||
|
||||
struct MyUserEvent : public VirtualEvent {
|
||||
bool wait(bool blocking) override {
|
||||
return VirtualEvent::wait(blocking);
|
||||
bool wait(bool blocking, bool quickKmdSleep) override {
|
||||
return VirtualEvent::wait(blocking, quickKmdSleep);
|
||||
};
|
||||
uint32_t getTaskLevel() override {
|
||||
return VirtualEvent::getTaskLevel();
|
||||
|
||||
@@ -388,7 +388,7 @@ TEST_F(EventTest, GetEventInfo_InvalidParam) {
|
||||
|
||||
TEST_F(EventTest, Event_Wait_NonBlocking) {
|
||||
Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 3, Event::eventNotReady);
|
||||
auto result = event.wait(false);
|
||||
auto result = event.wait(false, false);
|
||||
EXPECT_FALSE(result);
|
||||
}
|
||||
|
||||
@@ -1415,6 +1415,54 @@ TEST_F(EventTest, addChildForEventCompleted) {
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(EventTest, givenQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestToWaitingFunction) {
|
||||
struct MyCsr : public UltCommandStreamReceiver<FamilyType> {
|
||||
MyCsr(const HardwareInfo &hwInfo) : UltCommandStreamReceiver<FamilyType>(hwInfo) {}
|
||||
MOCK_METHOD3(waitForCompletionWithTimeout, bool(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait));
|
||||
};
|
||||
HardwareInfo localHwInfo = pDevice->getHardwareInfo();
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify = true;
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleep = true;
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 1;
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds = 2;
|
||||
|
||||
auto csr = new ::testing::NiceMock<MyCsr>(localHwInfo);
|
||||
pDevice->resetCommandStreamReceiver(csr);
|
||||
|
||||
Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
|
||||
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(::testing::_,
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds, ::testing::_))
|
||||
.Times(1)
|
||||
.WillOnce(::testing::Return(true));
|
||||
|
||||
event.wait(true, true);
|
||||
}
|
||||
|
||||
HWTEST_F(EventTest, givenNonQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestToWaitingFunction) {
|
||||
struct MyCsr : public UltCommandStreamReceiver<FamilyType> {
|
||||
MyCsr(const HardwareInfo &hwInfo) : UltCommandStreamReceiver<FamilyType>(hwInfo) {}
|
||||
MOCK_METHOD3(waitForCompletionWithTimeout, bool(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait));
|
||||
};
|
||||
HardwareInfo localHwInfo = pDevice->getHardwareInfo();
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify = true;
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleep = true;
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 1;
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds = 2;
|
||||
|
||||
auto csr = new ::testing::NiceMock<MyCsr>(localHwInfo);
|
||||
pDevice->resetCommandStreamReceiver(csr);
|
||||
|
||||
Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0);
|
||||
|
||||
EXPECT_CALL(*csr, waitForCompletionWithTimeout(::testing::_,
|
||||
localHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds, ::testing::_))
|
||||
.Times(1)
|
||||
.WillOnce(::testing::Return(true));
|
||||
|
||||
event.wait(true, false);
|
||||
}
|
||||
|
||||
HWTEST_F(InternalsEventTest, givenCommandWhenSubmitCalledThenUpdateFlushStamp) {
|
||||
auto pCmdQ = std::unique_ptr<CommandQueue>(new CommandQueue(mockContext, pDevice, 0));
|
||||
MockEvent<Event> *event = new MockEvent<Event>(pCmdQ.get(), CL_COMMAND_MARKER, 0, 0);
|
||||
|
||||
@@ -151,7 +151,7 @@ TEST(UserEvent, initialUserEventStateIsNotReadyForSubmission) {
|
||||
TEST(UserEvent, GIVENUserEventWHENgetTaskLevelTHENSuccess) {
|
||||
MyUserEvent uEvent;
|
||||
EXPECT_EQ(0U, uEvent.getTaskLevel());
|
||||
EXPECT_FALSE(uEvent.wait(false));
|
||||
EXPECT_FALSE(uEvent.wait(false, false));
|
||||
}
|
||||
|
||||
TEST(UserEvent, userEventAfterSetingStatusIsReadyForSubmission) {
|
||||
@@ -930,7 +930,7 @@ TEST_F(EventTests, waitForEventsDestroysTemporaryAllocations) {
|
||||
|
||||
TEST_F(EventTest, UserEvent_Wait_NonBlocking) {
|
||||
UserEvent event;
|
||||
auto result = event.wait(false);
|
||||
auto result = event.wait(false, false);
|
||||
EXPECT_FALSE(result);
|
||||
}
|
||||
|
||||
@@ -1083,4 +1083,4 @@ TEST_F(EventTests, givenUserEventWhenSetStatusIsDoneThenDeviceMutextisAcquired)
|
||||
mockedEvent mockEvent(this->context);
|
||||
clSetUserEventStatus(&mockEvent, CL_COMPLETE);
|
||||
EXPECT_TRUE(mockEvent.mutexProperlyAcquired);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,10 @@ GEN8TEST_F(Gen8DeviceCaps, whitelistedRegister) {
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, kmdNotifyMechanism) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, compression) {
|
||||
|
||||
@@ -85,6 +85,8 @@ BXTTEST_F(BxtUsDeviceIdTest, isSimulationCap) {
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtUsDeviceIdTest, kmdNotifyMechanism) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,10 @@ CFLTEST_F(CflDeviceCaps, reportsOcl21) {
|
||||
}
|
||||
|
||||
CFLTEST_F(CflDeviceCaps, kmdNotifyMechanism) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
}
|
||||
|
||||
CFLTEST_F(CflDeviceCaps, GivenCFLWhenCheckftr64KBpagesThenTrue) {
|
||||
|
||||
@@ -74,8 +74,10 @@ GLKTEST_F(GlkUsDeviceIdTest, isSimulationCap) {
|
||||
}
|
||||
|
||||
GLKTEST_F(GlkUsDeviceIdTest, kmdNotifyMechanism) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
}
|
||||
|
||||
GLKTEST_F(GlkUsDeviceIdTest, GivenGLKWhenCheckftr64KBpagesThenFalse) {
|
||||
|
||||
@@ -34,8 +34,10 @@ KBLTEST_F(KblDeviceCaps, reportsOcl21) {
|
||||
}
|
||||
|
||||
KBLTEST_F(KblDeviceCaps, kmdNotifyMechanism) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
}
|
||||
|
||||
KBLTEST_F(KblDeviceCaps, GivenKBLWhenCheckftr64KBpagesThenTrue) {
|
||||
|
||||
@@ -82,8 +82,10 @@ SKLTEST_F(SklUsDeviceIdTest, isSimulationCap) {
|
||||
}
|
||||
|
||||
SKLTEST_F(SklUsDeviceIdTest, kmdNotifyMechanism) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
}
|
||||
|
||||
SKLTEST_F(SklUsDeviceIdTest, GivenSKLWhenCheckftr64KBpagesThenTrue) {
|
||||
|
||||
@@ -444,7 +444,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver {
|
||||
void addPipeControl(LinearStream &commandStream, bool dcFlush) override {
|
||||
}
|
||||
|
||||
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait) override {
|
||||
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool quickKmdSleep) override {
|
||||
}
|
||||
|
||||
CompletionStamp flushTask(
|
||||
|
||||
@@ -223,7 +223,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
|
||||
}
|
||||
}
|
||||
|
||||
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait) override {
|
||||
void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool quickKmdSleep) override {
|
||||
}
|
||||
|
||||
void addPipeControl(LinearStream &commandStream, bool dcFlush) override {
|
||||
|
||||
@@ -102,18 +102,26 @@ TEST_F(DeviceFactoryTest, overrideKmdNotifySettings) {
|
||||
|
||||
bool success = DeviceFactory::getDevices(&hwInfoReference, numDevices);
|
||||
ASSERT_TRUE(success);
|
||||
auto refEnableKmdNotify = hwInfoReference->capabilityTable.enableKmdNotify;
|
||||
auto refDelayKmdNotifyMicroseconds = hwInfoReference->capabilityTable.delayKmdNotifyMicroseconds;
|
||||
auto refEnableKmdNotify = hwInfoReference->capabilityTable.kmdNotifyProperties.enableKmdNotify;
|
||||
auto refDelayKmdNotifyMicroseconds = hwInfoReference->capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds;
|
||||
auto refEnableQuickKmdSleep = hwInfoReference->capabilityTable.kmdNotifyProperties.enableQuickKmdSleep;
|
||||
auto refDelayQuickKmdSleepMicroseconds = hwInfoReference->capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds;
|
||||
DeviceFactory::releaseDevices();
|
||||
|
||||
DebugManager.flags.OverrideEnableKmdNotify.set(!refEnableKmdNotify);
|
||||
DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.set(static_cast<int32_t>(refDelayKmdNotifyMicroseconds) + 10);
|
||||
|
||||
DebugManager.flags.OverrideEnableQuickKmdSleep.set(!refEnableQuickKmdSleep);
|
||||
DebugManager.flags.OverrideQuickKmdSleepDelayMicroseconds.set(static_cast<int32_t>(refDelayQuickKmdSleepMicroseconds) + 11);
|
||||
|
||||
success = DeviceFactory::getDevices(&hwInfoOverriden, numDevices);
|
||||
ASSERT_TRUE(success);
|
||||
|
||||
EXPECT_EQ(!refEnableKmdNotify, hwInfoOverriden->capabilityTable.enableKmdNotify);
|
||||
EXPECT_EQ(refDelayKmdNotifyMicroseconds + 10, hwInfoOverriden->capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_EQ(!refEnableKmdNotify, hwInfoOverriden->capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(refDelayKmdNotifyMicroseconds + 10, hwInfoOverriden->capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
|
||||
EXPECT_EQ(!refEnableQuickKmdSleep, hwInfoOverriden->capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(refDelayQuickKmdSleepMicroseconds + 11, hwInfoOverriden->capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
|
||||
DeviceFactory::releaseDevices();
|
||||
}
|
||||
@@ -142,4 +150,4 @@ TEST_F(DeviceFactoryTest, givenPointerToHwInfoWhenGetDevicedCalledThenRequiedSur
|
||||
|
||||
EXPECT_EQ(hwInfo->pSysInfo->CsrSizeInMb * MemoryConstants::megaByte, hwInfo->capabilityTable.requiredPreemptionSurfaceSize);
|
||||
DeviceFactory::releaseDevices();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,9 +110,7 @@ TEST(WddmTestEnumAdapters, expectTrue) {
|
||||
}
|
||||
|
||||
TEST(WddmTestEnumAdapters, givenEmptyHardwareInfoWhenEnumAdapterIsCalledThenCapabilityTableIsSet) {
|
||||
HardwareInfo outHwInfo;
|
||||
|
||||
memset(&outHwInfo, 0, sizeof(outHwInfo));
|
||||
HardwareInfo outHwInfo = {};
|
||||
|
||||
auto hwInfo = *platformDevices[0];
|
||||
std::unique_ptr<OsLibrary> mockGdiDll(setAdapterInfo(hwInfo.pPlatform, hwInfo.pSysInfo));
|
||||
@@ -127,7 +125,10 @@ TEST(WddmTestEnumAdapters, givenEmptyHardwareInfoWhenEnumAdapterIsCalledThenCapa
|
||||
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.defaultProfilingTimerResolution, hwInfo.capabilityTable.defaultProfilingTimerResolution);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.clVersionSupport, hwInfo.capabilityTable.clVersionSupport);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.delayKmdNotifyMicroseconds, hwInfo.capabilityTable.delayKmdNotifyMicroseconds);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify, hwInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds, hwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleep, hwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds, hwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
|
||||
delete outHwInfo.pPlatform;
|
||||
delete outHwInfo.pSkuTable;
|
||||
|
||||
@@ -41,6 +41,8 @@ EnableForcePin = false
|
||||
CsrDispatchMode = 0
|
||||
OverrideEnableKmdNotify = -1
|
||||
OverrideKmdNotifyDelayMs = -1
|
||||
OverrideEnableQuickKmdSleep = -1
|
||||
OverrideQuickKmdSleepDelayMicroseconds = -1
|
||||
Enable64kbpages = -1
|
||||
NodeOrdinal = -1
|
||||
ProductFamilyOverride = unk
|
||||
|
||||
Reference in New Issue
Block a user