This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
2019-06-08 00:41:06 +00:00
|
|
|
|
|
|
|
#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 =
|
2019-06-12 11:52:49 +00:00
|
|
|
system.CoreTiming().RegisterEvent("GPUInterrupt", [this](u64 message, s64) {
|
2019-06-08 00:41:06 +00:00
|
|
|
auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv");
|
2019-06-12 11:52:49 +00:00
|
|
|
const u32 syncpt = static_cast<u32>(message >> 32);
|
|
|
|
const u32 value = static_cast<u32>(message & 0x00000000FFFFFFFFULL);
|
|
|
|
nvdrv->SignalGPUInterruptSyncpt(syncpt, value);
|
2019-06-08 00:41:06 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-06-12 11:52:49 +00:00
|
|
|
void InterruptManager::GPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) {
|
|
|
|
const u64 msg = (static_cast<u64>(syncpoint_id) << 32ULL) | value;
|
|
|
|
system.CoreTiming().ScheduleEvent(10, gpu_interrupt_event, msg);
|
2019-06-08 00:41:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Core::Hardware
|