mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Add nvioctlChannel_KickoffPb (uses Ioctl2)
This commit is contained in:
parent
cae1954ebc
commit
f469fa7458
@ -181,7 +181,8 @@ Result nvioctlNvmap_Free(u32 fd, u32 nvmap_handle);
|
|||||||
Result nvioctlNvmap_GetId(u32 fd, u32 nvmap_handle, u32 *id);
|
Result nvioctlNvmap_GetId(u32 fd, u32 nvmap_handle, u32 *id);
|
||||||
|
|
||||||
Result nvioctlChannel_SetNvmapFd(u32 fd, u32 nvmap_fd);
|
Result nvioctlChannel_SetNvmapFd(u32 fd, u32 nvmap_fd);
|
||||||
Result nvioctlChannel_SubmitGpfifo(u32 fd, nvioctl_gpfifo_entry *entries, u32 num_entries, u32 flags, nvioctl_fence *fence_out);
|
Result nvioctlChannel_SubmitGpfifo(u32 fd, nvioctl_gpfifo_entry *entries, u32 num_entries, u32 flags, nvioctl_fence *fence_inout);
|
||||||
|
Result nvioctlChannel_KickoffPb(u32 fd, nvioctl_gpfifo_entry *entries, u32 num_entries, u32 flags, nvioctl_fence *fence_inout);
|
||||||
Result nvioctlChannel_AllocObjCtx(u32 fd, u32 class_num, u32 flags, u64* id_out);
|
Result nvioctlChannel_AllocObjCtx(u32 fd, u32 class_num, u32 flags, u64* id_out);
|
||||||
Result nvioctlChannel_ZCullBind(u32 fd, u64 gpu_va, u32 mode);
|
Result nvioctlChannel_ZCullBind(u32 fd, u64 gpu_va, u32 mode);
|
||||||
Result nvioctlChannel_SetErrorNotifier(u32 fd, u32 enable);
|
Result nvioctlChannel_SetErrorNotifier(u32 fd, u32 enable);
|
||||||
|
@ -30,9 +30,8 @@ Result nvioctlChannel_SubmitGpfifo(u32 fd, nvioctl_gpfifo_entry *entries, u32 nu
|
|||||||
__nv_in nvioctl_gpfifo_entry entries[num_entries]; // depends on num_entries
|
__nv_in nvioctl_gpfifo_entry entries[num_entries]; // depends on num_entries
|
||||||
} data;
|
} data;
|
||||||
|
|
||||||
|
|
||||||
memset(&data, 0, sizeof(data));
|
memset(&data, 0, sizeof(data));
|
||||||
data.gpfifo = 1;
|
data.gpfifo = (u64)data.entries; // ignored
|
||||||
data.num_entries = num_entries;
|
data.num_entries = num_entries;
|
||||||
data.flags = flags;
|
data.flags = flags;
|
||||||
data.fence = *fence_inout;
|
data.fence = *fence_inout;
|
||||||
@ -47,6 +46,31 @@ Result nvioctlChannel_SubmitGpfifo(u32 fd, nvioctl_gpfifo_entry *entries, u32 nu
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result nvioctlChannel_KickoffPb(u32 fd, nvioctl_gpfifo_entry *entries, u32 num_entries, u32 flags, nvioctl_fence *fence_inout) {
|
||||||
|
Result rc=0;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
__nv_in u64 gpfifo; // (ignored) pointer to gpfifo entry structs
|
||||||
|
__nv_in u32 num_entries; // number of entries being submitted
|
||||||
|
__nv_in u32 flags;
|
||||||
|
__nv_inout nvioctl_fence fence; // returned new fence object for others to wait on
|
||||||
|
} data;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof(data));
|
||||||
|
data.gpfifo = (u64)entries; // ignored?
|
||||||
|
data.num_entries = num_entries;
|
||||||
|
data.flags = flags;
|
||||||
|
data.fence = *fence_inout;
|
||||||
|
|
||||||
|
rc = nvIoctl2(fd, _NV_IOWR(0x48, 0x1B, data), &data, entries, num_entries*sizeof(nvioctl_gpfifo_entry));
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
*fence_inout = data.fence;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result nvioctlChannel_AllocObjCtx(u32 fd, u32 class_num, u32 flags, u64* id_out) {
|
Result nvioctlChannel_AllocObjCtx(u32 fd, u32 class_num, u32 flags, u64* id_out) {
|
||||||
struct {
|
struct {
|
||||||
__nv_in u32 class_num;
|
__nv_in u32 class_num;
|
||||||
|
Loading…
Reference in New Issue
Block a user