From 42878b603a1dc180765375c19228b59dafe63777 Mon Sep 17 00:00:00 2001 From: fincs Date: Tue, 30 Apr 2019 02:31:47 +0200 Subject: [PATCH] Use eventActive instead of manually checking Event::revent --- nx/source/display/native_window.c | 2 +- nx/source/nvidia/fence.c | 4 ++-- nx/source/nvidia/gpu_channel.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nx/source/display/native_window.c b/nx/source/display/native_window.c index 3ee74a339..6bca01923 100644 --- a/nx/source/display/native_window.c +++ b/nx/source/display/native_window.c @@ -220,7 +220,7 @@ Result nwindowDequeueBuffer(NWindow* nw, s32* out_slot, NvMultiFence* out_fence) s32 slot; Result rc; - if (nw->event.revent != INVALID_HANDLE) { + if (eventActive(&nw->event)) { do { eventWait(&nw->event, U64_MAX); rc = bqDequeueBuffer(&nw->bq, true, nw->width, nw->height, nw->format, nw->usage, &slot, &fence); diff --git a/nx/source/nvidia/fence.c b/nx/source/nvidia/fence.c index 83b8acda6..1847a6ef4 100644 --- a/nx/source/nvidia/fence.c +++ b/nx/source/nvidia/fence.c @@ -40,7 +40,7 @@ static Event* _nvGetEvent(int event_id) { Result rc; Event* event = &g_NvEvents[event_id]; - if (event->revent != INVALID_HANDLE) + if (eventActive(event)) return event; rc = nvioctlNvhostCtrl_EventRegister(g_ctrl_fd, event_id); @@ -59,7 +59,7 @@ static Event* _nvGetEvent(int event_id) static void _nvFreeEvent(int event_id) { Event* event = &g_NvEvents[event_id]; - if (event->revent == INVALID_HANDLE) + if (!eventActive(event)) return; eventClose(event); diff --git a/nx/source/nvidia/gpu_channel.c b/nx/source/nvidia/gpu_channel.c index afe73ca47..31f3d9fd6 100644 --- a/nx/source/nvidia/gpu_channel.c +++ b/nx/source/nvidia/gpu_channel.c @@ -50,7 +50,7 @@ void nvGpuChannelClose(NvGpuChannel* c) if (!c->base.has_init) return; - if (c->error_event.revent != INVALID_HANDLE) { + if (eventActive(&c->error_event)) { nvioctlChannel_SetErrorNotifier(c->base.fd, 0); eventClose(&c->error_event); }