[hle, kernel] Add support for FW21 and kernel changes (#3004)

- Adapts kernel changes from atmosphere for firmware 21.0.0.
- Fixes launch error of firmware 21.0.0 applets.
- Adds new commands for `prepo` (New `SaveSystemReport` & `SaveSystemReportWithUser`).
- Adds new commands for `IReadOnlyApplicationControlDataInterface` (cmd 19; incomplete!)
- Adds `{12010, nullptr, "SetButtonConfigLeft"},` undocumented IHidServer.
- Adds new commands for `ngc:u` (`Mask2` and `Check2`)
- Adds new commands for system settings server (GetHttpAuthConfig) for webapplet
- Removes incompatible firmware popup warning.

Signed-off-by: lizzie lizzie@eden-emu.dev
Co-authored by: maufeat sahyno1996@gmail.com

Co-authored-by: crueter <crueter@eden-emu.dev>
Co-authored-by: JPikachu <jpikachu.eden@gmail.com>
Co-authored-by: Maufeat <sahyno1996@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3004
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2025-11-16 22:15:09 +01:00 • committed by crueter
parent b690813196
commit 7d239df065
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
35 changed files with 1624 additions and 1363 deletions

View file

@ -187,7 +187,7 @@ NvResult nvhost_gpu::AllocGPFIFOEx(IoctlAllocGpfifoEx& params, DeviceFD fd) {
params.reserved[2]);
if (channel_state->initialized) {
LOG_CRITICAL(Service_NVDRV, "Already allocated!");
LOG_DEBUG(Service_NVDRV, "Channel already initialized; AllocGPFIFOEx returning AlreadyAllocated");
return NvResult::AlreadyAllocated;
}
@ -196,6 +196,15 @@ NvResult nvhost_gpu::AllocGPFIFOEx(IoctlAllocGpfifoEx& params, DeviceFD fd) {
program_id = session->process->GetProgramId();
}
// Store program id for later lazy initialization
channel_state->program_id = program_id;
// If address space is not yet bound, defer channel initialization.
if (!channel_state->memory_manager) {
params.fence_out = syncpoint_manager.GetSyncpointFence(channel_syncpoint);
return NvResult::Success;
}
system.GPU().InitChannel(*channel_state, program_id);
params.fence_out = syncpoint_manager.GetSyncpointFence(channel_syncpoint);
@ -211,7 +220,7 @@ NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx& params, DeviceFD fd) {
params.reserved[2]);
if (channel_state->initialized) {
LOG_CRITICAL(Service_NVDRV, "Already allocated!");
LOG_DEBUG(Service_NVDRV, "Channel already initialized; AllocGPFIFOEx2 returning AlreadyAllocated");
return NvResult::AlreadyAllocated;
}
@ -220,6 +229,15 @@ NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx& params, DeviceFD fd) {
program_id = session->process->GetProgramId();
}
// Store program id for later lazy initialization
channel_state->program_id = program_id;
// If address space is not yet bound, defer channel initialization.
if (!channel_state->memory_manager) {
params.fence_out = syncpoint_manager.GetSyncpointFence(channel_syncpoint);
return NvResult::Success;
}
system.GPU().InitChannel(*channel_state, program_id);
params.fence_out = syncpoint_manager.GetSyncpointFence(channel_syncpoint);
@ -244,9 +262,10 @@ NvResult nvhost_gpu::AllocateObjectContext(IoctlAllocObjCtx& params) {
LOG_DEBUG(Service_NVDRV, "called, class_num={:#X}, flags={:#X}, obj_id={:#X}", params.class_num,
params.flags, params.obj_id);
if (!channel_state || !channel_state->initialized) {
LOG_CRITICAL(Service_NVDRV, "No address space bound to allocate a object context!");
return NvResult::NotInitialized;
// Do not require channel initialization here: some clients allocate contexts before binding.
if (!channel_state) {
LOG_ERROR(Service_NVDRV, "No channel state available!");
return NvResult::InvalidState;
}
std::scoped_lock lk(channel_mutex);
@ -268,11 +287,12 @@ NvResult nvhost_gpu::AllocateObjectContext(IoctlAllocObjCtx& params) {
}
if (ctxObjs[ctx_class_number_index].has_value()) {
LOG_ERROR(Service_NVDRV, "Object context for class {:#X} already allocated on this channel",
params.class_num);
LOG_WARNING(Service_NVDRV, "Object context for class {:#X} already allocated on this channel",
params.class_num);
return NvResult::AlreadyAllocated;
}
// Defer actual hardware context binding until channel is initialized.
ctxObjs[ctx_class_number_index] = params;
return NvResult::Success;
@ -326,6 +346,11 @@ NvResult nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, Tegra::CommandL
std::scoped_lock lock(channel_mutex);
// Lazily initialize channel when address space is available
if (!channel_state->initialized && channel_state->memory_manager) {
system.GPU().InitChannel(*channel_state, channel_state->program_id);
}
const auto bind_id = channel_state->bind_id;
auto& flags = params.flags;