Do not call GEM_WAIT while direct submission active

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2021-02-16 15:25:26 +00:00 committed by Compute-Runtime-Automation
parent 0f78357e93
commit 9d3b759d29
3 changed files with 12 additions and 1 deletions

View File

@ -111,6 +111,13 @@ TEST_F(DrmBufferObjectTest, GivenInvalidTilingWhenSettingTilingThenCallFails) {
EXPECT_FALSE(ret);
}
TEST_F(DrmBufferObjectTest, givenDirectSubmissionActiveWhenCallWaitThenNoIoctlIsCalled) {
mock->setDirectSubmissionActive(true);
mock->ioctl_expected.total = 0;
auto ret = bo->wait(-1);
EXPECT_FALSE(ret);
}
TEST_F(DrmBufferObjectTest, givenAddressThatWhenSizeIsAddedCrosses32BitBoundaryWhenExecIsCalledThen48BitFlagIsSet) {
drm_i915_gem_exec_object2 execObject;

View File

@ -71,6 +71,10 @@ bool BufferObject::close() {
}
int BufferObject::wait(int64_t timeoutNs) {
if (this->drm->isDirectSubmissionActive()) {
return 0;
}
drm_i915_gem_wait wait = {};
wait.bo_handle = this->handle;
wait.timeout_ns = -1;

View File

@ -92,5 +92,5 @@ HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenDestructObjectThen
drm->ioctlCallsCount = 0u;
drmDirectSubmission.reset();
EXPECT_EQ(drm->ioctlCallsCount, 7u);
EXPECT_EQ(drm->ioctlCallsCount, 3u);
}