summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/nvdrv_interface.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-11-01 00:51:29 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-10-06 21:00:51 +0200
commit39a5ce4e696716e48bdd1c980abc792827c68184 (patch)
tree9db2419586537a30374a86e99402e2eeced4cd20 /src/core/hle/service/nvdrv/nvdrv_interface.cpp
parentNvHost: Try a different approach to blocking. (diff)
downloadyuzu-39a5ce4e696716e48bdd1c980abc792827c68184.tar
yuzu-39a5ce4e696716e48bdd1c980abc792827c68184.tar.gz
yuzu-39a5ce4e696716e48bdd1c980abc792827c68184.tar.bz2
yuzu-39a5ce4e696716e48bdd1c980abc792827c68184.tar.lz
yuzu-39a5ce4e696716e48bdd1c980abc792827c68184.tar.xz
yuzu-39a5ce4e696716e48bdd1c980abc792827c68184.tar.zst
yuzu-39a5ce4e696716e48bdd1c980abc792827c68184.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvdrv/nvdrv_interface.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp
index b5a980384..07883feb2 100644
--- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp
+++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp
@@ -5,6 +5,7 @@
#include "common/logging/log.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
+#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/k_readable_event.h"
#include "core/hle/service/nvdrv/nvdata.h"
#include "core/hle/service/nvdrv/nvdrv.h"
@@ -164,8 +165,7 @@ void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto fd = rp.Pop<DeviceFD>();
- const auto event_id = rp.Pop<u32>() & 0x00FF;
- LOG_WARNING(Service_NVDRV, "(STUBBED) called, fd={:X}, event_id={:X}", fd, event_id);
+ const auto event_id = rp.Pop<u32>();
if (!is_initialized) {
ServiceError(ctx, NvResult::NotInitialized);
@@ -180,12 +180,13 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) {
return;
}
- if (event_id < MaxNvEvents) {
+ auto* event = nvdrv->GetEvent(event_id);
+
+ if (event) {
IPC::ResponseBuilder rb{ctx, 3, 1};
rb.Push(ResultSuccess);
- auto& event = nvdrv->GetEvent(event_id);
- event.Clear();
- rb.PushCopyObjects(event);
+ auto& readable_event = event->GetReadableEvent();
+ rb.PushCopyObjects(readable_event);
rb.PushEnum(NvResult::Success);
} else {
IPC::ResponseBuilder rb{ctx, 3};