summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp5
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp4
-rw-r--r--src/core/hle/service/nvdrv/interface.h2
-rw-r--r--src/core/hle/service/nvdrv/nvdrv.cpp13
-rw-r--r--src/core/hle/service/nvdrv/nvdrv.h4
5 files changed, 14 insertions, 14 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
index 02b078c2f..d41274616 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
@@ -109,7 +109,7 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
}
params.value |= event_id;
events_interface.events[event_id].writable->Clear();
- gpu.RegisterEvent(event_id, params.syncpt_id, params.threshold);
+ gpu.RegisterSyncptInterrupt(params.syncpt_id, params.threshold);
std::memcpy(output.data(), &params, sizeof(params));
gpu.Guard(false);
return NvResult::Timeout;
@@ -159,9 +159,6 @@ u32 nvhost_ctrl::IocCtrlEventSignal(const std::vector<u8>& input, std::vector<u8
return NvResult::BadParameter;
}
if (events_interface.status[event_id] == EventState::Waiting) {
- auto& gpu = system.GPU();
- gpu.CancelEvent(event_id, events_interface.assigned_syncpt[event_id],
- events_interface.assigned_value[event_id]);
events_interface.LiberateEvent(event_id);
}
return NvResult::Success;
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp
index c548f1223..a4cb8cb81 100644
--- a/src/core/hle/service/nvdrv/interface.cpp
+++ b/src/core/hle/service/nvdrv/interface.cpp
@@ -15,8 +15,8 @@
namespace Service::Nvidia {
-void NVDRV::SignalGPUInterrupt(const u32 event_id) {
- nvdrv->SignalEvent(event_id);
+void NVDRV::SignalGPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) {
+ nvdrv->SignalSyncpt(syncpoint_id, value);
}
void NVDRV::Open(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/nvdrv/interface.h b/src/core/hle/service/nvdrv/interface.h
index 09cf4bb12..10a0ecd52 100644
--- a/src/core/hle/service/nvdrv/interface.h
+++ b/src/core/hle/service/nvdrv/interface.h
@@ -19,7 +19,7 @@ public:
NVDRV(std::shared_ptr<Module> nvdrv, const char* name);
~NVDRV() override;
- void SignalGPUInterrupt(const u32 event_id);
+ void SignalGPUInterruptSyncpt(const u32 syncpoint_id, const u32 value);
private:
void Open(Kernel::HLERequestContext& ctx);
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp
index c68d29177..b87c228bd 100644
--- a/src/core/hle/service/nvdrv/nvdrv.cpp
+++ b/src/core/hle/service/nvdrv/nvdrv.cpp
@@ -89,13 +89,14 @@ ResultCode Module::Close(u32 fd) {
return RESULT_SUCCESS;
}
-void Module::SignalEvent(const u32 event_id) {
- if (event_id >= 64) {
- LOG_ERROR(Service_NVDRV, "Unexpected Event signalled!");
- return;
+void Module::SignalSyncpt(const u32 syncpoint_id, const u32 value) {
+ for (u32 i = 0; i < MaxNvEvents; i++) {
+ if (events_interface.assigned_syncpt[i] == syncpoint_id &&
+ events_interface.assigned_value[i] == value) {
+ events_interface.LiberateEvent(i);
+ events_interface.events[i].writable->Signal();
+ }
}
- events_interface.LiberateEvent(event_id);
- events_interface.events[event_id].writable->Signal();
}
Kernel::SharedPtr<Kernel::ReadableEvent> Module::GetEvent(const u32 event_id) {
diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h
index 597acc9c6..97b48d150 100644
--- a/src/core/hle/service/nvdrv/nvdrv.h
+++ b/src/core/hle/service/nvdrv/nvdrv.h
@@ -73,6 +73,8 @@ struct EventsInterface {
void LiberateEvent(const u32 event_id) {
status[event_id] = registered[event_id] ? EventState::Registered : EventState::Free;
events_mask &= ~(1 << event_id);
+ assigned_syncpt[event_id] = 0xFFFFFFFF;
+ assigned_value[event_id] = 0;
}
};
@@ -97,7 +99,7 @@ public:
/// Closes a device file descriptor and returns operation success.
ResultCode Close(u32 fd);
- void SignalEvent(const u32 event_id);
+ void SignalSyncpt(const u32 syncpoint_id, const u32 value);
Kernel::SharedPtr<Kernel::ReadableEvent> GetEvent(const u32 event_id);