|
|
@ -1,3 +1,6 @@ |
|
|
|
|
|
// SPDX - FileCopyrightText : Copyright 2025 Eden Emulator Project
|
|
|
|
|
|
// SPDX - License - Identifier : GPL - 3.0 - or -later
|
|
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
@ -75,6 +78,8 @@ NvResult nvhost_gpu::Ioctl1(DeviceFD fd, Ioctl command, std::span<const u8> inpu |
|
|
return WrapFixed(this, &nvhost_gpu::SetErrorNotifier, input, output); |
|
|
return WrapFixed(this, &nvhost_gpu::SetErrorNotifier, input, output); |
|
|
case 0xd: |
|
|
case 0xd: |
|
|
return WrapFixed(this, &nvhost_gpu::SetChannelPriority, input, output); |
|
|
return WrapFixed(this, &nvhost_gpu::SetChannelPriority, input, output); |
|
|
|
|
|
case 0x18: |
|
|
|
|
|
return WrapFixed(this, &nvhost_gpu::AllocGPFIFOEx, input, output, fd); |
|
|
case 0x1a: |
|
|
case 0x1a: |
|
|
return WrapFixed(this, &nvhost_gpu::AllocGPFIFOEx2, input, output, fd); |
|
|
return WrapFixed(this, &nvhost_gpu::AllocGPFIFOEx2, input, output, fd); |
|
|
case 0x1b: |
|
|
case 0x1b: |
|
|
@ -167,12 +172,35 @@ NvResult nvhost_gpu::SetChannelPriority(IoctlChannelSetPriority& params) { |
|
|
return NvResult::Success; |
|
|
return NvResult::Success; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx2& params, DeviceFD fd) { |
|
|
|
|
|
LOG_WARNING(Service_NVDRV, |
|
|
|
|
|
"(STUBBED) called, num_entries={:X}, flags={:X}, unk0={:X}, " |
|
|
|
|
|
"unk1={:X}, unk2={:X}, unk3={:X}", |
|
|
|
|
|
params.num_entries, params.flags, params.unk0, params.unk1, params.unk2, |
|
|
|
|
|
params.unk3); |
|
|
|
|
|
|
|
|
NvResult nvhost_gpu::AllocGPFIFOEx(IoctlAllocGpfifoEx& params, DeviceFD fd) { |
|
|
|
|
|
LOG_DEBUG(Service_NVDRV, "called, num_entries={:X}, flags={:X}, reserved1={:X}, " |
|
|
|
|
|
"reserved2={:X}, reserved3={:X}", |
|
|
|
|
|
params.num_entries, params.flags, params.reserved[0], params.reserved[1], |
|
|
|
|
|
params.reserved[2]); |
|
|
|
|
|
|
|
|
|
|
|
if (channel_state->initialized) { |
|
|
|
|
|
LOG_CRITICAL(Service_NVDRV, "Already allocated!"); |
|
|
|
|
|
return NvResult::AlreadyAllocated; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
u64 program_id{}; |
|
|
|
|
|
if (auto* const session = core.GetSession(sessions[fd]); session != nullptr) { |
|
|
|
|
|
program_id = session->process->GetProgramId(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
system.GPU().InitChannel(*channel_state, program_id); |
|
|
|
|
|
|
|
|
|
|
|
params.fence_out = syncpoint_manager.GetSyncpointFence(channel_syncpoint); |
|
|
|
|
|
|
|
|
|
|
|
return NvResult::Success; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx& params, DeviceFD fd) { |
|
|
|
|
|
LOG_DEBUG(Service_NVDRV, |
|
|
|
|
|
"called, num_entries={:X}, flags={:X}, reserved1={:X}, " |
|
|
|
|
|
"reserved2={:X}, reserved3={:X}", |
|
|
|
|
|
params.num_entries, params.flags, params.reserved[0], params.reserved[1], |
|
|
|
|
|
params.reserved[2]); |
|
|
|
|
|
|
|
|
if (channel_state->initialized) { |
|
|
if (channel_state->initialized) { |
|
|
LOG_CRITICAL(Service_NVDRV, "Already allocated!"); |
|
|
LOG_CRITICAL(Service_NVDRV, "Already allocated!"); |
|
|
|