diff options
| author | 2020-07-18 01:45:10 -0400 | |
|---|---|---|
| committer | 2020-07-18 01:45:10 -0400 | |
| commit | 4a8cb9a70671db5684dadf10061f3c3cf1d27741 (patch) | |
| tree | 76ff712dc903f71245bd6108519b125ca6fac99e /src/core/hardware_interrupt_manager.cpp | |
| parent | Merge pull request #4373 from lioncash/allocator (diff) | |
| parent | core_timing: Remove unused data member (diff) | |
| download | yuzu-4a8cb9a70671db5684dadf10061f3c3cf1d27741.tar.gz yuzu-4a8cb9a70671db5684dadf10061f3c3cf1d27741.tar.xz yuzu-4a8cb9a70671db5684dadf10061f3c3cf1d27741.zip | |
Merge pull request #4348 from lioncash/nano
core_timing: Make usage of nanoseconds more consistent in the interface
Diffstat (limited to 'src/core/hardware_interrupt_manager.cpp')
| -rw-r--r-- | src/core/hardware_interrupt_manager.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/hardware_interrupt_manager.cpp b/src/core/hardware_interrupt_manager.cpp index c629d9fa1..efc1030c1 100644 --- a/src/core/hardware_interrupt_manager.cpp +++ b/src/core/hardware_interrupt_manager.cpp | |||
| @@ -11,19 +11,20 @@ | |||
| 11 | namespace Core::Hardware { | 11 | namespace Core::Hardware { |
| 12 | 12 | ||
| 13 | InterruptManager::InterruptManager(Core::System& system_in) : system(system_in) { | 13 | InterruptManager::InterruptManager(Core::System& system_in) : system(system_in) { |
| 14 | gpu_interrupt_event = Core::Timing::CreateEvent("GPUInterrupt", [this](u64 message, s64) { | 14 | gpu_interrupt_event = |
| 15 | auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv"); | 15 | Core::Timing::CreateEvent("GPUInterrupt", [this](u64 message, std::chrono::nanoseconds) { |
| 16 | const u32 syncpt = static_cast<u32>(message >> 32); | 16 | auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv"); |
| 17 | const u32 value = static_cast<u32>(message); | 17 | const u32 syncpt = static_cast<u32>(message >> 32); |
| 18 | nvdrv->SignalGPUInterruptSyncpt(syncpt, value); | 18 | const u32 value = static_cast<u32>(message); |
| 19 | }); | 19 | nvdrv->SignalGPUInterruptSyncpt(syncpt, value); |
| 20 | }); | ||
| 20 | } | 21 | } |
| 21 | 22 | ||
| 22 | InterruptManager::~InterruptManager() = default; | 23 | InterruptManager::~InterruptManager() = default; |
| 23 | 24 | ||
| 24 | void InterruptManager::GPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) { | 25 | void InterruptManager::GPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) { |
| 25 | const u64 msg = (static_cast<u64>(syncpoint_id) << 32ULL) | value; | 26 | const u64 msg = (static_cast<u64>(syncpoint_id) << 32ULL) | value; |
| 26 | system.CoreTiming().ScheduleEvent(10, gpu_interrupt_event, msg); | 27 | system.CoreTiming().ScheduleEvent(std::chrono::nanoseconds{10}, gpu_interrupt_event, msg); |
| 27 | } | 28 | } |
| 28 | 29 | ||
| 29 | } // namespace Core::Hardware | 30 | } // namespace Core::Hardware |