mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 04:22:50 +02:00
nvchannel: fix submit ioctl
This commit is contained in:
parent
a063ceb19c
commit
218e3f3a04
@ -154,6 +154,9 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
u32 syncpt_id;
|
u32 syncpt_id;
|
||||||
u32 syncpt_incrs;
|
u32 syncpt_incrs;
|
||||||
|
u32 waitbase_id; // Always -1
|
||||||
|
u32 next; //< Next valid incr index, or -1
|
||||||
|
u32 prev; //< Previous valid incr index, or -1
|
||||||
} nvioctl_syncpt_incr;
|
} nvioctl_syncpt_incr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -212,8 +212,7 @@ Result nvioctlChannel_Submit(u32 fd, const nvioctl_cmdbuf *cmdbufs, u32 num_cmdb
|
|||||||
__nv_in nvioctl_reloc relocs [num_relocs];
|
__nv_in nvioctl_reloc relocs [num_relocs];
|
||||||
__nv_in nvioctl_reloc_shift reloc_shifts[num_relocs];
|
__nv_in nvioctl_reloc_shift reloc_shifts[num_relocs];
|
||||||
__nv_in nvioctl_syncpt_incr syncpt_incrs[num_syncpt_incrs];
|
__nv_in nvioctl_syncpt_incr syncpt_incrs[num_syncpt_incrs];
|
||||||
__nv_in nvioctl_syncpt_incr wait_checks [num_syncpt_incrs];
|
__nv_inout u32 thresholds [num_fences];
|
||||||
__nv_out nvioctl_fence fences [num_fences];
|
|
||||||
} data;
|
} data;
|
||||||
|
|
||||||
memset(&data, 0, sizeof(data));
|
memset(&data, 0, sizeof(data));
|
||||||
@ -229,9 +228,12 @@ Result nvioctlChannel_Submit(u32 fd, const nvioctl_cmdbuf *cmdbufs, u32 num_cmdb
|
|||||||
Result rc = nvIoctl(fd, _NV_IOWR(0, 0x01, data), &data);
|
Result rc = nvIoctl(fd, _NV_IOWR(0, 0x01, data), &data);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
memcpy(fences, data.fences, num_fences * sizeof(nvioctl_fence));
|
for (int i = 0; i < num_fences; ++i) {
|
||||||
for (int i = 0; i < num_fences; ++i)
|
fences[i] = (nvioctl_fence){
|
||||||
fences[i].id = data.syncpt_incrs[i].syncpt_id;
|
.id = syncpt_incrs[i].syncpt_id,
|
||||||
|
.value = data.thresholds[i],
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user