1
1
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2025-09-17 13:47:53 -05:00

mm: Migrate service in Horizon project (#5580)

* mm: Migrate service in Horizon project

This PR migrate the `mm:u` service to the Horizon project, things were checked by some RE aswell, that's why some vars are renamed, the logic should be the same as before.

Tests are welcome.

* Lock _sessionList instead

* Fix comment

* Fix Session fields order
This commit is contained in:
Ac_K
2023-08-17 14:59:05 +02:00
committed by GitHub
parent 6ed613a6e6
commit b0b7843d5c
10 changed files with 280 additions and 230 deletions

View File

@@ -0,0 +1,17 @@
using Ryujinx.Horizon.Common;
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Sdk.MmNv
{
interface IRequest : IServiceObject
{
Result InitializeOld(Module module, uint fgmPriority, uint autoClearEvent);
Result FinalizeOld(Module module);
Result SetAndWaitOld(Module module, uint clockRateMin, int clockRateMax);
Result GetOld(out uint clockRateActual, Module module);
Result Initialize(out uint requestId, Module module, uint fgmPriority, uint autoClearEvent);
Result Finalize(uint requestId);
Result SetAndWait(uint requestId, uint clockRateMin, int clockRateMax);
Result Get(out uint clockRateActual, uint requestId);
}
}

View File

@@ -0,0 +1,15 @@
namespace Ryujinx.Horizon.Sdk.MmNv
{
enum Module : uint
{
Cpu,
Gpu,
Emc,
SysBus,
MSelect,
NvDec,
NvEnc,
NvJpg,
Test,
}
}

View File

@@ -0,0 +1,26 @@
namespace Ryujinx.Horizon.Sdk.MmNv
{
class Session
{
public Module Module { get; }
public uint Id { get; }
public bool IsAutoClearEvent { get; }
public uint ClockRateMin { get; private set; }
public int ClockRateMax { get; private set; }
public Session(uint id, Module module, bool isAutoClearEvent)
{
Module = module;
Id = id;
IsAutoClearEvent = isAutoClearEvent;
ClockRateMin = 0;
ClockRateMax = -1;
}
public void SetAndWait(uint clockRateMin, int clockRateMax)
{
ClockRateMin = clockRateMin;
ClockRateMax = clockRateMax;
}
}
}