aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IHOSBinderDriver.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IHOSBinderDriver.cs')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IHOSBinderDriver.cs33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IHOSBinderDriver.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IHOSBinderDriver.cs
index 2f9f4291..3d44e23d 100644
--- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IHOSBinderDriver.cs
+++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IHOSBinderDriver.cs
@@ -17,18 +17,18 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{
int binderId = context.RequestData.ReadInt32();
- uint code = context.RequestData.ReadUInt32();
+ uint code = context.RequestData.ReadUInt32();
uint flags = context.RequestData.ReadUInt32();
- ulong dataPos = context.Request.SendBuff[0].Position;
+ ulong dataPos = context.Request.SendBuff[0].Position;
ulong dataSize = context.Request.SendBuff[0].Size;
- ulong replyPos = context.Request.ReceiveBuff[0].Position;
+ ulong replyPos = context.Request.ReceiveBuff[0].Position;
ulong replySize = context.Request.ReceiveBuff[0].Size;
ReadOnlySpan<byte> inputParcel = context.Memory.GetSpan(dataPos, (int)dataSize);
- Span<byte> outputParcel = new Span<byte>(new byte[replySize]);
+ Span<byte> outputParcel = new(new byte[replySize]);
ResultCode result = OnTransact(binderId, code, flags, inputParcel, outputParcel);
@@ -45,8 +45,8 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
public ResultCode AdjustRefcount(ServiceCtx context)
{
int binderId = context.RequestData.ReadInt32();
- int addVal = context.RequestData.ReadInt32();
- int type = context.RequestData.ReadInt32();
+ int addVal = context.RequestData.ReadInt32();
+ int type = context.RequestData.ReadInt32();
return AdjustRefcount(binderId, addVal, type);
}
@@ -77,27 +77,26 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{
int binderId = context.RequestData.ReadInt32();
- uint code = context.RequestData.ReadUInt32();
+ uint code = context.RequestData.ReadUInt32();
uint flags = context.RequestData.ReadUInt32();
- (ulong dataPos, ulong dataSize) = context.Request.GetBufferType0x21();
+ (ulong dataPos, ulong dataSize) = context.Request.GetBufferType0x21();
(ulong replyPos, ulong replySize) = context.Request.GetBufferType0x22();
ReadOnlySpan<byte> inputParcel = context.Memory.GetSpan(dataPos, (int)dataSize);
- using (IMemoryOwner<byte> outputParcelOwner = ByteMemoryPool.RentCleared(replySize))
- {
- Span<byte> outputParcel = outputParcelOwner.Memory.Span;
+ using IMemoryOwner<byte> outputParcelOwner = ByteMemoryPool.RentCleared(replySize);
- ResultCode result = OnTransact(binderId, code, flags, inputParcel, outputParcel);
+ Span<byte> outputParcel = outputParcelOwner.Memory.Span;
- if (result == ResultCode.Success)
- {
- context.Memory.Write(replyPos, outputParcel);
- }
+ ResultCode result = OnTransact(binderId, code, flags, inputParcel, outputParcel);
- return result;
+ if (result == ResultCode.Success)
+ {
+ context.Memory.Write(replyPos, outputParcel);
}
+
+ return result;
}
protected abstract ResultCode AdjustRefcount(int binderId, int addVal, int type);