diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-12-24 18:20:02 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-19 03:12:30 +0100 |
commit | 7a9d1ad2f873003e6aad637e8749b77b91247da3 (patch) | |
tree | e167a5d5ad73dbd78dc4b5c165b12a1220a167f4 /src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | |
parent | Core: Initial implementation of device memory mapping (diff) | |
download | yuzu-7a9d1ad2f873003e6aad637e8749b77b91247da3.tar yuzu-7a9d1ad2f873003e6aad637e8749b77b91247da3.tar.gz yuzu-7a9d1ad2f873003e6aad637e8749b77b91247da3.tar.bz2 yuzu-7a9d1ad2f873003e6aad637e8749b77b91247da3.tar.lz yuzu-7a9d1ad2f873003e6aad637e8749b77b91247da3.tar.xz yuzu-7a9d1ad2f873003e6aad637e8749b77b91247da3.tar.zst yuzu-7a9d1ad2f873003e6aad637e8749b77b91247da3.zip |
Diffstat (limited to 'src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index f43914e1b..63228518e 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp @@ -35,7 +35,7 @@ NvResult nvhost_nvdec::Ioctl1(DeviceFD fd, Ioctl command, std::span<const u8> in case 0x7: return WrapFixed(this, &nvhost_nvdec::SetSubmitTimeout, input, output); case 0x9: - return WrapFixedVariable(this, &nvhost_nvdec::MapBuffer, input, output); + return WrapFixedVariable(this, &nvhost_nvdec::MapBuffer, input, output, fd); case 0xa: return WrapFixedVariable(this, &nvhost_nvdec::UnmapBuffer, input, output); default: @@ -68,9 +68,10 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, std::span<const u8> in return NvResult::NotImplemented; } -void nvhost_nvdec::OnOpen(DeviceFD fd) { +void nvhost_nvdec::OnOpen(size_t session_id, DeviceFD fd) { LOG_INFO(Service_NVDRV, "NVDEC video stream started"); system.SetNVDECActive(true); + sessions[fd] = session_id; } void nvhost_nvdec::OnClose(DeviceFD fd) { @@ -81,6 +82,10 @@ void nvhost_nvdec::OnClose(DeviceFD fd) { system.GPU().ClearCdmaInstance(iter->second); } system.SetNVDECActive(false); + auto it = sessions.find(fd); + if (it != sessions.end()) { + sessions.erase(it); + } } } // namespace Service::Nvidia::Devices |