Skip to content

Commit 3eb2d95

Browse files
Jaime ArteagaCompute-Runtime-Automation
authored andcommitted
Add debug key to disable SET_PAIR functionality
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com> Source: 2c698fb
1 parent 5ae47e2 commit 3eb2d95

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

shared/source/debug_settings/debug_variables_base.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,5 +493,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverrideDrmRegion, -1, "-1: disable, 0+: overrid
493493
DECLARE_DEBUG_VARIABLE(int32_t, EnableFrontEndTracking, -1, "-1: default: disabled, 0: disabled, 1: enabled. This flag creates multiple return point from List to Queue for Front End reconfiguration on Queue buffer for single List")
494494
DECLARE_DEBUG_VARIABLE(int32_t, EnablePipelineSelectTracking, -1, "-1: default: disabled, 0: disabled, 1: enabled. This flag enables optimization that limits number of pipeline select dispatched by command lists")
495495
DECLARE_DEBUG_VARIABLE(int32_t, EnableStateComputeModeTracking, -1, "-1: default: disabled, 0: disabled, 1: enabled. This flag enables tracking state compute mode changes in command lists")
496+
DECLARE_DEBUG_VARIABLE(int32_t, EnableSetPair, -1, "Use SET_PAIR to pair two buffer objects behind the same file descriptor, -1: default, 0: disabled, 1: enabled")
496497
/* Binary Cache */
497498
DECLARE_DEBUG_VARIABLE(bool, BinaryCacheTrace, false, "enable cl_cache to produce .trace files with information about hash computation")

shared/source/os_interface/linux/drm_neo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,9 @@ void Drm::waitForBind(uint32_t vmHandleId) {
12721272
}
12731273

12741274
bool Drm::isSetPairAvailable() {
1275+
if (DebugManager.flags.EnableSetPair.get() == 0) {
1276+
return static_cast<bool>(DebugManager.flags.EnableSetPair.get());
1277+
}
12751278
std::call_once(checkSetPairOnce, [this]() {
12761279
int ret = ioctlHelper->isSetPairAvailable();
12771280
setPairAvailable = ret;

shared/test/common/test_files/igdrcl.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ ProgramStallCommandForSelfCleanup = -1
172172
RenderCompressedImagesEnabled = -1
173173
RenderCompressedBuffersEnabled = -1
174174
EnableStateComputeModeTracking = -1
175+
EnableSetPair = -1
175176
EnableUsmConcurrentAccessSupport = 0
176177
EnableSharedSystemUsmSupport = -1
177178
EnablePassInlineData = -1

shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ TEST(DrmResidencyHandlerTests, givenDebugFlagUseVmBindSetDefaultWhenQueryingIsVm
11801180
EXPECT_EQ(1u, drm.context.vmBindQueryCalled);
11811181
}
11821182

1183-
TEST(DrmResidencyHandlerTests, whenQueryingForSetPairAvailableAndNoSupportAvailableThenExpectedValueIsReturned) {
1183+
TEST(DrmSetPairTests, whenQueryingForSetPairAvailableAndNoSupportAvailableThenExpectedValueIsReturned) {
11841184
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
11851185
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
11861186
drm.context.setPairQueryValue = 0;
@@ -1194,6 +1194,22 @@ TEST(DrmResidencyHandlerTests, whenQueryingForSetPairAvailableAndNoSupportAvaila
11941194
EXPECT_EQ(1u, drm.context.setPairQueryCalled);
11951195
}
11961196

1197+
TEST(DrmSetPairTests, whenQueryingForSetPairAvailableAndDebugKeyNotSetThenNoSupportIsReturned) {
1198+
DebugManagerStateRestore restorer;
1199+
DebugManager.flags.EnableSetPair.set(0);
1200+
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
1201+
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
1202+
drm.context.setPairQueryValue = 0;
1203+
drm.context.setPairQueryReturn = 0;
1204+
EXPECT_FALSE(drm.setPairAvailable);
1205+
1206+
EXPECT_EQ(0u, drm.context.setPairQueryCalled);
1207+
drm.callBaseIsSetPairAvailable = true;
1208+
EXPECT_FALSE(drm.isSetPairAvailable());
1209+
EXPECT_FALSE(drm.setPairAvailable);
1210+
EXPECT_EQ(0u, drm.context.setPairQueryCalled);
1211+
}
1212+
11971213
TEST(DrmResidencyHandlerTests, whenQueryingForSetPairAvailableAndVmBindAvailableThenBothExpectedValueIsReturned) {
11981214
DebugManagerStateRestore restorer;
11991215
DebugManager.flags.UseVmBind.set(-1);

0 commit comments

Comments
 (0)