IManagerDisplayService.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.ResponseData.Write(layerId);
  21. return ResultCode.Success;
  22. }
  23. [Command(2011)]
  24. // DestroyManagedLayer(u64)
  25. public ResultCode DestroyManagedLayer(ServiceCtx context)
  26. {
  27. long layerId = context.RequestData.ReadInt64();
  28. context.Device.System.SurfaceFlinger.CloseLayer(layerId);
  29. return ResultCode.Success;
  30. }
  31. [Command(2012)] // 7.0.0+
  32. // CreateStrayLayer(u32, u64) -> (u64, u64, buffer<bytes, 6>)
  33. public ResultCode CreateStrayLayer(ServiceCtx context)
  34. {
  35. return _applicationDisplayService.CreateStrayLayer(context);
  36. }
  37. [Command(6000)]
  38. // AddToLayerStack(u32, u64)
  39. public ResultCode AddToLayerStack(ServiceCtx context)
  40. {
  41. Logger.Stub?.PrintStub(LogClass.ServiceVi);
  42. return ResultCode.Success;
  43. }
  44. [Command(6002)]
  45. // SetLayerVisibility(b8, u64)
  46. public ResultCode SetLayerVisibility(ServiceCtx context)
  47. {
  48. Logger.Stub?.PrintStub(LogClass.ServiceVi);
  49. return ResultCode.Success;
  50. }
  51. }
  52. }