mirror of https://github.com/yuzu-mirror/yuzu
Gpu: Implement Hardware Interrupt Manager and manage GPU interrupts
parent
e0027eba85
commit
8942047d41
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
#include "core/core.h"
|
||||||
|
#include "core/hardware_interrupt_manager.h"
|
||||||
|
#include "core/hle/service/nvdrv/interface.h"
|
||||||
|
#include "core/hle/service/sm/sm.h"
|
||||||
|
|
||||||
|
namespace Core::Hardware {
|
||||||
|
|
||||||
|
InterruptManager::InterruptManager(Core::System& system_in) : system(system_in) {
|
||||||
|
gpu_interrupt_event =
|
||||||
|
system.CoreTiming().RegisterEvent("GPUInterrupt", [this](u64 event_index, s64) {
|
||||||
|
auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv");
|
||||||
|
nvdrv->SignalGPUInterrupt(static_cast<u32>(event_index));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void InterruptManager::InterruptGPU(const u32 event_index) {
|
||||||
|
system.CoreTiming().ScheduleEvent(10, gpu_interrupt_event, static_cast<u64>(event_index));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Core::Hardware
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "common/common_types.h"
|
||||||
|
#include "core/core_timing.h"
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
class System;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Core::Hardware {
|
||||||
|
|
||||||
|
class InterruptManager {
|
||||||
|
public:
|
||||||
|
InterruptManager(Core::System& system);
|
||||||
|
~InterruptManager() = default;
|
||||||
|
|
||||||
|
void InterruptGPU(const u32 event_index);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Core::System& system;
|
||||||
|
Core::Timing::EventType* gpu_interrupt_event{};
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Core::Hardware
|
||||||
Loading…
Reference in New Issue