From d35986d7739a926d42fb8a4fd11b283e63544cec Mon Sep 17 00:00:00 2001 From: yellows8 Date: Wed, 15 Nov 2017 16:28:22 -0500 Subject: [PATCH] Added nvioctlNvhostCtrl_EventRegister(). --- nx/include/switch/gfx/nvioctl.h | 1 + nx/source/gfx/nvioctl.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/nx/include/switch/gfx/nvioctl.h b/nx/include/switch/gfx/nvioctl.h index bab46734..c36e4725 100644 --- a/nx/include/switch/gfx/nvioctl.h +++ b/nx/include/switch/gfx/nvioctl.h @@ -77,6 +77,7 @@ enum nvioctl_channel_priority { Result nvioctlNvhostCtrl_EventSignal(u32 fd, u32 event_id); Result nvioctlNvhostCtrl_EventWait(u32 fd, u32 unk0, u32 unk1, s32 timeout, u32 event_id, u32 *out); +Result nvioctlNvhostCtrl_EventRegister(u32 fd, u32 event_id); Result nvioctlNvhostCtrlGpu_ZCullGetCtxSize(u32 fd, u32 *out); Result nvioctlNvhostCtrlGpu_ZCullGetInfo(u32 fd, u32 out[40>>2]); diff --git a/nx/source/gfx/nvioctl.c b/nx/source/gfx/nvioctl.c index 4ef7ebc9..26e5f5d2 100644 --- a/nx/source/gfx/nvioctl.c +++ b/nx/source/gfx/nvioctl.c @@ -36,6 +36,17 @@ Result nvioctlNvhostCtrl_EventWait(u32 fd, u32 unk0, u32 unk1, s32 timeout, u32 return rc; } +Result nvioctlNvhostCtrl_EventRegister(u32 fd, u32 event_id) { + struct { + u32 event_id; //in ranges from 0x01 to 0x3F + } data; + + memset(&data, 0, sizeof(data)); + data.event_id = event_id; + + return nvIoctl(fd, _IOWR(0x40, 0x1F, data), &data); +} + Result nvioctlNvhostCtrlGpu_ZCullGetCtxSize(u32 fd, u32 *out) { Result rc = 0;