Revert "fix: ulls controller sleep, windows"
This reverts commit 672cc0ebc7
.
Resolves: HSD-18038912878, NEO-11770
Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
parent
a9795349b4
commit
dc26b25169
|
@ -946,7 +946,7 @@ set(BUILTINS_SPIRV_LIB_NAME "builtins_spirv")
|
||||||
set(BUILTINS_VME_LIB_NAME "builtins_vme")
|
set(BUILTINS_VME_LIB_NAME "builtins_vme")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(NEO_EXTRA_LIBS Ws2_32 winmm)
|
set(NEO_EXTRA_LIBS Ws2_32)
|
||||||
else()
|
else()
|
||||||
set(NEO_EXTRA_LIBS dl pthread rt)
|
set(NEO_EXTRA_LIBS dl pthread rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -133,7 +133,7 @@ target_compile_definitions(ocloc_tests PUBLIC MOCKABLE_VIRTUAL=virtual $<TARGET_
|
||||||
target_link_libraries(ocloc_tests gmock-gtest)
|
target_link_libraries(ocloc_tests gmock-gtest)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(ocloc_tests dbghelp winmm)
|
target_link_libraries(ocloc_tests dbghelp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
|
|
@ -357,7 +357,7 @@ target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${CLOC_LIB_LIB_FLAGS_DEFINIT
|
||||||
target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${NEO__IGC_COMPILE_DEFINITIONS})
|
target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${NEO__IGC_COMPILE_DEFINITIONS})
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(${OCLOC_NAME}_lib dbghelp winmm)
|
target_link_libraries(${OCLOC_NAME}_lib dbghelp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
|
|
@ -151,6 +151,10 @@ void DirectSubmissionController::checkNewSubmissions() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DirectSubmissionController::sleep() {
|
||||||
|
NEO::sleep(std::chrono::microseconds(this->timeout));
|
||||||
|
}
|
||||||
|
|
||||||
SteadyClock::time_point DirectSubmissionController::getCpuTimestamp() {
|
SteadyClock::time_point DirectSubmissionController::getCpuTimestamp() {
|
||||||
return SteadyClock::now();
|
return SteadyClock::now();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
set(NEO_CORE_DIRECT_SUBMISSION_LINUX
|
set(NEO_CORE_DIRECT_SUBMISSION_LINUX
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/direct_submission_controller_linux.cpp
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_direct_submission.h
|
${CMAKE_CURRENT_SOURCE_DIR}/drm_direct_submission.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_direct_submission.inl
|
${CMAKE_CURRENT_SOURCE_DIR}/drm_direct_submission.inl
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2024 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "shared/source/direct_submission/direct_submission_controller.h"
|
|
||||||
#include "shared/source/helpers/sleep.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <thread>
|
|
||||||
namespace NEO {
|
|
||||||
void DirectSubmissionController::sleep() {
|
|
||||||
NEO::sleep(std::chrono::microseconds(this->timeout));
|
|
||||||
}
|
|
||||||
} // namespace NEO
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
set(NEO_CORE_DIRECT_SUBMISSION_WINDOWS
|
set(NEO_CORE_DIRECT_SUBMISSION_WINDOWS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/direct_submission_controller_windows.cpp
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_direct_submission.h
|
${CMAKE_CURRENT_SOURCE_DIR}/wddm_direct_submission.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_direct_submission.inl
|
${CMAKE_CURRENT_SOURCE_DIR}/wddm_direct_submission.inl
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2024 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "shared/source/direct_submission/direct_submission_controller.h"
|
|
||||||
#include "shared/source/helpers/sleep.h"
|
|
||||||
#include "shared/source/os_interface/windows/sys_calls.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <thread>
|
|
||||||
namespace NEO {
|
|
||||||
void DirectSubmissionController::sleep() {
|
|
||||||
SysCalls::timeBeginPeriod(1u);
|
|
||||||
NEO::sleep(std::chrono::microseconds(this->timeout));
|
|
||||||
SysCalls::timeEndPeriod(1u);
|
|
||||||
}
|
|
||||||
} // namespace NEO
|
|
|
@ -151,14 +151,6 @@ void setThreadPriority(ThreadPriority priority) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MMRESULT timeBeginPeriod(UINT period) {
|
|
||||||
return ::timeBeginPeriod(period);
|
|
||||||
}
|
|
||||||
|
|
||||||
MMRESULT timeEndPeriod(UINT period) {
|
|
||||||
return ::timeEndPeriod(period);
|
|
||||||
}
|
|
||||||
|
|
||||||
LSTATUS regOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) {
|
LSTATUS regOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) {
|
||||||
return RegOpenKeyExA(hKey, lpSubKey, ulOptions, samDesired, phkResult);
|
return RegOpenKeyExA(hKey, lpSubKey, ulOptions, samDesired, phkResult);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,6 @@ DWORD setFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveH
|
||||||
void setProcessPowerThrottlingState(ProcessPowerThrottlingState state);
|
void setProcessPowerThrottlingState(ProcessPowerThrottlingState state);
|
||||||
void setThreadPriority(ThreadPriority priority);
|
void setThreadPriority(ThreadPriority priority);
|
||||||
void coTaskMemFree(LPVOID pv);
|
void coTaskMemFree(LPVOID pv);
|
||||||
MMRESULT timeBeginPeriod(UINT period);
|
|
||||||
MMRESULT timeEndPeriod(UINT period);
|
|
||||||
|
|
||||||
LSTATUS regOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);
|
LSTATUS regOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);
|
||||||
LSTATUS regQueryValueExA(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
|
LSTATUS regQueryValueExA(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
|
||||||
|
|
|
@ -99,11 +99,6 @@ ProcessPowerThrottlingState setProcessPowerThrottlingStateLastValue{};
|
||||||
size_t setThreadPriorityCalled = 0u;
|
size_t setThreadPriorityCalled = 0u;
|
||||||
ThreadPriority setThreadPriorityLastValue{};
|
ThreadPriority setThreadPriorityLastValue{};
|
||||||
|
|
||||||
size_t timeBeginPeriodCalled = 0u;
|
|
||||||
UINT timeBeginPeriodLastValue = 0u;
|
|
||||||
size_t timeEndPeriodCalled = 0u;
|
|
||||||
UINT timeEndPeriodLastValue = 0u;
|
|
||||||
|
|
||||||
HANDLE(*sysCallsCreateFile)
|
HANDLE(*sysCallsCreateFile)
|
||||||
(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) = nullptr;
|
(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) = nullptr;
|
||||||
|
|
||||||
|
@ -312,18 +307,6 @@ void setThreadPriority(ThreadPriority priority) {
|
||||||
setThreadPriorityLastValue = priority;
|
setThreadPriorityLastValue = priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
MMRESULT timeBeginPeriod(UINT period) {
|
|
||||||
timeBeginPeriodCalled++;
|
|
||||||
timeBeginPeriodLastValue = period;
|
|
||||||
return 0u;
|
|
||||||
}
|
|
||||||
|
|
||||||
MMRESULT timeEndPeriod(UINT period) {
|
|
||||||
timeEndPeriodCalled++;
|
|
||||||
timeEndPeriodLastValue = period;
|
|
||||||
return 0u;
|
|
||||||
}
|
|
||||||
|
|
||||||
HANDLE createFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) {
|
HANDLE createFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) {
|
||||||
if (sysCallsCreateFile != nullptr) {
|
if (sysCallsCreateFile != nullptr) {
|
||||||
return sysCallsCreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
|
return sysCallsCreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
|
||||||
|
|
|
@ -49,7 +49,7 @@ if(UNIX AND NOT DISABLE_WDDM_LINUX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(neo_shared_tests dbghelp winmm)
|
target_link_libraries(neo_shared_tests dbghelp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(neo_shared_tests
|
target_link_libraries(neo_shared_tests
|
||||||
|
|
|
@ -10,29 +10,21 @@
|
||||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||||
#include "shared/source/helpers/flush_stamp.h"
|
#include "shared/source/helpers/flush_stamp.h"
|
||||||
#include "shared/source/memory_manager/allocation_properties.h"
|
#include "shared/source/memory_manager/allocation_properties.h"
|
||||||
#include "shared/source/os_interface/windows/sys_calls.h"
|
|
||||||
#include "shared/source/os_interface/windows/wddm/wddm_residency_logger.h"
|
#include "shared/source/os_interface/windows/wddm/wddm_residency_logger.h"
|
||||||
#include "shared/source/os_interface/windows/wddm_memory_manager.h"
|
#include "shared/source/os_interface/windows/wddm_memory_manager.h"
|
||||||
#include "shared/source/os_interface/windows/wddm_residency_controller.h"
|
#include "shared/source/os_interface/windows/wddm_residency_controller.h"
|
||||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||||
#include "shared/test/common/helpers/variable_backup.h"
|
|
||||||
#include "shared/test/common/mocks/mock_io_functions.h"
|
#include "shared/test/common/mocks/mock_io_functions.h"
|
||||||
#include "shared/test/common/mocks/mock_os_context_win.h"
|
#include "shared/test/common/mocks/mock_os_context_win.h"
|
||||||
#include "shared/test/common/os_interface/windows/wddm_fixture.h"
|
#include "shared/test/common/os_interface/windows/wddm_fixture.h"
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
#include "shared/test/unit_test/direct_submission/direct_submission_controller_mock.h"
|
|
||||||
#include "shared/test/unit_test/mocks/windows/mock_wddm_direct_submission.h"
|
#include "shared/test/unit_test/mocks/windows/mock_wddm_direct_submission.h"
|
||||||
extern uint64_t cpuFence;
|
|
||||||
namespace NEO {
|
|
||||||
|
|
||||||
namespace SysCalls {
|
using namespace NEO;
|
||||||
extern size_t timeBeginPeriodCalled;
|
|
||||||
extern MMRESULT timeBeginPeriodLastValue;
|
extern uint64_t cpuFence;
|
||||||
extern size_t timeEndPeriodCalled;
|
|
||||||
extern MMRESULT timeEndPeriodLastValue;
|
|
||||||
} // namespace SysCalls
|
|
||||||
|
|
||||||
template <PreemptionMode preemptionMode>
|
template <PreemptionMode preemptionMode>
|
||||||
struct WddmDirectSubmissionFixture : public WddmFixture {
|
struct WddmDirectSubmissionFixture : public WddmFixture {
|
||||||
|
@ -1125,19 +1117,3 @@ HWTEST_F(WddmDirectSubmissionTest, givenDirectSubmissionWhenSwitchingRingBuffers
|
||||||
wddmDirectSubmission.handleSwitchRingBuffers(nullptr);
|
wddmDirectSubmission.handleSwitchRingBuffers(nullptr);
|
||||||
EXPECT_EQ(wddmDirectSubmission.ringBufferForCompletionFence, wddmDirectSubmission.previousRingBuffer);
|
EXPECT_EQ(wddmDirectSubmission.ringBufferForCompletionFence, wddmDirectSubmission.previousRingBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(DirectSubmissionControllerWindowsTest, givenDirectSubmissionControllerWhenCallingSleepThenRequestHighResolutionTimers) {
|
|
||||||
VariableBackup<size_t> timeBeginPeriodCalledBackup(&SysCalls::timeBeginPeriodCalled, 0u);
|
|
||||||
VariableBackup<MMRESULT> timeBeginPeriodLastValueBackup(&SysCalls::timeBeginPeriodLastValue, 0u);
|
|
||||||
VariableBackup<size_t> timeEndPeriodCalledBackup(&SysCalls::timeEndPeriodCalled, 0u);
|
|
||||||
VariableBackup<MMRESULT> timeEndPeriodLastValueBackup(&SysCalls::timeEndPeriodLastValue, 0u);
|
|
||||||
|
|
||||||
DirectSubmissionControllerMock controller;
|
|
||||||
controller.sleep();
|
|
||||||
EXPECT_TRUE(controller.sleepCalled);
|
|
||||||
EXPECT_EQ(1u, SysCalls::timeBeginPeriodCalled);
|
|
||||||
EXPECT_EQ(1u, SysCalls::timeEndPeriodCalled);
|
|
||||||
EXPECT_EQ(1u, SysCalls::timeBeginPeriodLastValue);
|
|
||||||
EXPECT_EQ(1u, SysCalls::timeEndPeriodLastValue);
|
|
||||||
}
|
|
||||||
} // namespace NEO
|
|
Loading…
Reference in New Issue