diff --git a/runtime/command_stream/command_stream_receiver.cpp b/runtime/command_stream/command_stream_receiver.cpp index b52e011718..72eda14f6f 100644 --- a/runtime/command_stream/command_stream_receiver.cpp +++ b/runtime/command_stream/command_stream_receiver.cpp @@ -176,7 +176,7 @@ void CommandStreamReceiver::cleanupResources() { } } -bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait) { +bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMicroseconds, uint32_t taskCountToWait) { std::chrono::high_resolution_clock::time_point time1, time2; int64_t timeDiff = 0; @@ -186,10 +186,10 @@ bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int } time1 = std::chrono::high_resolution_clock::now(); - while (*getTagAddress() < taskCountToWait && timeDiff <= timeoutMs) { + while (*getTagAddress() < taskCountToWait && timeDiff <= timeoutMicroseconds) { if (enableTimeout) { time2 = std::chrono::high_resolution_clock::now(); - timeDiff = std::chrono::duration_cast(time2 - time1).count(); + timeDiff = std::chrono::duration_cast(time2 - time1).count(); } } if (*getTagAddress() >= taskCountToWait) { diff --git a/runtime/command_stream/command_stream_receiver.h b/runtime/command_stream/command_stream_receiver.h index 329ba1b95e..7b3d42cc02 100644 --- a/runtime/command_stream/command_stream_receiver.h +++ b/runtime/command_stream/command_stream_receiver.h @@ -112,7 +112,7 @@ class CommandStreamReceiver { void requestThreadArbitrationPolicy(uint32_t requiredPolicy) { this->requiredThreadArbitrationPolicy = requiredPolicy; } virtual void waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait) = 0; - MOCKABLE_VIRTUAL bool waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMs, uint32_t taskCountToWait); + MOCKABLE_VIRTUAL bool waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMicroseconds, uint32_t taskCountToWait); // returns size of block that needs to be reserved at the beginning of each instruction heap for CommandStreamReceiver MOCKABLE_VIRTUAL size_t getInstructionHeapCmdStreamReceiverReservedSize() const; diff --git a/runtime/command_stream/command_stream_receiver_hw.inl b/runtime/command_stream/command_stream_receiver_hw.inl index a2c3e1cc3a..c929974417 100644 --- a/runtime/command_stream/command_stream_receiver_hw.inl +++ b/runtime/command_stream/command_stream_receiver_hw.inl @@ -550,11 +550,11 @@ inline void CommandStreamReceiverHw::emitNoop(LinearStream &commandSt template inline void CommandStreamReceiverHw::waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait) { - auto status = waitForCompletionWithTimeout(this->hwInfo.capabilityTable.enableKmdNotify, this->hwInfo.capabilityTable.delayKmdNotifyMs, taskCountToWait); + auto status = waitForCompletionWithTimeout(this->hwInfo.capabilityTable.enableKmdNotify, this->hwInfo.capabilityTable.delayKmdNotifyMicroseconds, taskCountToWait); if (!status) { waitForFlushStamp(flushStampToWait); //now call blocking wait, this is to ensure that task count is reached - waitForCompletionWithTimeout(false, this->hwInfo.capabilityTable.delayKmdNotifyMs, taskCountToWait); + waitForCompletionWithTimeout(false, this->hwInfo.capabilityTable.delayKmdNotifyMicroseconds, taskCountToWait); } UNRECOVERABLE_IF(*getTagAddress() < taskCountToWait); diff --git a/runtime/gen8/hw_info_bdw.cpp b/runtime/gen8/hw_info_bdw.cpp index 665da520e3..8082a4d170 100644 --- a/runtime/gen8/hw_info_bdw.cpp +++ b/runtime/gen8/hw_info_bdw.cpp @@ -70,7 +70,7 @@ const RuntimeCapabilityTable BDW::capabilityTable{ true, true, // forceStatelessCompilationFor32Bit false, // EnableKmdNotify - 30, // delayKmdNotifyMs + 30000, // delayKmdNotifyMicroseconds false, // ftr64KBpages EngineType::ENGINE_RCS // defaultEngineType }; diff --git a/runtime/gen9/hw_info_bxt.cpp b/runtime/gen9/hw_info_bxt.cpp index e84d353171..0b9444d78c 100644 --- a/runtime/gen9/hw_info_bxt.cpp +++ b/runtime/gen9/hw_info_bxt.cpp @@ -66,7 +66,7 @@ const RuntimeCapabilityTable BXT::capabilityTable{ true, false, // forceStatelessCompilationFor32Bit false, // EnableKmdNotify - 30, // delayKmdNotifyMs + 30000, // delayKmdNotifyMicroseconds false, // ftr64KBpages EngineType::ENGINE_RCS // defaultEngineType }; diff --git a/runtime/gen9/hw_info_cfl.cpp b/runtime/gen9/hw_info_cfl.cpp index 0593dae841..72193cee47 100644 --- a/runtime/gen9/hw_info_cfl.cpp +++ b/runtime/gen9/hw_info_cfl.cpp @@ -61,7 +61,7 @@ const RuntimeCapabilityTable CFL::capabilityTable{ true, true, // forceStatelessCompilationFor32Bit false, // EnableKmdNotify - 30, // delayKmdNotifyMs + 30000, // delayKmdNotifyMicroseconds true, // ftr64KBpages EngineType::ENGINE_RCS // defaultEngineType }; diff --git a/runtime/gen9/hw_info_glk.cpp b/runtime/gen9/hw_info_glk.cpp index 8f2d570811..cc2fe751f0 100644 --- a/runtime/gen9/hw_info_glk.cpp +++ b/runtime/gen9/hw_info_glk.cpp @@ -61,7 +61,7 @@ const RuntimeCapabilityTable GLK::capabilityTable{ true, false, // forceStatelessCompilationFor32Bit true, // EnableKmdNotify - 30, // delayKmdNotifyMs + 30000, // delayKmdNotifyMicroseconds false, // ftr64KBpages EngineType::ENGINE_RCS // defaultEngineType }; diff --git a/runtime/gen9/hw_info_kbl.cpp b/runtime/gen9/hw_info_kbl.cpp index 9319b214e2..b677024e8e 100644 --- a/runtime/gen9/hw_info_kbl.cpp +++ b/runtime/gen9/hw_info_kbl.cpp @@ -61,7 +61,7 @@ const RuntimeCapabilityTable KBL::capabilityTable{ true, true, // forceStatelessCompilationFor32Bit false, // EnableKmdNotify - 30, // delayKmdNotifyMs + 30000, // delayKmdNotifyMicroseconds true, // ftr64KBpages EngineType::ENGINE_RCS // defaultEngineType }; diff --git a/runtime/gen9/hw_info_skl.cpp b/runtime/gen9/hw_info_skl.cpp index 2fcf12921d..8f8410fdfd 100644 --- a/runtime/gen9/hw_info_skl.cpp +++ b/runtime/gen9/hw_info_skl.cpp @@ -69,7 +69,7 @@ const RuntimeCapabilityTable SKL::capabilityTable{ true, true, // forceStatelessCompilationFor32Bit false, // EnableKmdNotify - 30, // delayKmdNotifyMs + 30000, // delayKmdNotifyMicroseconds true, // ftr64KBpages EngineType::ENGINE_RCS // defaultEngineType }; diff --git a/runtime/helpers/hw_info.h b/runtime/helpers/hw_info.h index d931cd7325..0176073a4a 100644 --- a/runtime/helpers/hw_info.h +++ b/runtime/helpers/hw_info.h @@ -65,7 +65,7 @@ struct RuntimeCapabilityTable { bool forceStatelessCompilationFor32Bit; bool enableKmdNotify; - int64_t delayKmdNotifyMs; + int64_t delayKmdNotifyMicroseconds; bool ftr64KBpages; EngineType defaultEngineType; diff --git a/runtime/os_interface/DebugVariables.def b/runtime/os_interface/DebugVariables.def index 6aa2a79142..4ef16f2c84 100644 --- a/runtime/os_interface/DebugVariables.def +++ b/runtime/os_interface/DebugVariables.def @@ -73,7 +73,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, Enable64kbpages, -1, "-1: default behaviour, 0 D DECLARE_DEBUG_VARIABLE(bool, EnableComputeWorkSizeND, true, "Enables diffrent algorithm to compute local work size") DECLARE_DEBUG_VARIABLE(bool, EnableComputeWorkSizeSquared, false, "Enables algorithm to compute the most squared work group as possible") DECLARE_DEBUG_VARIABLE(int32_t, OverrideEnableKmdNotify, -1, "-1: dont override, 0: disable, 1: enable") -DECLARE_DEBUG_VARIABLE(int32_t, OverrideKmdNotifyDelayMs, -1, "-1: dont override, 0: infinite timeout, >0: timeout in ms") +DECLARE_DEBUG_VARIABLE(int32_t, OverrideKmdNotifyDelayMicroseconds, -1, "-1: dont override, 0: infinite timeout, >0: timeout in microseconds") DECLARE_DEBUG_VARIABLE(bool, EnableVaLibCalls, true, "Enable cl-va sharing lib calls") DECLARE_DEBUG_VARIABLE(int32_t, CsrDispatchMode, 0, "Chooses DispatchMode for Csr") /*DRIVER TOGGLES*/ diff --git a/runtime/os_interface/linux/hw_info_config.cpp b/runtime/os_interface/linux/hw_info_config.cpp index 521dcd19c1..80cdc213a9 100644 --- a/runtime/os_interface/linux/hw_info_config.cpp +++ b/runtime/os_interface/linux/hw_info_config.cpp @@ -185,9 +185,9 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou ? !!DebugManager.flags.OverrideEnableKmdNotify.get() : outHwInfo->capabilityTable.enableKmdNotify; - outHwInfo->capabilityTable.delayKmdNotifyMs = DebugManager.flags.OverrideKmdNotifyDelayMs.get() >= 0 - ? static_cast(DebugManager.flags.OverrideKmdNotifyDelayMs.get()) - : outHwInfo->capabilityTable.delayKmdNotifyMs; + outHwInfo->capabilityTable.delayKmdNotifyMicroseconds = DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.get() >= 0 + ? static_cast(DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.get()) + : outHwInfo->capabilityTable.delayKmdNotifyMicroseconds; pPlatform.release(); pSkuTable.release(); diff --git a/runtime/os_interface/windows/device_factory.cpp b/runtime/os_interface/windows/device_factory.cpp index 16120628de..9dbfa31c93 100644 --- a/runtime/os_interface/windows/device_factory.cpp +++ b/runtime/os_interface/windows/device_factory.cpp @@ -90,9 +90,9 @@ bool DeviceFactory::getDevices(HardwareInfo **pHWInfos, size_t &numDevices) { ? !!DebugManager.flags.OverrideEnableKmdNotify.get() : tempHwInfos[devNum].capabilityTable.enableKmdNotify; - tempHwInfos[devNum].capabilityTable.delayKmdNotifyMs = DebugManager.flags.OverrideKmdNotifyDelayMs.get() >= 0 - ? static_cast(DebugManager.flags.OverrideKmdNotifyDelayMs.get()) - : tempHwInfos[devNum].capabilityTable.delayKmdNotifyMs; + tempHwInfos[devNum].capabilityTable.delayKmdNotifyMicroseconds = DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.get() >= 0 + ? static_cast(DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.get()) + : tempHwInfos[devNum].capabilityTable.delayKmdNotifyMicroseconds; numDevices = 1; *pHWInfos = tempHwInfos; diff --git a/unit_tests/command_queue/command_queue_tests.cpp b/unit_tests/command_queue/command_queue_tests.cpp index 6621554188..8f940d8ecd 100644 --- a/unit_tests/command_queue/command_queue_tests.cpp +++ b/unit_tests/command_queue/command_queue_tests.cpp @@ -666,7 +666,7 @@ struct KmdNotifyTests : public ::testing::Test { } DebugManagerStateRestore stateRestore; DebugManager.flags.OverrideEnableKmdNotify.set(overrideEnable); - DebugManager.flags.OverrideKmdNotifyDelayMs.set(overrideTimeout); + DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.set(overrideTimeout); size_t numDevices; HardwareInfo *hwInfo = nullptr; DeviceFactory::getDevices(&hwInfo, numDevices); diff --git a/unit_tests/gen8/test_device_caps.cpp b/unit_tests/gen8/test_device_caps.cpp index 4bff6d9ff6..6fd4f8bc58 100644 --- a/unit_tests/gen8/test_device_caps.cpp +++ b/unit_tests/gen8/test_device_caps.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation + * Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -57,7 +57,7 @@ GEN8TEST_F(Gen8DeviceCaps, whitelistedRegister) { GEN8TEST_F(Gen8DeviceCaps, kmdNotifyMechanism) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify); - EXPECT_EQ(30, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMs); + EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds); } GEN8TEST_F(Gen8DeviceCaps, compression) { diff --git a/unit_tests/gen9/bxt/test_device_caps_bxt.cpp b/unit_tests/gen9/bxt/test_device_caps_bxt.cpp index e46d01733d..6b6e8aeae4 100644 --- a/unit_tests/gen9/bxt/test_device_caps_bxt.cpp +++ b/unit_tests/gen9/bxt/test_device_caps_bxt.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation + * Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -86,5 +86,5 @@ BXTTEST_F(BxtUsDeviceIdTest, isSimulationCap) { BXTTEST_F(BxtUsDeviceIdTest, kmdNotifyMechanism) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify); - EXPECT_EQ(30, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMs); + EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds); } diff --git a/unit_tests/gen9/cfl/test_device_caps_cfl.cpp b/unit_tests/gen9/cfl/test_device_caps_cfl.cpp index 93229c8779..973c29906d 100644 --- a/unit_tests/gen9/cfl/test_device_caps_cfl.cpp +++ b/unit_tests/gen9/cfl/test_device_caps_cfl.cpp @@ -35,7 +35,7 @@ CFLTEST_F(CflDeviceCaps, reportsOcl21) { CFLTEST_F(CflDeviceCaps, kmdNotifyMechanism) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify); - EXPECT_EQ(30, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMs); + EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds); } CFLTEST_F(CflDeviceCaps, GivenCFLWhenCheckftr64KBpagesThenTrue) { diff --git a/unit_tests/gen9/glk/test_device_caps_glk.cpp b/unit_tests/gen9/glk/test_device_caps_glk.cpp index 90edfad8ac..d46b699979 100644 --- a/unit_tests/gen9/glk/test_device_caps_glk.cpp +++ b/unit_tests/gen9/glk/test_device_caps_glk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation + * Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -75,7 +75,7 @@ GLKTEST_F(GlkUsDeviceIdTest, isSimulationCap) { GLKTEST_F(GlkUsDeviceIdTest, kmdNotifyMechanism) { EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify); - EXPECT_EQ(30, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMs); + EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds); } GLKTEST_F(GlkUsDeviceIdTest, GivenGLKWhenCheckftr64KBpagesThenFalse) { diff --git a/unit_tests/gen9/kbl/test_device_caps_kbl.cpp b/unit_tests/gen9/kbl/test_device_caps_kbl.cpp index 0a6aea8671..9e4d152c68 100644 --- a/unit_tests/gen9/kbl/test_device_caps_kbl.cpp +++ b/unit_tests/gen9/kbl/test_device_caps_kbl.cpp @@ -35,7 +35,7 @@ KBLTEST_F(KblDeviceCaps, reportsOcl21) { KBLTEST_F(KblDeviceCaps, kmdNotifyMechanism) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify); - EXPECT_EQ(30, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMs); + EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds); } KBLTEST_F(KblDeviceCaps, GivenKBLWhenCheckftr64KBpagesThenTrue) { diff --git a/unit_tests/gen9/skl/test_device_caps_skl.cpp b/unit_tests/gen9/skl/test_device_caps_skl.cpp index 265df1f834..201ed351af 100644 --- a/unit_tests/gen9/skl/test_device_caps_skl.cpp +++ b/unit_tests/gen9/skl/test_device_caps_skl.cpp @@ -83,7 +83,7 @@ SKLTEST_F(SklUsDeviceIdTest, isSimulationCap) { SKLTEST_F(SklUsDeviceIdTest, kmdNotifyMechanism) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.enableKmdNotify); - EXPECT_EQ(30, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMs); + EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.delayKmdNotifyMicroseconds); } SKLTEST_F(SklUsDeviceIdTest, GivenSKLWhenCheckftr64KBpagesThenTrue) { diff --git a/unit_tests/os_interface/device_factory_tests.cpp b/unit_tests/os_interface/device_factory_tests.cpp index 41f3254423..bc1d784a3b 100644 --- a/unit_tests/os_interface/device_factory_tests.cpp +++ b/unit_tests/os_interface/device_factory_tests.cpp @@ -102,17 +102,17 @@ TEST_F(DeviceFactoryTest, overrideKmdNotifySettings) { bool success = DeviceFactory::getDevices(&hwInfoReference, numDevices); ASSERT_TRUE(success); auto refEnableKmdNotify = hwInfoReference->capabilityTable.enableKmdNotify; - auto refDelayKmdNotifyMs = hwInfoReference->capabilityTable.delayKmdNotifyMs; + auto refDelayKmdNotifyMicroseconds = hwInfoReference->capabilityTable.delayKmdNotifyMicroseconds; DeviceFactory::releaseDevices(); DebugManager.flags.OverrideEnableKmdNotify.set(!refEnableKmdNotify); - DebugManager.flags.OverrideKmdNotifyDelayMs.set(static_cast(refDelayKmdNotifyMs) + 10); + DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.set(static_cast(refDelayKmdNotifyMicroseconds) + 10); success = DeviceFactory::getDevices(&hwInfoOverriden, numDevices); ASSERT_TRUE(success); EXPECT_EQ(!refEnableKmdNotify, hwInfoOverriden->capabilityTable.enableKmdNotify); - EXPECT_EQ(refDelayKmdNotifyMs + 10, hwInfoOverriden->capabilityTable.delayKmdNotifyMs); + EXPECT_EQ(refDelayKmdNotifyMicroseconds + 10, hwInfoOverriden->capabilityTable.delayKmdNotifyMicroseconds); DeviceFactory::releaseDevices(); }