Commit graph

119 commits

Author SHA1 Message Date
Kelebek1
52c35521bd Rework time service to fix time passing offline. 2024-01-24 04:26:55 +00:00
Liam
0865db645e core_timing: block advance thread while clearing and signal after 2023-12-23 15:36:46 -05:00
Liam
f60d4cbe93 core_timing: handle concurrent unscheduling of looping events 2023-12-23 15:36:46 -05:00
Liam
468ef514f1 core_timing: use static typing for no-wait unschedule 2023-12-23 15:36:46 -05:00
Liam
b9545c5a0e core_timing: remove user data value 2023-12-23 15:36:44 -05:00
Liam
e65d90b331 core_timing: lock event queue access 2023-11-14 11:51:04 -05:00
Merry
6b1bac89fd core_timing: Attempt to reduce heap sifting 2023-09-16 07:42:45 +01:00
Merry
4e5157a6f1 core_timing: Use a fibonacci heap 2023-09-16 07:42:45 +01:00
Kelebek1
42638691b5 Use spans over guest memory where possible instead of copying data. 2023-07-02 23:09:48 +01:00
Morph
81ba61a0bd core_timing: Remove GetCurrentTimerResolution in CoreTiming loop
Other programs may change this value, but if thousands of syscalls in this loop is undesirable, then we can just set this once.
2023-07-02 15:08:04 -04:00
Morph
52a219cfe9 core_timing: Fix SingleCore cycle timer 2023-06-07 21:44:42 -04:00
Morph
1b83c7eab4 (wall, native)_clock: Add GetGPUTick
Allows us to directly calculate the GPU tick without double conversion to and from the host clock tick.
2023-06-07 21:44:42 -04:00
Morph
2856fadaa0 core_timing: Use CNTPCT as the guest CPU tick
Previously, we were mixing the raw CPU frequency and CNTFRQ.
The raw CPU frequency (1020 MHz) should've never been used as CNTPCT (whose frequency is CNTFRQ) is the only counter available.
2023-06-07 21:44:42 -04:00
Morph
e67edd4bb7 core_timing: Make use of MicroSleep for x64 CPUs
For CPUs that support tpause, this should result in significant CPU power savings over thread yield in this spin wait.
2023-03-27 17:45:22 -04:00
Morph
ddb330121a core: Promote CPU/GPU threads to time critical
And also demote Audren and CoreTiming to High thread priority.
2023-03-07 21:17:46 -05:00
Morph
e25334b8b3 core_timing: Use higher precision sleeps on Windows
The precision of sleep_for and wait_for is limited to 1-1.5ms on Windows.
Using SleepForOneTick() allows us to sleep for exactly one interval of the current timer resolution.
This allows us to take advantage of systems that have a timer resolution of 0.5ms to reduce CPU overhead in the event loop.
2023-03-05 02:36:31 -05:00
arades79
60a68839ee remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistency
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14 12:35:39 -05:00
arades79
adcef452e0 add static lifetime to constexpr values to force compile time evaluation where possible
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14 12:33:11 -05:00
Liam
e1b0b3d0db timing: wait for completion on unregister 2023-01-14 15:48:01 -05:00
bunnei
438c1b5c18 core: core_timing: Re-initialize if single/multicore state changes. 2022-10-18 19:13:35 -07:00
bunnei
a35c884097 core: Partially persist emulation state across game boots. 2022-10-18 19:13:35 -07:00
Liam
d10787b40b core_timing: use high-precision sleeps on non-Windows targets 2022-10-08 18:27:40 -04:00
Liam
47fc168030 common: remove "yuzu:" prefix from thread names 2022-10-03 18:43:56 -04:00
bunnei
58975829b7 Merge pull request #8650 from Kelebek1/vsync
[Coretiming/NVNFlinger] Improve multi-core vsync timing, and core timing accuracy
2022-09-17 11:10:54 -07:00
Kelebek1
c6d4071162 Remove pause callbacks from coretiming 2022-09-13 13:20:35 +01:00
Morph
b5847efa10 core_timing: Sleep in discrete intervals, yield during spin 2022-08-02 01:01:54 -04:00
Kelebek1
4a764c5df7 Add missing looping event schedule signal 2022-08-02 01:01:54 -04:00
Kelebek1
992af57f8d Make coretiming waiting more accurate 2022-08-02 01:01:54 -04:00
Maide
68dcd946b7 Revert Coretiming PRs 8531 and 7454 (#8591) 2022-07-27 19:47:06 -04:00
Kelebek1
03de5e053d Rework CoreTiming 2022-07-10 06:59:40 +01:00
Fernando Sahmkow
95cb99b186 Core timing: use only one thread. 2022-07-02 23:02:16 +02:00
Fernando Sahmkow
3adeb694b0 Adress Feedback. 2022-06-30 10:18:56 +02:00
Fernando Sahmkow
2d838d8ec9 Address feedback. 2022-06-28 01:19:30 +02:00
Fernando Sahmkow
0043292951 Core: Protect each event from race conditions within it. 2022-06-28 01:10:55 +02:00
Fernando Sahmkow
1541f198eb Core/Common: Corrections to core timing and add critical priority. 2022-06-28 01:10:55 +02:00
Fernando Sahmkow
ca686b6d07 Core: Reimplement Core Timing. 2022-06-28 01:10:50 +02:00
Morph
2b87305d31 general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
Lioncash
84b656fbbd core: Resolve misc cases of variable shadowing
Resolves shadowing warnings that aren't in a particularly large
subsection of core. Brings us closer to turning -Wshadow into an error.

All that remains now is for cases in the kernel (left untouched for now
since a big change by bunnei is pending), and a few left over in the
service code (will be tackled next).
2021-05-03 01:19:13 -04:00
bunnei
7f4d928f77 core: hle: Add missing calls to MicroProfileOnThreadExit. 2021-01-11 14:23:16 -08:00
bunnei
deb3536936 Revert "core: Fix clang build" 2020-10-20 19:07:39 -07:00
Lioncash
18636013c9 core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.

Fixes #4795
2020-10-17 19:50:39 -04:00
Lioncash
96214f8600 core_timing: Remove unused header 2020-08-22 22:12:37 -04:00
Lioncash
aae74a55da core_timing: Move clock initializer into constructor initializer list
Same behavior, minus unnecessary zeroing out of the pointer.
2020-08-22 20:26:48 -04:00
Lioncash
41c74f4f0c core_timing: Resolve sign conversion warning
This constant is only ever assigned to downcount, which is a s64, not a
u64.
2020-08-22 20:26:45 -04:00
Lioncash
7decda6bc2 core_timing: Make use of uintptr_t to represent user_data
Makes the interface future-proofed for supporting other platforms in the event we ever support platforms with differing pointer sizes. This way, we have a type in place that is always guaranteed to be able to represent a pointer exactly.
2020-07-27 21:21:01 -04:00
Lioncash
56054fe86d core_timing: Make TimedCallback take std::chrono::nanoseconds
Enforces our desired time units directly with a concrete type.
2020-07-15 19:41:22 -04:00
Lioncash
9e113a2b67 core_timing: Make use of std::chrono with ScheduleEvent 2020-07-15 18:54:15 -04:00
ReinUsesLisp
a0226819e1 core_timing,scheduler: Use std::scoped_lock when possible
Simplifies the cognitive load of procedures using locks and makes locks
safe against exceptions.
2020-06-28 21:42:57 -03:00
Fernando Sahmkow
94a51e6b21 Core/Common: Address Feedback. 2020-06-27 18:20:06 -04:00
Fernando Sahmkow
a4e7d0b106 CoreTiming: Correct rebase bugs and other miscellaneous things. 2020-06-27 11:36:11 -04:00