Skip to content

Commit 34a80e9

Browse files
fix: correct xe kmd flag for bind capture
Related-To: NEO-10496 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
1 parent 6095efa commit 34a80e9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,9 @@ bool IoctlHelperXe::completionFenceExtensionSupported(const bool isVmBindAvailab
733733
uint64_t IoctlHelperXe::getFlagsForVmBind(bool bindCapture, bool bindImmediate, bool bindMakeResident, bool readOnlyResource) {
734734
uint64_t ret = 0;
735735
xeLog(" -> IoctlHelperXe::%s %d %d %d %d\n", __FUNCTION__, bindCapture, bindImmediate, bindMakeResident, readOnlyResource);
736+
if (bindCapture) {
737+
ret |= DRM_XE_VM_BIND_FLAG_DUMPABLE;
738+
}
736739
return ret;
737740
}
738741

shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,6 @@ TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingAnyMethodThenDummyValueIsRe
394394

395395
EXPECT_TRUE(xeIoctlHelper->completionFenceExtensionSupported(true));
396396

397-
EXPECT_EQ(0ull, xeIoctlHelper->getFlagsForVmBind(true, true, true, true));
398-
399397
uint32_t fabricId = 0, latency = 0, bandwidth = 0;
400398
EXPECT_FALSE(xeIoctlHelper->getFabricLatency(fabricId, latency, bandwidth));
401399
}
@@ -415,6 +413,15 @@ TEST(IoctlHelperXeTest, whenGettingFlagsForVmCreateThenPropertValueIsReturned) {
415413
EXPECT_EQ(static_cast<uint32_t>(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE), xeIoctlHelper->getFlagsForVmCreate(false, false, false));
416414
}
417415

416+
TEST(IoctlHelperXeTest, whenGettingFlagsForVmBindThenPropertValueIsReturned) {
417+
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
418+
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
419+
auto xeIoctlHelper = std::make_unique<IoctlHelperXe>(drm);
420+
421+
EXPECT_EQ(static_cast<uint64_t>(DRM_XE_VM_BIND_FLAG_DUMPABLE), xeIoctlHelper->getFlagsForVmBind(true, true, true, true));
422+
EXPECT_EQ(static_cast<uint64_t>(0), xeIoctlHelper->getFlagsForVmBind(false, true, true, true));
423+
}
424+
418425
TEST(IoctlHelperXeTest, whenGettingIoctlRequestValueThenPropertValueIsReturned) {
419426
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
420427
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};

0 commit comments

Comments
 (0)