mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-27 23:32:39 +02:00
Use eventActive instead of manually checking Event::revent
This commit is contained in:
parent
67cd70c00c
commit
42878b603a
@ -220,7 +220,7 @@ Result nwindowDequeueBuffer(NWindow* nw, s32* out_slot, NvMultiFence* out_fence)
|
|||||||
s32 slot;
|
s32 slot;
|
||||||
Result rc;
|
Result rc;
|
||||||
|
|
||||||
if (nw->event.revent != INVALID_HANDLE) {
|
if (eventActive(&nw->event)) {
|
||||||
do {
|
do {
|
||||||
eventWait(&nw->event, U64_MAX);
|
eventWait(&nw->event, U64_MAX);
|
||||||
rc = bqDequeueBuffer(&nw->bq, true, nw->width, nw->height, nw->format, nw->usage, &slot, &fence);
|
rc = bqDequeueBuffer(&nw->bq, true, nw->width, nw->height, nw->format, nw->usage, &slot, &fence);
|
||||||
|
@ -40,7 +40,7 @@ static Event* _nvGetEvent(int event_id)
|
|||||||
{
|
{
|
||||||
Result rc;
|
Result rc;
|
||||||
Event* event = &g_NvEvents[event_id];
|
Event* event = &g_NvEvents[event_id];
|
||||||
if (event->revent != INVALID_HANDLE)
|
if (eventActive(event))
|
||||||
return event;
|
return event;
|
||||||
|
|
||||||
rc = nvioctlNvhostCtrl_EventRegister(g_ctrl_fd, event_id);
|
rc = nvioctlNvhostCtrl_EventRegister(g_ctrl_fd, event_id);
|
||||||
@ -59,7 +59,7 @@ static Event* _nvGetEvent(int event_id)
|
|||||||
static void _nvFreeEvent(int event_id)
|
static void _nvFreeEvent(int event_id)
|
||||||
{
|
{
|
||||||
Event* event = &g_NvEvents[event_id];
|
Event* event = &g_NvEvents[event_id];
|
||||||
if (event->revent == INVALID_HANDLE)
|
if (!eventActive(event))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
eventClose(event);
|
eventClose(event);
|
||||||
|
@ -50,7 +50,7 @@ void nvGpuChannelClose(NvGpuChannel* c)
|
|||||||
if (!c->base.has_init)
|
if (!c->base.has_init)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (c->error_event.revent != INVALID_HANDLE) {
|
if (eventActive(&c->error_event)) {
|
||||||
nvioctlChannel_SetErrorNotifier(c->base.fd, 0);
|
nvioctlChannel_SetErrorNotifier(c->base.fd, 0);
|
||||||
eventClose(&c->error_event);
|
eventClose(&c->error_event);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user