diff --git a/opencl/test/unit_test/os_interface/device_factory_tests.cpp b/opencl/test/unit_test/os_interface/device_factory_tests.cpp index 5148036075..666e5d3e97 100644 --- a/opencl/test/unit_test/os_interface/device_factory_tests.cpp +++ b/opencl/test/unit_test/os_interface/device_factory_tests.cpp @@ -106,6 +106,22 @@ TEST_F(DeviceFactoryTest, WhenOverridingUsingDebugManagerThenOverridesAreApplied hwInfo->capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); } +TEST_F(DeviceFactoryTest, givenDebugFlagSetWhenCreatingDevicesThenForceImagesSupport) { + DebugManagerStateRestore stateRestore; + + for (int32_t flag : {0, 1}) { + DebugManager.flags.ForceImagesSupport.set(flag); + + MockExecutionEnvironment mockExecutionEnvironment(defaultHwInfo.get()); + + auto success = DeviceFactory::prepareDeviceEnvironments(mockExecutionEnvironment); + ASSERT_TRUE(success); + auto hwInfo = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); + + EXPECT_EQ(!!flag, hwInfo->capabilityTable.supportsImages); + } +} + TEST_F(DeviceFactoryTest, givenZeAffinityMaskSetWhenCreateDevicesThenProperNumberOfDevicesIsReturned) { DebugManagerStateRestore restorer; DebugManager.flags.CreateMultipleRootDevices.set(5); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index d355273b6c..fabdb337b1 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -209,6 +209,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, ReadBackCommandBufferAllocation, -1, "Read comma DECLARE_DEBUG_VARIABLE(int32_t, UseContextEndOffsetForEventCompletion, -1, "Use Context End or Context Start for event completion signalling. -1: default: platform dependent, 0 - Use Context Start, 1 - Use Context End") DECLARE_DEBUG_VARIABLE(int32_t, ForceWddmLowPriorityContextValue, -1, "Force scheduling priority value during Wddm low priority context creation. -1 - default.") DECLARE_DEBUG_VARIABLE(int32_t, FailBuildProgramWithStatefulAccess, -1, "-1: default, 0: disable, 1: enable, Fail build program/module creation whenever stateful access is discovered (except built in kernels).") +DECLARE_DEBUG_VARIABLE(int32_t, ForceImagesSupport, -1, "-1: default, 0: disable, 1: enable. Override support for Images.") DECLARE_DEBUG_VARIABLE(bool, DisableScratchPages, false, "Disable scratch pages during VM creations") DECLARE_DEBUG_VARIABLE(std::string, OverrideDeviceName, std::string("unk"), "Device name to override") DECLARE_DEBUG_VARIABLE(int32_t, OverrideL1CachePolicyInSurfaceStateAndStateless, -1, "-1: default, >=0 : following policy will be programmed in render surface state (for regular buffers) and stateless L1 caching") diff --git a/shared/source/os_interface/linux/hw_info_config_drm.cpp b/shared/source/os_interface/linux/hw_info_config_drm.cpp index 1535115f55..28388fa4d2 100644 --- a/shared/source/os_interface/linux/hw_info_config_drm.cpp +++ b/shared/source/os_interface/linux/hw_info_config_drm.cpp @@ -167,6 +167,10 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideEnableQuickKmdSleepForDirectSubmission.get(), kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission); KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideDelayQuickKmdSleepForDirectSubmissionMicroseconds.get(), kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); + if (DebugManager.flags.ForceImagesSupport.get() != -1) { + outHwInfo->capabilityTable.supportsImages = DebugManager.flags.ForceImagesSupport.get(); + } + return 0; } diff --git a/shared/source/os_interface/windows/hw_info_config_wddm.cpp b/shared/source/os_interface/windows/hw_info_config_wddm.cpp index fda62c276c..2cc9acf2ec 100644 --- a/shared/source/os_interface/windows/hw_info_config_wddm.cpp +++ b/shared/source/os_interface/windows/hw_info_config_wddm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -55,6 +55,11 @@ int HwInfoConfig::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo if (ret != 0) { *outHwInfo = {}; } + + if (DebugManager.flags.ForceImagesSupport.get() != -1) { + outHwInfo->capabilityTable.supportsImages = DebugManager.flags.ForceImagesSupport.get(); + } + return ret; } diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 0836744dc3..04dc2e105c 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -438,4 +438,5 @@ ExperimentalEnableDeviceAllocationCache = 0 OverrideL1CachePolicyInSurfaceStateAndStateless = -1 EnableBcsSwControlWa = -1 ExperimentalEnableL0DebuggerForOpenCL = 0 -DebuggerDisableSingleAddressSbaTracking = 0 \ No newline at end of file +DebuggerDisableSingleAddressSbaTracking = 0 +ForceImagesSupport = -1 \ No newline at end of file