IManagerDisplayService.cs 2.2 KB

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