From dcce788ace082ed7f6f1a7da02d2d1a90b5805cc Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Mon, 26 Mar 2018 15:39:06 +0200 Subject: [PATCH] Enable KMD Notify mechanism on Linux for BXT,CFL,GLK,KBL Change-Id: I361237055a11037aac5c0b0c07b83be4884de8f4 --- runtime/gen9/linux/hw_info_config_bxt.cpp | 8 ++++ runtime/gen9/linux/hw_info_config_cfl.cpp | 9 +++++ runtime/gen9/linux/hw_info_config_glk.cpp | 8 ++++ runtime/gen9/linux/hw_info_config_kbl.cpp | 9 +++++ .../gen9/bxt/linux/hw_info_config_tests.cpp | 8 ++++ unit_tests/gen9/bxt/test_device_caps_bxt.cpp | 9 ----- unit_tests/gen9/bxt/windows/CMakeLists.txt | 28 ++++++++++++++ .../windows/test_device_caps_bxt_windows.cpp | 37 +++++++++++++++++++ .../gen9/cfl/linux/hw_info_config_tests.cpp | 8 ++++ unit_tests/gen9/cfl/test_device_caps_cfl.cpp | 9 ----- unit_tests/gen9/cfl/windows/CMakeLists.txt | 28 ++++++++++++++ .../windows/test_device_caps_cfl_windows.cpp | 37 +++++++++++++++++++ .../gen9/glk/linux/hw_info_config_tests.cpp | 8 ++++ unit_tests/gen9/glk/test_device_caps_glk.cpp | 9 ----- unit_tests/gen9/glk/windows/CMakeLists.txt | 28 ++++++++++++++ .../windows/test_device_caps_glk_windows.cpp | 37 +++++++++++++++++++ .../gen9/kbl/linux/hw_info_config_tests.cpp | 8 ++++ unit_tests/gen9/kbl/test_device_caps_kbl.cpp | 9 ----- unit_tests/gen9/kbl/windows/CMakeLists.txt | 28 ++++++++++++++ .../windows/test_device_caps_kbl_windows.cpp | 37 +++++++++++++++++++ 20 files changed, 326 insertions(+), 36 deletions(-) create mode 100644 unit_tests/gen9/bxt/windows/CMakeLists.txt create mode 100644 unit_tests/gen9/bxt/windows/test_device_caps_bxt_windows.cpp create mode 100644 unit_tests/gen9/cfl/windows/CMakeLists.txt create mode 100644 unit_tests/gen9/cfl/windows/test_device_caps_cfl_windows.cpp create mode 100644 unit_tests/gen9/glk/windows/CMakeLists.txt create mode 100644 unit_tests/gen9/glk/windows/test_device_caps_glk_windows.cpp create mode 100644 unit_tests/gen9/kbl/windows/CMakeLists.txt create mode 100644 unit_tests/gen9/kbl/windows/test_device_caps_kbl_windows.cpp diff --git a/runtime/gen9/linux/hw_info_config_bxt.cpp b/runtime/gen9/linux/hw_info_config_bxt.cpp index 4deefdbb98..bdf0684e56 100644 --- a/runtime/gen9/linux/hw_info_config_bxt.cpp +++ b/runtime/gen9/linux/hw_info_config_bxt.cpp @@ -102,6 +102,14 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, pSysInfo->EuCountPerPoolMax = pSysInfo->EUCount - pSysInfo->EuCountPerPoolMin; } + auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties; + kmdNotifyProperties.enableKmdNotify = true; + kmdNotifyProperties.enableQuickKmdSleep = true; + kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits = true; + kmdNotifyProperties.delayKmdNotifyMicroseconds = 50000; + kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 500; + kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds = 200000; + return 0; } diff --git a/runtime/gen9/linux/hw_info_config_cfl.cpp b/runtime/gen9/linux/hw_info_config_cfl.cpp index 69f3055a65..75170a70bf 100644 --- a/runtime/gen9/linux/hw_info_config_cfl.cpp +++ b/runtime/gen9/linux/hw_info_config_cfl.cpp @@ -76,6 +76,15 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInf hwInfo->pPlatform->usDeviceID == ICFL_GT3_ULT_15W_DEVICE_F0_ID) { pSysInfo->EdramSizeInKb = 64 * 1024; } + + auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties; + kmdNotifyProperties.enableKmdNotify = true; + kmdNotifyProperties.enableQuickKmdSleep = true; + kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits = true; + kmdNotifyProperties.delayKmdNotifyMicroseconds = 50000; + kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 500; + kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds = 200000; + return 0; } diff --git a/runtime/gen9/linux/hw_info_config_glk.cpp b/runtime/gen9/linux/hw_info_config_glk.cpp index 4ff8d48e5d..b6b5952208 100644 --- a/runtime/gen9/linux/hw_info_config_glk.cpp +++ b/runtime/gen9/linux/hw_info_config_glk.cpp @@ -91,6 +91,14 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInf pSysInfo->EuCountPerPoolMax = pSysInfo->EUCount - pSysInfo->EuCountPerPoolMin; } + auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties; + kmdNotifyProperties.enableKmdNotify = true; + kmdNotifyProperties.enableQuickKmdSleep = true; + kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits = true; + kmdNotifyProperties.delayKmdNotifyMicroseconds = 50000; + kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 500; + kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds = 200000; + return 0; } } // namespace OCLRT diff --git a/runtime/gen9/linux/hw_info_config_kbl.cpp b/runtime/gen9/linux/hw_info_config_kbl.cpp index 82bd5fb28f..48c95c5460 100644 --- a/runtime/gen9/linux/hw_info_config_kbl.cpp +++ b/runtime/gen9/linux/hw_info_config_kbl.cpp @@ -85,6 +85,15 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, hwInfo->pPlatform->usDeviceID == IKBL_GT3_15W_ULT_DEVICE_F0_ID) { pSysInfo->EdramSizeInKb = 64 * 1024; } + + auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties; + kmdNotifyProperties.enableKmdNotify = true; + kmdNotifyProperties.enableQuickKmdSleep = true; + kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits = true; + kmdNotifyProperties.delayKmdNotifyMicroseconds = 50000; + kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 500; + kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds = 200000; + return 0; } diff --git a/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp b/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp index dc5502e402..60447ca986 100644 --- a/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp +++ b/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp @@ -136,6 +136,14 @@ BXTTEST_F(HwInfoConfigTestLinuxBxt, configureHwInfo) { EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTA); EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTC); EXPECT_EQ(1u, outHwInfo.pSkuTable->ftrGTX); + + auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties; + EXPECT_TRUE(outKmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(50000, outKmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(500, outKmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(200000, outKmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); } BXTTEST_F(HwInfoConfigTestLinuxBxt, negativeUnknownDevId) { diff --git a/unit_tests/gen9/bxt/test_device_caps_bxt.cpp b/unit_tests/gen9/bxt/test_device_caps_bxt.cpp index b192908a25..c57c9319f6 100644 --- a/unit_tests/gen9/bxt/test_device_caps_bxt.cpp +++ b/unit_tests/gen9/bxt/test_device_caps_bxt.cpp @@ -83,12 +83,3 @@ BXTTEST_F(BxtUsDeviceIdTest, isSimulationCap) { delete mockDevice; } } - -BXTTEST_F(BxtUsDeviceIdTest, kmdNotifyMechanism) { - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); -} diff --git a/unit_tests/gen9/bxt/windows/CMakeLists.txt b/unit_tests/gen9/bxt/windows/CMakeLists.txt new file mode 100644 index 0000000000..c24ef763fe --- /dev/null +++ b/unit_tests/gen9/bxt/windows/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 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"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +set(IGDRCL_SRCS_tests_gen9_bxt_windows + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bxt_windows.cpp +) + +if(WIN32) + target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_bxt_windows}) +endif() diff --git a/unit_tests/gen9/bxt/windows/test_device_caps_bxt_windows.cpp b/unit_tests/gen9/bxt/windows/test_device_caps_bxt_windows.cpp new file mode 100644 index 0000000000..cf7c5ea3ed --- /dev/null +++ b/unit_tests/gen9/bxt/windows/test_device_caps_bxt_windows.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "unit_tests/fixtures/device_fixture.h" +#include "test.h" + +using namespace OCLRT; + +typedef Test BxtDeviceCapsWindows; + +BXTTEST_F(BxtDeviceCapsWindows, givenHwInfoWhenAskedForKmdNotifyMechanismThenReturnCorrectValues) { + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); +} diff --git a/unit_tests/gen9/cfl/linux/hw_info_config_tests.cpp b/unit_tests/gen9/cfl/linux/hw_info_config_tests.cpp index 52d5ff99b9..e85543ad5d 100644 --- a/unit_tests/gen9/cfl/linux/hw_info_config_tests.cpp +++ b/unit_tests/gen9/cfl/linux/hw_info_config_tests.cpp @@ -121,6 +121,14 @@ CFLTEST_F(HwInfoConfigTestLinuxCfl, configureHwInfo) { EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTA); EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTC); EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTX); + + auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties; + EXPECT_TRUE(outKmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(50000, outKmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(500, outKmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(200000, outKmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); } CFLTEST_F(HwInfoConfigTestLinuxCfl, negativeUnknownDevId) { diff --git a/unit_tests/gen9/cfl/test_device_caps_cfl.cpp b/unit_tests/gen9/cfl/test_device_caps_cfl.cpp index 1d7d274679..b12687edba 100644 --- a/unit_tests/gen9/cfl/test_device_caps_cfl.cpp +++ b/unit_tests/gen9/cfl/test_device_caps_cfl.cpp @@ -33,15 +33,6 @@ CFLTEST_F(CflDeviceCaps, reportsOcl21) { EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion); } -CFLTEST_F(CflDeviceCaps, kmdNotifyMechanism) { - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); -} - CFLTEST_F(CflDeviceCaps, GivenCFLWhenCheckftr64KBpagesThenTrue) { EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages); } diff --git a/unit_tests/gen9/cfl/windows/CMakeLists.txt b/unit_tests/gen9/cfl/windows/CMakeLists.txt new file mode 100644 index 0000000000..ab9117d311 --- /dev/null +++ b/unit_tests/gen9/cfl/windows/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 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"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +set(IGDRCL_SRCS_tests_gen9_cfl_windows + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_cfl_windows.cpp +) + +if(WIN32) + target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_cfl_windows}) +endif() diff --git a/unit_tests/gen9/cfl/windows/test_device_caps_cfl_windows.cpp b/unit_tests/gen9/cfl/windows/test_device_caps_cfl_windows.cpp new file mode 100644 index 0000000000..4f74740da8 --- /dev/null +++ b/unit_tests/gen9/cfl/windows/test_device_caps_cfl_windows.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "unit_tests/fixtures/device_fixture.h" +#include "test.h" + +using namespace OCLRT; + +typedef Test CflDeviceCapsWindows; + +CFLTEST_F(CflDeviceCapsWindows, givenHwInfoWhenAskedForKmdNotifyMechanismThenReturnCorrectValues) { + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); +} diff --git a/unit_tests/gen9/glk/linux/hw_info_config_tests.cpp b/unit_tests/gen9/glk/linux/hw_info_config_tests.cpp index b2c4c87a50..2f892c008e 100644 --- a/unit_tests/gen9/glk/linux/hw_info_config_tests.cpp +++ b/unit_tests/gen9/glk/linux/hw_info_config_tests.cpp @@ -129,6 +129,14 @@ GLKTEST_F(HwInfoConfigTestLinuxGlk, configureHwInfo) { EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTA); EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTC); EXPECT_EQ(1u, outHwInfo.pSkuTable->ftrGTX); + + auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties; + EXPECT_TRUE(outKmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(50000, outKmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(500, outKmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(200000, outKmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); } GLKTEST_F(HwInfoConfigTestLinuxGlk, negative) { diff --git a/unit_tests/gen9/glk/test_device_caps_glk.cpp b/unit_tests/gen9/glk/test_device_caps_glk.cpp index c2f9abdb97..6a756c1ccc 100644 --- a/unit_tests/gen9/glk/test_device_caps_glk.cpp +++ b/unit_tests/gen9/glk/test_device_caps_glk.cpp @@ -73,15 +73,6 @@ GLKTEST_F(GlkUsDeviceIdTest, isSimulationCap) { #endif } -GLKTEST_F(GlkUsDeviceIdTest, kmdNotifyMechanism) { - EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); - EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); -} - GLKTEST_F(GlkUsDeviceIdTest, GivenGLKWhenCheckftr64KBpagesThenFalse) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages); } diff --git a/unit_tests/gen9/glk/windows/CMakeLists.txt b/unit_tests/gen9/glk/windows/CMakeLists.txt new file mode 100644 index 0000000000..9a14c5fd95 --- /dev/null +++ b/unit_tests/gen9/glk/windows/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 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"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +set(IGDRCL_SRCS_tests_gen9_glk_windows + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_glk_windows.cpp +) + +if(WIN32) + target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_glk_windows}) +endif() diff --git a/unit_tests/gen9/glk/windows/test_device_caps_glk_windows.cpp b/unit_tests/gen9/glk/windows/test_device_caps_glk_windows.cpp new file mode 100644 index 0000000000..d7f9b910fe --- /dev/null +++ b/unit_tests/gen9/glk/windows/test_device_caps_glk_windows.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "unit_tests/fixtures/device_fixture.h" +#include "test.h" + +using namespace OCLRT; + +typedef Test GlkDeviceCapsWindows; + +GLKTEST_F(GlkDeviceCapsWindows, givenHwInfoWhenAskedForKmdNotifyMechanismThenReturnCorrectValues) { + EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); +} diff --git a/unit_tests/gen9/kbl/linux/hw_info_config_tests.cpp b/unit_tests/gen9/kbl/linux/hw_info_config_tests.cpp index 6a06022d88..448800a918 100644 --- a/unit_tests/gen9/kbl/linux/hw_info_config_tests.cpp +++ b/unit_tests/gen9/kbl/linux/hw_info_config_tests.cpp @@ -165,6 +165,14 @@ KBLTEST_F(HwInfoConfigTestLinuxKbl, configureHwInfo) { EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTA); EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTC); EXPECT_EQ(0u, outHwInfo.pSkuTable->ftrGTX); + + auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties; + EXPECT_TRUE(outKmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(50000, outKmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(500, outKmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(200000, outKmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); } KBLTEST_F(HwInfoConfigTestLinuxKbl, negativeUnknownDevId) { diff --git a/unit_tests/gen9/kbl/test_device_caps_kbl.cpp b/unit_tests/gen9/kbl/test_device_caps_kbl.cpp index 8725821469..9c2d32405d 100644 --- a/unit_tests/gen9/kbl/test_device_caps_kbl.cpp +++ b/unit_tests/gen9/kbl/test_device_caps_kbl.cpp @@ -33,15 +33,6 @@ KBLTEST_F(KblDeviceCaps, reportsOcl21) { EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion); } -KBLTEST_F(KblDeviceCaps, kmdNotifyMechanism) { - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); - EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); -} - KBLTEST_F(KblDeviceCaps, GivenKBLWhenCheckftr64KBpagesThenTrue) { EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages); } diff --git a/unit_tests/gen9/kbl/windows/CMakeLists.txt b/unit_tests/gen9/kbl/windows/CMakeLists.txt new file mode 100644 index 0000000000..9558112656 --- /dev/null +++ b/unit_tests/gen9/kbl/windows/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 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"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +set(IGDRCL_SRCS_tests_gen9_kbl_windows + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_kbl_windows.cpp +) + +if(WIN32) + target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_kbl_windows}) +endif() diff --git a/unit_tests/gen9/kbl/windows/test_device_caps_kbl_windows.cpp b/unit_tests/gen9/kbl/windows/test_device_caps_kbl_windows.cpp new file mode 100644 index 0000000000..dd3f44840b --- /dev/null +++ b/unit_tests/gen9/kbl/windows/test_device_caps_kbl_windows.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "unit_tests/fixtures/device_fixture.h" +#include "test.h" + +using namespace OCLRT; + +typedef Test KblDeviceCapsWindows; + +KBLTEST_F(KblDeviceCapsWindows, givenHwInfoWhenAskedForKmdNotifyMechanismThenReturnCorrectValues) { + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds); + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits); + EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); +}