From a06369230c81ed228ac391b01e8d3ce9989b253b Mon Sep 17 00:00:00 2001 From: Michal Mrozek Date: Wed, 21 Oct 2020 11:57:13 +0200 Subject: [PATCH] Add debug variable to control media vfe state dss settings. Change-Id: I7668bd50c81cc9971315e6a635d64a838465b986 Signed-off-by: Michal Mrozek --- opencl/test/unit_test/test_files/igdrcl.config | 1 + .../source/debug_settings/debug_variables_base.inl | 1 + shared/source/gen12lp/preamble_gen12lp.cpp | 3 +++ .../test/unit_test/gen12lp/test_preamble_gen12lp.cpp | 12 ++++++++++++ 4 files changed, 17 insertions(+) diff --git a/opencl/test/unit_test/test_files/igdrcl.config b/opencl/test/unit_test/test_files/igdrcl.config index 016ef30e90..2ddd0fa310 100644 --- a/opencl/test/unit_test/test_files/igdrcl.config +++ b/opencl/test/unit_test/test_files/igdrcl.config @@ -200,3 +200,4 @@ PauseOnGpuMode = -1 PrintTagAllocationAddress = 0 DoNotFlushCaches = false UseBindlessMode = -1 +MediaVfeStateMaxSubSlices = -1 \ No newline at end of file diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 5790d04d69..4e03a68ff0 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -80,6 +80,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverrideRevision, -1, "-1: default, >=0: Revisi DECLARE_DEBUG_VARIABLE(int32_t, ForceCacheFlushForBcs, -1, "Force cache flush from gpgpu engine before dispatching BCS copy. -1: default, 1: enabled, 0: disabled") DECLARE_DEBUG_VARIABLE(int32_t, ForceGpgpuSubmissionForBcsEnqueue, -1, "-1: Default, 1: Submit gpgpu command buffer with cache flushing and completion synchronization, 0: Do nothing, if possible") DECLARE_DEBUG_VARIABLE(int32_t, EnableUsmCompression, -1, "enable compression support for L0 USM Device and Shared Device side: -1 default, 0: disable, 1: enable") +DECLARE_DEBUG_VARIABLE(int32_t, MediaVfeStateMaxSubSlices, -1, ">=0: Programs Media Vfe State Maximum Number of Dual-Subslices to given value ") /*LOGGING FLAGS*/ DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level") diff --git a/shared/source/gen12lp/preamble_gen12lp.cpp b/shared/source/gen12lp/preamble_gen12lp.cpp index ee958f1c22..292fe47089 100644 --- a/shared/source/gen12lp/preamble_gen12lp.cpp +++ b/shared/source/gen12lp/preamble_gen12lp.cpp @@ -88,6 +88,9 @@ void PreambleHelper::programAdditionalFieldsInVfeState(VFE_STATE_TY if (!hwHelper.isFusedEuDispatchEnabled(hwInfo)) { mediaVfeState->setDisableSlice0Subslice2(true); } + if (DebugManager.flags.MediaVfeStateMaxSubSlices.get() != -1) { + mediaVfeState->setMaximumNumberOfDualSubslices(DebugManager.flags.MediaVfeStateMaxSubSlices.get()); + } } // Explicitly instantiate PreambleHelper for TGLLP device family diff --git a/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp b/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp index 4bc4b2e96f..2a011ba56d 100644 --- a/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp +++ b/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp @@ -153,6 +153,18 @@ HWTEST2_F(Gen12LpPreambleVfeState, givenCfeFusedEuDispatchFlagsWhenprogramAdditi } } +HWTEST2_F(Gen12LpPreambleVfeState, givenMaxNumberOfDssDebugVariableWhenMediaVfeStateIsProgrammedThenFieldIsSet, IsTGLLP) { + using MEDIA_VFE_STATE = typename FamilyType::MEDIA_VFE_STATE; + + DebugManagerStateRestore restorer; + DebugManager.flags.MediaVfeStateMaxSubSlices.set(2); + auto pHwInfo = pPlatform->getClDevice(0)->getRootDeviceEnvironment().getMutableHardwareInfo(); + auto pMediaVfeState = reinterpret_cast(linearStream.getSpace(sizeof(MEDIA_VFE_STATE))); + *pMediaVfeState = FamilyType::cmdInitMediaVfeState; + PreambleHelper::programAdditionalFieldsInVfeState(pMediaVfeState, *pHwInfo); + EXPECT_EQ(2u, pMediaVfeState->getMaximumNumberOfDualSubslices()); +} + typedef PreambleFixture ThreadArbitrationGen12Lp; GEN12LPTEST_F(ThreadArbitrationGen12Lp, givenPolicyWhenThreadArbitrationProgrammedThenDoNothing) { LinearStream &cs = linearStream;