fix xe: add missing wait on fence before unbind

Related-To: NEO-7306
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-03-17 13:00:44 +00:00
committed by Compute-Runtime-Automation
parent 2d0c61aa33
commit 415d2cb121
9 changed files with 57 additions and 16 deletions

View File

@@ -510,3 +510,13 @@ TEST_F(IoctlPrelimHelperTests, givenEnabledForceNonblockingExecbufferCallsFlagWh
EXPECT_TRUE(ioctlHelper.checkIfIoctlReinvokeRequired(EAGAIN, DrmIoctl::GemVmBind));
EXPECT_TRUE(ioctlHelper.checkIfIoctlReinvokeRequired(EBUSY, DrmIoctl::GemExecbuffer2));
}
TEST_F(IoctlPrelimHelperTests, whenChangingBufferBindingThenWaitIsNeededOnlyBeforeBind) {
MockExecutionEnvironment executionEnvironment{};
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
IoctlHelperPrelim20 ioctlHelper{*drm};
EXPECT_TRUE(ioctlHelper.isWaitBeforeBindRequired(true));
EXPECT_FALSE(ioctlHelper.isWaitBeforeBindRequired(false));
}

View File

@@ -21,6 +21,16 @@ TEST(IoctlHelperUpstreamTest, whenGettingVmBindAvailabilityThenFalseIsReturned)
IoctlHelperUpstream ioctlHelper{*drm};
EXPECT_FALSE(ioctlHelper.isVmBindAvailable());
}
TEST(IoctlHelperUpstreamTest, whenChangingBufferBindingThenWaitIsNeverNeeded) {
MockExecutionEnvironment executionEnvironment{};
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
IoctlHelperUpstream ioctlHelper{*drm};
EXPECT_FALSE(ioctlHelper.isWaitBeforeBindRequired(true));
EXPECT_FALSE(ioctlHelper.isWaitBeforeBindRequired(false));
}
TEST(IoctlHelperUpstreamTest, whenGettingIoctlRequestStringThenProperStringIsReturned) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);

View File

@@ -36,6 +36,16 @@ TEST(IoctlHelperXeTest, givenXeDrmVersionsWhenGettingIoctlHelperThenValidIoctlHe
EXPECT_NE(nullptr, xeIoctlHelper);
}
TEST(IoctlHelperXeTest, whenChangingBufferBindingThenWaitIsNeededAlways) {
MockExecutionEnvironment executionEnvironment{};
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
IoctlHelperXe ioctlHelper{*drm};
EXPECT_TRUE(ioctlHelper.isWaitBeforeBindRequired(true));
EXPECT_TRUE(ioctlHelper.isWaitBeforeBindRequired(false));
}
TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingAnyMethodThenDummyValueIsReturned) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};