rjx-mirror/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs
Ac_K 40d1acd198
vi: Unify resolutions values and accurate implementation of them. (#2640)
* vi: Unify resolutions values and accurate implementation of them.

To continue what was made in #2618, I've REd `vi` service a bit. Now values and checks related to displays are more accurate.

- `am`  GetDefaultDisplayResolution / GetDefaultDisplayResolutionChangeEvent have more informations on what the service does.
- `vi:u/vi:m/vi:s` GetDisplayService are now accurate.
- `IApplicationDisplay` GetRelayService, GetSystemDisplayService, GetManagerDisplayService, GetIndirectDisplayTransactionService, ListDisplays, OpenDisplay, OpenDefaultDisplay, CloseDisplay, GetDisplayResolution are now properly implemented.
- Some other calls are cleaned or have extra checks accordingly to RE.

Additionnaly, `IFriendService` have some wrong aligned things, and `pm:info` service placeholder was missing.

* just use _openedDisplayInfo.Remove()

* use context.Memory.Fill()

* fix some casting

* remove unneeded comment

* cleanup

* uses TryAdd

* displayId > ulong

* GetDisplayResolution > ulong

* UL
2021-09-19 12:57:39 +02:00

59 lines
No EOL
1.8 KiB
C#

using Ryujinx.Common.Logging;
namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
{
class ISystemDisplayService : IpcService
{
private IApplicationDisplayService _applicationDisplayService;
public ISystemDisplayService(IApplicationDisplayService applicationDisplayService)
{
_applicationDisplayService = applicationDisplayService;
}
[CommandHipc(2205)]
// SetLayerZ(u64, u64)
public ResultCode SetLayerZ(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return ResultCode.Success;
}
[CommandHipc(2207)]
// SetLayerVisibility(b8, u64)
public ResultCode SetLayerVisibility(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return ResultCode.Success;
}
[CommandHipc(2312)] // 1.0.0-6.2.0
// CreateStrayLayer(u32, u64) -> (u64, u64, buffer<bytes, 6>)
public ResultCode CreateStrayLayer(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return _applicationDisplayService.CreateStrayLayer(context);
}
[CommandHipc(3200)]
// GetDisplayMode(u64) -> nn::vi::DisplayModeInfo
public ResultCode GetDisplayMode(ServiceCtx context)
{
ulong displayId = context.RequestData.ReadUInt64();
(ulong width, ulong height) = AndroidSurfaceComposerClient.GetDisplayInfo(context, displayId);
context.ResponseData.Write((uint)width);
context.ResponseData.Write((uint)height);
context.ResponseData.Write(60.0f);
context.ResponseData.Write(0);
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return ResultCode.Success;
}
}
}