aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-07-06 13:37:36 -0300
committerGitHub <noreply@github.com>2022-07-06 13:37:36 -0300
commit55e97959b9720e2efbe2451c38e0610422335603 (patch)
tree4a78a8f6c4377061d160679da789a465956d9de5 /Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
parentf7ef6364b79ba04af5c7bf0f5ec77fbb6b4aae29 (diff)
Fix Vi managed and stray layers open/close/destroy (#3438)1.1.166
* Fix Vi managed and stray layers open/close/destroy * OpenLayer should set the state to ManagedOpened
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
index da55c116..640e8be4 100644
--- a/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
+++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
@@ -237,7 +237,12 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
long userId = context.RequestData.ReadInt64();
ulong parcelPtr = context.Request.ReceiveBuff[0].Position;
- IBinder producer = context.Device.System.SurfaceFlinger.OpenLayer(context.Request.HandleDesc.PId, layerId);
+ ResultCode result = context.Device.System.SurfaceFlinger.OpenLayer(context.Request.HandleDesc.PId, layerId, out IBinder producer);
+
+ if (result != ResultCode.Success)
+ {
+ return result;
+ }
context.Device.System.SurfaceFlinger.SetRenderLayer(layerId);
@@ -260,9 +265,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
{
long layerId = context.RequestData.ReadInt64();
- context.Device.System.SurfaceFlinger.CloseLayer(layerId);
-
- return ResultCode.Success;
+ return context.Device.System.SurfaceFlinger.CloseLayer(layerId);
}
[CommandHipc(2030)]
@@ -275,7 +278,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
ulong parcelPtr = context.Request.ReceiveBuff[0].Position;
// TODO: support multi display.
- IBinder producer = context.Device.System.SurfaceFlinger.CreateLayer(0, out long layerId);
+ IBinder producer = context.Device.System.SurfaceFlinger.CreateLayer(out long layerId, 0, LayerState.Stray);
context.Device.System.SurfaceFlinger.SetRenderLayer(layerId);
@@ -299,9 +302,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
{
long layerId = context.RequestData.ReadInt64();
- context.Device.System.SurfaceFlinger.CloseLayer(layerId);
-
- return ResultCode.Success;
+ return context.Device.System.SurfaceFlinger.DestroyStrayLayer(layerId);
}
[CommandHipc(2101)]