aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly Laws <blaws05@gmail.com>2021-10-24 22:34:44 +0100
committerGitHub <noreply@github.com>2021-10-24 18:34:44 -0300
commit8c4e4ab3b32eb2dfe5e26fab95648b7872fe2c28 (patch)
tree27e02990c784da55ef2f138c3d5281d1610a4446
parent85d8d1d7cab5615e6911b7b570c8dd0b94a521ab (diff)
Fixup channel submit IOCTL syncpoint parameters (#2774)
* Fixup channel submit IOCTL syncpoint parameters The current arguments worked by happenstance as games only ever submit one syncpoint and request one fence back, if a game were to do something other than this then the arguments would've been parsed entirely wrong. * Address feedback
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs24
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/Types/SubmitArguments.cs10
2 files changed, 10 insertions, 24 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
index e11949be..3d999030 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
@@ -143,13 +143,12 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
private NvInternalResult Submit(Span<byte> arguments)
{
- SubmitArguments submitHeader = GetSpanAndSkip<SubmitArguments>(ref arguments, 1)[0];
- Span<CommandBuffer> commandBuffers = GetSpanAndSkip<CommandBuffer>(ref arguments, submitHeader.CmdBufsCount);
- Span<Reloc> relocs = GetSpanAndSkip<Reloc>(ref arguments, submitHeader.RelocsCount);
- Span<uint> relocShifts = GetSpanAndSkip<uint>(ref arguments, submitHeader.RelocsCount);
- Span<SyncptIncr> syncptIncrs = GetSpanAndSkip<SyncptIncr>(ref arguments, submitHeader.SyncptIncrsCount);
- Span<SyncptIncr> waitChecks = GetSpanAndSkip<SyncptIncr>(ref arguments, submitHeader.SyncptIncrsCount); // ?
- Span<Fence> fences = GetSpanAndSkip<Fence>(ref arguments, submitHeader.FencesCount);
+ SubmitArguments submitHeader = GetSpanAndSkip<SubmitArguments>(ref arguments, 1)[0];
+ Span<CommandBuffer> commandBuffers = GetSpanAndSkip<CommandBuffer>(ref arguments, submitHeader.CmdBufsCount);
+ Span<Reloc> relocs = GetSpanAndSkip<Reloc>(ref arguments, submitHeader.RelocsCount);
+ Span<uint> relocShifts = GetSpanAndSkip<uint>(ref arguments, submitHeader.RelocsCount);
+ Span<SyncptIncr> syncptIncrs = GetSpanAndSkip<SyncptIncr>(ref arguments, submitHeader.SyncptIncrsCount);
+ Span<uint> fenceThresholds = GetSpanAndSkip<uint>(ref arguments, submitHeader.FencesCount);
lock (_device)
{
@@ -159,8 +158,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
uint id = syncptIncr.Id;
- fences[i].Id = id;
- fences[i].Thresh = Context.Device.System.HostSyncpoint.IncrementSyncpointMax(id, syncptIncr.Incrs);
+ fenceThresholds[i] = Context.Device.System.HostSyncpoint.IncrementSyncpointMax(id, syncptIncr.Incrs);
}
foreach (CommandBuffer commandBuffer in commandBuffers)
@@ -173,14 +171,6 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
}
}
- fences[0].Thresh = Context.Device.System.HostSyncpoint.IncrementSyncpointMax(fences[0].Id, 1);
-
- Span<int> tmpCmdBuff = stackalloc int[1];
-
- tmpCmdBuff[0] = (4 << 28) | (int)fences[0].Id;
-
- _host1xContext.Host1x.Submit(tmpCmdBuff, _contextId);
-
return NvInternalResult.Success;
}
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/Types/SubmitArguments.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/Types/SubmitArguments.cs
index 7ef7e39e..05c4280c 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/Types/SubmitArguments.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/Types/SubmitArguments.cs
@@ -24,13 +24,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel.Types
{
public uint Id;
public uint Incrs;
- }
-
- [StructLayout(LayoutKind.Sequential)]
- struct Fence
- {
- public uint Id;
- public uint Thresh;
+ public uint Reserved1;
+ public uint Reserved2;
+ public uint Reserved3;
}
[StructLayout(LayoutKind.Sequential)]