Revert "fix: ulls controller sleep, windows"

This reverts commit 6455d4648c.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2024-08-24 06:05:07 +02:00
committed by Compute-Runtime-Automation
parent 956dd8e17d
commit 5dbbaa39b9
16 changed files with 12 additions and 150 deletions

View File

@@ -219,7 +219,6 @@ set(neo_libult_SRCS_WINDOWS
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/options.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/setup_external_dependencies_drm_or_wddm.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/sys_calls.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/sys_calls_winmm.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/wddm_calls.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/mock_environment_variables.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/mock_environment_variables.h

View File

@@ -1,32 +0,0 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "sys_calls_winmm.h"
namespace NEO {
namespace SysCalls {
size_t timeBeginPeriodCalled = 0u;
UINT timeBeginPeriodLastValue = 0u;
size_t timeEndPeriodCalled = 0u;
UINT timeEndPeriodLastValue = 0u;
MMRESULT timeBeginPeriod(UINT period) {
timeBeginPeriodCalled++;
timeBeginPeriodLastValue = period;
return 0u;
}
MMRESULT timeEndPeriod(UINT period) {
timeEndPeriodCalled++;
timeEndPeriodLastValue = period;
return 0u;
}
} // namespace SysCalls
} // namespace NEO

View File

@@ -30,14 +30,10 @@ struct DirectSubmissionControllerMock : public DirectSubmissionController {
using DirectSubmissionController::timeSinceLastCheck;
bool sleep(std::unique_lock<std::mutex> &lock) override {
auto ret = sleepReturnValue.load();
this->sleepCalled = true;
if (callBaseSleepMethod) {
return DirectSubmissionController::sleep(lock);
} else {
auto ret = sleepReturnValue.load();
sleepReturnValue.store(false);
return ret;
}
sleepReturnValue.store(false);
return ret;
}
SteadyClock::time_point getCpuTimestamp() override {
@@ -57,6 +53,5 @@ struct DirectSubmissionControllerMock : public DirectSubmissionController {
std::atomic<bool> sleepReturnValue{false};
std::atomic<bool> timeoutElapsedReturnValue{false};
std::atomic<bool> timeoutElapsedCallBase{false};
bool callBaseSleepMethod = false;
};
} // namespace NEO

View File

@@ -10,29 +10,21 @@
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/helpers/flush_stamp.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_memory_manager.h"
#include "shared/source/os_interface/windows/wddm_residency_controller.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/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_os_context_win.h"
#include "shared/test/common/os_interface/windows/wddm_fixture.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"
extern uint64_t cpuFence;
namespace NEO {
namespace SysCalls {
extern size_t timeBeginPeriodCalled;
extern MMRESULT timeBeginPeriodLastValue;
extern size_t timeEndPeriodCalled;
extern MMRESULT timeEndPeriodLastValue;
} // namespace SysCalls
using namespace NEO;
extern uint64_t cpuFence;
template <PreemptionMode preemptionMode>
struct WddmDirectSubmissionFixture : public WddmFixture {
@@ -1138,22 +1130,4 @@ HWTEST_F(WddmDirectSubmissionTest, givenDirectSubmissionWhenUnblockPagingFenceSe
wddmDirectSubmission.unblockPagingFenceSemaphore(pagingFenceValueToWait);
EXPECT_GT(wddmDirectSubmission.semaphoreData->pagingFenceCounter, mockedPagingFence);
}
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.callBaseSleepMethod = true;
std::unique_lock<std::mutex> lock(controller.condVarMutex);
controller.sleep(lock);
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
}