diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-27 14:28:53 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-27 14:28:53 -0400 |
| commit | b04c1af7890335abc82526ba539db0a24515afb4 (patch) | |
| tree | aab01cf51c108640285e7ded58f9c07aeb2dc512 /src/core/hle/service/nvdrv/nvdrv_interface.cpp | |
| parent | 645d2bf92be1bebf46ac783e87c0e9b12a2dfc70 (diff) | |
nvdrv: serve Switch 2 nvsrv with Eden's nvdrv; Ampere characteristics
- gsv 1402's nvsrv session speaks the nvdrv INvDrvServices protocol;
serve it with an NVDRV on the shared module, initialised for the
calling process (Switch 2 doesn't call Initialize).
- GetCharacteristics3 callers asking for the 0xD0-byte Switch 2 layout
get chip 0x17E (Ampere; the Switch 2 NvRm rejects Maxwell for NVN),
Ampere classes, and s16 interface versions at 0x70..0x80.
- After that, unknown nvhost-ctrl-gpu Ioctl3 commands from such callers
return a zeroed success (logged).
Diffstat (limited to 'src/core/hle/service/nvdrv/nvdrv_interface.cpp')
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv_interface.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp index 5fae68adbb..020036d74b 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp +++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp @@ -34,6 +34,7 @@ void NVDRV::Open(HLERequestContext& ctx) { const auto& buffer = ctx.ReadBuffer(); const std::string device_name(Common::StringFromBuffer(buffer)); + LOG_DEBUG(Service_NVDRV, "device_name={}", device_name); if (device_name == "/dev/nvhost-prof-gpu") { rb.Push<DeviceFD>(0); @@ -181,6 +182,14 @@ void NVDRV::Initialize(HLERequestContext& ctx) { is_initialized = true; } +void NVDRV::InitializeForProcess(Kernel::KProcess* process) { + if (is_initialized) { + return; + } + session_id = nvdrv->GetContainer().OpenSession(process); + is_initialized = true; +} + void NVDRV::QueryEvent(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto fd = rp.Pop<DeviceFD>(); |
