IManagerDisplayService.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Ryujinx.Common.Logging;
  2. using Ryujinx.HLE.HOS.Services.SurfaceFlinger;
  3. namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
  4. {
  5. class IManagerDisplayService : IpcService
  6. {
  7. private static IApplicationDisplayService _applicationDisplayService;
  8. public IManagerDisplayService(IApplicationDisplayService applicationDisplayService)
  9. {
  10. _applicationDisplayService = applicationDisplayService;
  11. }
  12. [Command(2010)]
  13. // CreateManagedLayer(u32, u64, nn::applet::AppletResourceUserId) -> u64
  14. public ResultCode CreateManagedLayer(ServiceCtx context)
  15. {
  16. long layerFlags = context.RequestData.ReadInt64();
  17. long displayId = context.RequestData.ReadInt64();
  18. context.Device.System.SurfaceFlinger.CreateLayer(context.Process, out long layerId);
  19. context.ResponseData.Write(layerId);
  20. return ResultCode.Success;
  21. }
  22. [Command(2011)]
  23. // DestroyManagedLayer(u64)
  24. public ResultCode DestroyManagedLayer(ServiceCtx context)
  25. {
  26. long layerId = context.RequestData.ReadInt64();
  27. context.Device.System.SurfaceFlinger.CloseLayer(layerId);
  28. return ResultCode.Success;
  29. }
  30. [Command(2012)] // 7.0.0+
  31. // CreateStrayLayer(u32, u64) -> (u64, u64, buffer<bytes, 6>)
  32. public ResultCode CreateStrayLayer(ServiceCtx context)
  33. {
  34. return _applicationDisplayService.CreateStrayLayer(context);
  35. }
  36. [Command(6000)]
  37. // AddToLayerStack(u32, u64)
  38. public ResultCode AddToLayerStack(ServiceCtx context)
  39. {
  40. Logger.PrintStub(LogClass.ServiceVi);
  41. return ResultCode.Success;
  42. }
  43. [Command(6002)]
  44. // SetLayerVisibility(b8, u64)
  45. public ResultCode SetLayerVisibility(ServiceCtx context)
  46. {
  47. Logger.PrintStub(LogClass.ServiceVi);
  48. return ResultCode.Success;
  49. }
  50. }
  51. }