mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-26 23:02:39 +02:00
Potentially fix race condition nvGpfifoCreate by waiting on the fence returned by nvioctlChannel_AllocGpfifoEx2
This commit is contained in:
parent
d718a8dd28
commit
7f4001bec2
@ -2,7 +2,6 @@
|
||||
|
||||
typedef struct {
|
||||
NvChannel* parent;
|
||||
nvioctl_fence fifo_fence;
|
||||
} NvGpfifo;
|
||||
|
||||
Result nvGpfifoCreate(NvGpfifo* f, NvChannel* parent);
|
||||
|
@ -24,8 +24,11 @@ Result nvGpfifoCreate(NvGpfifo* f, NvChannel* parent)
|
||||
{
|
||||
f->parent = parent;
|
||||
|
||||
return nvioctlChannel_AllocGpfifoEx2(
|
||||
parent->fd, DEFAULT_FIFO_ENTRIES, 1, 0, 0, 0, 0, &f->fifo_fence);
|
||||
NvFence fence;
|
||||
Result res = nvioctlChannel_AllocGpfifoEx2(parent->fd, DEFAULT_FIFO_ENTRIES, 1, 0, 0, 0, 0, &fence);
|
||||
if (R_SUCCEEDED(res) && (s32)fence.id >= 0)
|
||||
nvFenceWait(&fence, -1);
|
||||
return res;
|
||||
}
|
||||
|
||||
void nvGpfifoClose(NvGpfifo* f) {
|
||||
|
Loading…
Reference in New Issue
Block a user