Skip to content

Commit

Permalink
Use eventActive instead of manually checking Event::revent
Browse files Browse the repository at this point in the history
  • Loading branch information
fincs committed Apr 30, 2019
1 parent 67cd70c commit 42878b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nx/source/display/native_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions nx/source/nvidia/fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion nx/source/nvidia/gpu_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 42878b6

Please sign in to comment.