summaryrefslogtreecommitdiff
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar Lioncash2019-02-12 12:32:15 -0500
committerGravatar Lioncash2019-02-12 12:42:17 -0500
commit48d9d66dc585477d26b4cfbf1c4f71fd637b42ea (patch)
treef53430f173796e92b2e3dfd2570ed6752d5e8f77 /src/core/hle/service
parentMerge pull request #1904 from bunnei/better-fermi-copy (diff)
downloadyuzu-48d9d66dc585477d26b4cfbf1c4f71fd637b42ea.tar.gz
yuzu-48d9d66dc585477d26b4cfbf1c4f71fd637b42ea.tar.xz
yuzu-48d9d66dc585477d26b4cfbf1c4f71fd637b42ea.zip
core_timing: Rename CoreTiming namespace to Core::Timing
Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/hid/controllers/debug_pad.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/gesture.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/keyboard.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/mouse.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/stubbed.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.cpp4
-rw-r--r--src/core/hle/service/hid/controllers/xpad.cpp2
-rw-r--r--src/core/hle/service/hid/hid.cpp19
-rw-r--r--src/core/hle/service/hid/hid.h4
-rw-r--r--src/core/hle/service/hid/irs.cpp2
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp2
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.h4
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp10
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.h6
-rw-r--r--src/core/hle/service/time/time.cpp6
16 files changed, 33 insertions, 38 deletions
diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp
index c22357d8c..b264c9503 100644
--- a/src/core/hle/service/hid/controllers/debug_pad.cpp
+++ b/src/core/hle/service/hid/controllers/debug_pad.cpp
@@ -22,7 +22,7 @@ void Controller_DebugPad::OnInit() {}
22void Controller_DebugPad::OnRelease() {} 22void Controller_DebugPad::OnRelease() {}
23 23
24void Controller_DebugPad::OnUpdate(u8* data, std::size_t size) { 24void Controller_DebugPad::OnUpdate(u8* data, std::size_t size) {
25 shared_memory.header.timestamp = CoreTiming::GetTicks(); 25 shared_memory.header.timestamp = Core::Timing::GetTicks();
26 shared_memory.header.total_entry_count = 17; 26 shared_memory.header.total_entry_count = 17;
27 27
28 if (!IsControllerActivated()) { 28 if (!IsControllerActivated()) {
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp
index 898572277..6d21f1a7d 100644
--- a/src/core/hle/service/hid/controllers/gesture.cpp
+++ b/src/core/hle/service/hid/controllers/gesture.cpp
@@ -18,7 +18,7 @@ void Controller_Gesture::OnInit() {}
18void Controller_Gesture::OnRelease() {} 18void Controller_Gesture::OnRelease() {}
19 19
20void Controller_Gesture::OnUpdate(u8* data, std::size_t size) { 20void Controller_Gesture::OnUpdate(u8* data, std::size_t size) {
21 shared_memory.header.timestamp = CoreTiming::GetTicks(); 21 shared_memory.header.timestamp = Core::Timing::GetTicks();
22 shared_memory.header.total_entry_count = 17; 22 shared_memory.header.total_entry_count = 17;
23 23
24 if (!IsControllerActivated()) { 24 if (!IsControllerActivated()) {
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp
index ca75adc2b..798f30436 100644
--- a/src/core/hle/service/hid/controllers/keyboard.cpp
+++ b/src/core/hle/service/hid/controllers/keyboard.cpp
@@ -20,7 +20,7 @@ void Controller_Keyboard::OnInit() {}
20void Controller_Keyboard::OnRelease() {} 20void Controller_Keyboard::OnRelease() {}
21 21
22void Controller_Keyboard::OnUpdate(u8* data, std::size_t size) { 22void Controller_Keyboard::OnUpdate(u8* data, std::size_t size) {
23 shared_memory.header.timestamp = CoreTiming::GetTicks(); 23 shared_memory.header.timestamp = Core::Timing::GetTicks();
24 shared_memory.header.total_entry_count = 17; 24 shared_memory.header.total_entry_count = 17;
25 25
26 if (!IsControllerActivated()) { 26 if (!IsControllerActivated()) {
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp
index 63391dbe9..4985037be 100644
--- a/src/core/hle/service/hid/controllers/mouse.cpp
+++ b/src/core/hle/service/hid/controllers/mouse.cpp
@@ -18,7 +18,7 @@ void Controller_Mouse::OnInit() {}
18void Controller_Mouse::OnRelease() {} 18void Controller_Mouse::OnRelease() {}
19 19
20void Controller_Mouse::OnUpdate(u8* data, std::size_t size) { 20void Controller_Mouse::OnUpdate(u8* data, std::size_t size) {
21 shared_memory.header.timestamp = CoreTiming::GetTicks(); 21 shared_memory.header.timestamp = Core::Timing::GetTicks();
22 shared_memory.header.total_entry_count = 17; 22 shared_memory.header.total_entry_count = 17;
23 23
24 if (!IsControllerActivated()) { 24 if (!IsControllerActivated()) {
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 04c8c35a8..ffdd1c593 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -308,7 +308,7 @@ void Controller_NPad::OnUpdate(u8* data, std::size_t data_len) {
308 const auto& last_entry = 308 const auto& last_entry =
309 main_controller->npad[main_controller->common.last_entry_index]; 309 main_controller->npad[main_controller->common.last_entry_index];
310 310
311 main_controller->common.timestamp = CoreTiming::GetTicks(); 311 main_controller->common.timestamp = Core::Timing::GetTicks();
312 main_controller->common.last_entry_index = 312 main_controller->common.last_entry_index =
313 (main_controller->common.last_entry_index + 1) % 17; 313 (main_controller->common.last_entry_index + 1) % 17;
314 314
diff --git a/src/core/hle/service/hid/controllers/stubbed.cpp b/src/core/hle/service/hid/controllers/stubbed.cpp
index 02fcfadd9..cca4dca1d 100644
--- a/src/core/hle/service/hid/controllers/stubbed.cpp
+++ b/src/core/hle/service/hid/controllers/stubbed.cpp
@@ -22,7 +22,7 @@ void Controller_Stubbed::OnUpdate(u8* data, std::size_t size) {
22 } 22 }
23 23
24 CommonHeader header{}; 24 CommonHeader header{};
25 header.timestamp = CoreTiming::GetTicks(); 25 header.timestamp = Core::Timing::GetTicks();
26 header.total_entry_count = 17; 26 header.total_entry_count = 17;
27 header.entry_count = 0; 27 header.entry_count = 0;
28 header.last_entry_index = 0; 28 header.last_entry_index = 0;
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp
index f666b1bd8..a7c8acc72 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.cpp
+++ b/src/core/hle/service/hid/controllers/touchscreen.cpp
@@ -21,7 +21,7 @@ void Controller_Touchscreen::OnInit() {}
21void Controller_Touchscreen::OnRelease() {} 21void Controller_Touchscreen::OnRelease() {}
22 22
23void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) { 23void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) {
24 shared_memory.header.timestamp = CoreTiming::GetTicks(); 24 shared_memory.header.timestamp = Core::Timing::GetTicks();
25 shared_memory.header.total_entry_count = 17; 25 shared_memory.header.total_entry_count = 17;
26 26
27 if (!IsControllerActivated()) { 27 if (!IsControllerActivated()) {
@@ -48,7 +48,7 @@ void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) {
48 touch_entry.diameter_x = Settings::values.touchscreen.diameter_x; 48 touch_entry.diameter_x = Settings::values.touchscreen.diameter_x;
49 touch_entry.diameter_y = Settings::values.touchscreen.diameter_y; 49 touch_entry.diameter_y = Settings::values.touchscreen.diameter_y;
50 touch_entry.rotation_angle = Settings::values.touchscreen.rotation_angle; 50 touch_entry.rotation_angle = Settings::values.touchscreen.rotation_angle;
51 const u64 tick = CoreTiming::GetTicks(); 51 const u64 tick = Core::Timing::GetTicks();
52 touch_entry.delta_time = tick - last_touch; 52 touch_entry.delta_time = tick - last_touch;
53 last_touch = tick; 53 last_touch = tick;
54 touch_entry.finger = Settings::values.touchscreen.finger; 54 touch_entry.finger = Settings::values.touchscreen.finger;
diff --git a/src/core/hle/service/hid/controllers/xpad.cpp b/src/core/hle/service/hid/controllers/xpad.cpp
index cd397c70b..eff03d14e 100644
--- a/src/core/hle/service/hid/controllers/xpad.cpp
+++ b/src/core/hle/service/hid/controllers/xpad.cpp
@@ -19,7 +19,7 @@ void Controller_XPad::OnRelease() {}
19 19
20void Controller_XPad::OnUpdate(u8* data, std::size_t size) { 20void Controller_XPad::OnUpdate(u8* data, std::size_t size) {
21 for (auto& xpad_entry : shared_memory.shared_memory_entries) { 21 for (auto& xpad_entry : shared_memory.shared_memory_entries) {
22 xpad_entry.header.timestamp = CoreTiming::GetTicks(); 22 xpad_entry.header.timestamp = Core::Timing::GetTicks();
23 xpad_entry.header.total_entry_count = 17; 23 xpad_entry.header.total_entry_count = 17;
24 24
25 if (!IsControllerActivated()) { 25 if (!IsControllerActivated()) {
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 008bf3f02..79c320d04 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -36,9 +36,9 @@ namespace Service::HID {
36 36
37// Updating period for each HID device. 37// Updating period for each HID device.
38// TODO(ogniK): Find actual polling rate of hid 38// TODO(ogniK): Find actual polling rate of hid
39constexpr u64 pad_update_ticks = CoreTiming::BASE_CLOCK_RATE / 66; 39constexpr u64 pad_update_ticks = Core::Timing::BASE_CLOCK_RATE / 66;
40constexpr u64 accelerometer_update_ticks = CoreTiming::BASE_CLOCK_RATE / 100; 40constexpr u64 accelerometer_update_ticks = Core::Timing::BASE_CLOCK_RATE / 100;
41constexpr u64 gyroscope_update_ticks = CoreTiming::BASE_CLOCK_RATE / 100; 41constexpr u64 gyroscope_update_ticks = Core::Timing::BASE_CLOCK_RATE / 100;
42constexpr std::size_t SHARED_MEMORY_SIZE = 0x40000; 42constexpr std::size_t SHARED_MEMORY_SIZE = 0x40000;
43 43
44IAppletResource::IAppletResource() : ServiceFramework("IAppletResource") { 44IAppletResource::IAppletResource() : ServiceFramework("IAppletResource") {
@@ -73,14 +73,13 @@ IAppletResource::IAppletResource() : ServiceFramework("IAppletResource") {
73 GetController<Controller_Stubbed>(HidController::Unknown3).SetCommonHeaderOffset(0x5000); 73 GetController<Controller_Stubbed>(HidController::Unknown3).SetCommonHeaderOffset(0x5000);
74 74
75 // Register update callbacks 75 // Register update callbacks
76 pad_update_event = 76 pad_update_event = Core::Timing::RegisterEvent(
77 CoreTiming::RegisterEvent("HID::UpdatePadCallback", [this](u64 userdata, int cycles_late) { 77 "HID::UpdatePadCallback",
78 UpdateControllers(userdata, cycles_late); 78 [this](u64 userdata, int cycles_late) { UpdateControllers(userdata, cycles_late); });
79 });
80 79
81 // TODO(shinyquagsire23): Other update callbacks? (accel, gyro?) 80 // TODO(shinyquagsire23): Other update callbacks? (accel, gyro?)
82 81
83 CoreTiming::ScheduleEvent(pad_update_ticks, pad_update_event); 82 Core::Timing::ScheduleEvent(pad_update_ticks, pad_update_event);
84 83
85 ReloadInputDevices(); 84 ReloadInputDevices();
86} 85}
@@ -94,7 +93,7 @@ void IAppletResource::DeactivateController(HidController controller) {
94} 93}
95 94
96IAppletResource ::~IAppletResource() { 95IAppletResource ::~IAppletResource() {
97 CoreTiming::UnscheduleEvent(pad_update_event, 0); 96 Core::Timing::UnscheduleEvent(pad_update_event, 0);
98} 97}
99 98
100void IAppletResource::GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) { 99void IAppletResource::GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
@@ -114,7 +113,7 @@ void IAppletResource::UpdateControllers(u64 userdata, int cycles_late) {
114 controller->OnUpdate(shared_mem->GetPointer(), SHARED_MEMORY_SIZE); 113 controller->OnUpdate(shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
115 } 114 }
116 115
117 CoreTiming::ScheduleEvent(pad_update_ticks - cycles_late, pad_update_event); 116 Core::Timing::ScheduleEvent(pad_update_ticks - cycles_late, pad_update_event);
118} 117}
119 118
120class IActiveVibrationDeviceList final : public ServiceFramework<IActiveVibrationDeviceList> { 119class IActiveVibrationDeviceList final : public ServiceFramework<IActiveVibrationDeviceList> {
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h
index eca27c056..6d897c842 100644
--- a/src/core/hle/service/hid/hid.h
+++ b/src/core/hle/service/hid/hid.h
@@ -7,7 +7,7 @@
7#include "controllers/controller_base.h" 7#include "controllers/controller_base.h"
8#include "core/hle/service/service.h" 8#include "core/hle/service/service.h"
9 9
10namespace CoreTiming { 10namespace Core::Timing {
11struct EventType; 11struct EventType;
12} 12}
13 13
@@ -66,7 +66,7 @@ private:
66 66
67 Kernel::SharedPtr<Kernel::SharedMemory> shared_mem; 67 Kernel::SharedPtr<Kernel::SharedMemory> shared_mem;
68 68
69 CoreTiming::EventType* pad_update_event; 69 Core::Timing::EventType* pad_update_event;
70 70
71 std::array<std::unique_ptr<ControllerBase>, static_cast<size_t>(HidController::MaxControllers)> 71 std::array<std::unique_ptr<ControllerBase>, static_cast<size_t>(HidController::MaxControllers)>
72 controllers{}; 72 controllers{};
diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp
index 3c7f8b1ee..b427d4068 100644
--- a/src/core/hle/service/hid/irs.cpp
+++ b/src/core/hle/service/hid/irs.cpp
@@ -98,7 +98,7 @@ void IRS::GetImageTransferProcessorState(Kernel::HLERequestContext& ctx) {
98 98
99 IPC::ResponseBuilder rb{ctx, 5}; 99 IPC::ResponseBuilder rb{ctx, 5};
100 rb.Push(RESULT_SUCCESS); 100 rb.Push(RESULT_SUCCESS);
101 rb.PushRaw<u64>(CoreTiming::GetTicks()); 101 rb.PushRaw<u64>(Core::Timing::GetTicks());
102 rb.PushRaw<u32>(0); 102 rb.PushRaw<u32>(0);
103} 103}
104 104
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
index d57a54ee8..88d80ba06 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
@@ -184,7 +184,7 @@ u32 nvhost_ctrl_gpu::GetGpuTime(const std::vector<u8>& input, std::vector<u8>& o
184 184
185 IoctlGetGpuTime params{}; 185 IoctlGetGpuTime params{};
186 std::memcpy(&params, input.data(), input.size()); 186 std::memcpy(&params, input.data(), input.size());
187 params.gpu_time = CoreTiming::cyclesToNs(CoreTiming::GetTicks()); 187 params.gpu_time = Core::Timing::cyclesToNs(Core::Timing::GetTicks());
188 std::memcpy(output.data(), &params, output.size()); 188 std::memcpy(output.data(), &params, output.size());
189 return 0; 189 return 0;
190} 190}
diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h
index b171f256c..ab90d591e 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.h
+++ b/src/core/hle/service/nvflinger/buffer_queue.h
@@ -13,10 +13,6 @@
13#include "core/hle/kernel/object.h" 13#include "core/hle/kernel/object.h"
14#include "core/hle/kernel/writable_event.h" 14#include "core/hle/kernel/writable_event.h"
15 15
16namespace CoreTiming {
17struct EventType;
18}
19
20namespace Service::NVFlinger { 16namespace Service::NVFlinger {
21 17
22struct IGBPBuffer { 18struct IGBPBuffer {
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index cde06916d..ce1b59860 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -25,21 +25,21 @@
25namespace Service::NVFlinger { 25namespace Service::NVFlinger {
26 26
27constexpr std::size_t SCREEN_REFRESH_RATE = 60; 27constexpr std::size_t SCREEN_REFRESH_RATE = 60;
28constexpr u64 frame_ticks = static_cast<u64>(CoreTiming::BASE_CLOCK_RATE / SCREEN_REFRESH_RATE); 28constexpr u64 frame_ticks = static_cast<u64>(Core::Timing::BASE_CLOCK_RATE / SCREEN_REFRESH_RATE);
29 29
30NVFlinger::NVFlinger() { 30NVFlinger::NVFlinger() {
31 // Schedule the screen composition events 31 // Schedule the screen composition events
32 composition_event = 32 composition_event =
33 CoreTiming::RegisterEvent("ScreenComposition", [this](u64 userdata, int cycles_late) { 33 Core::Timing::RegisterEvent("ScreenComposition", [this](u64 userdata, int cycles_late) {
34 Compose(); 34 Compose();
35 CoreTiming::ScheduleEvent(frame_ticks - cycles_late, composition_event); 35 Core::Timing::ScheduleEvent(frame_ticks - cycles_late, composition_event);
36 }); 36 });
37 37
38 CoreTiming::ScheduleEvent(frame_ticks, composition_event); 38 Core::Timing::ScheduleEvent(frame_ticks, composition_event);
39} 39}
40 40
41NVFlinger::~NVFlinger() { 41NVFlinger::~NVFlinger() {
42 CoreTiming::UnscheduleEvent(composition_event, 0); 42 Core::Timing::UnscheduleEvent(composition_event, 0);
43} 43}
44 44
45void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) { 45void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) {
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h
index 4c55e99f4..6d8bcbd30 100644
--- a/src/core/hle/service/nvflinger/nvflinger.h
+++ b/src/core/hle/service/nvflinger/nvflinger.h
@@ -14,7 +14,7 @@
14#include "common/common_types.h" 14#include "common/common_types.h"
15#include "core/hle/kernel/object.h" 15#include "core/hle/kernel/object.h"
16 16
17namespace CoreTiming { 17namespace Core::Timing {
18struct EventType; 18struct EventType;
19} 19}
20 20
@@ -115,8 +115,8 @@ private:
115 /// layers. 115 /// layers.
116 u32 next_buffer_queue_id = 1; 116 u32 next_buffer_queue_id = 1;
117 117
118 /// CoreTiming event that handles screen composition. 118 /// Event that handles screen composition.
119 CoreTiming::EventType* composition_event; 119 Core::Timing::EventType* composition_event;
120}; 120};
121 121
122} // namespace Service::NVFlinger 122} // namespace Service::NVFlinger
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index c13640ad8..efebd1b24 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -106,8 +106,8 @@ private:
106 void GetCurrentTimePoint(Kernel::HLERequestContext& ctx) { 106 void GetCurrentTimePoint(Kernel::HLERequestContext& ctx) {
107 LOG_DEBUG(Service_Time, "called"); 107 LOG_DEBUG(Service_Time, "called");
108 108
109 SteadyClockTimePoint steady_clock_time_point{ 109 const SteadyClockTimePoint steady_clock_time_point{
110 CoreTiming::cyclesToMs(CoreTiming::GetTicks()) / 1000}; 110 Core::Timing::cyclesToMs(Core::Timing::GetTicks()) / 1000};
111 IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2}; 111 IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2};
112 rb.Push(RESULT_SUCCESS); 112 rb.Push(RESULT_SUCCESS);
113 rb.PushRaw(steady_clock_time_point); 113 rb.PushRaw(steady_clock_time_point);
@@ -282,7 +282,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
282 } 282 }
283 283
284 const SteadyClockTimePoint steady_clock_time_point{ 284 const SteadyClockTimePoint steady_clock_time_point{
285 CoreTiming::cyclesToMs(CoreTiming::GetTicks()) / 1000, {}}; 285 Core::Timing::cyclesToMs(Core::Timing::GetTicks()) / 1000, {}};
286 286
287 CalendarTime calendar_time{}; 287 CalendarTime calendar_time{};
288 calendar_time.year = tm->tm_year + 1900; 288 calendar_time.year = tm->tm_year + 1900;