diff options
author | Feng Chen <VonChenPlus@gmail.com> | 2021-12-18 06:57:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-18 06:57:14 +0100 |
commit | e49184e6069a9d791d2df3c1958f5c4b1187e124 (patch) | |
tree | b776caf722e0be0e680f67b0ad0842628162ef1c /src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | |
parent | Implement convert legacy to generic (diff) | |
parent | Merge pull request #7570 from ameerj/favorites-expanded (diff) | |
download | yuzu-e49184e6069a9d791d2df3c1958f5c4b1187e124.tar yuzu-e49184e6069a9d791d2df3c1958f5c4b1187e124.tar.gz yuzu-e49184e6069a9d791d2df3c1958f5c4b1187e124.tar.bz2 yuzu-e49184e6069a9d791d2df3c1958f5c4b1187e124.tar.lz yuzu-e49184e6069a9d791d2df3c1958f5c4b1187e124.tar.xz yuzu-e49184e6069a9d791d2df3c1958f5c4b1187e124.tar.zst yuzu-e49184e6069a9d791d2df3c1958f5c4b1187e124.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index 0d7d4ad03..8314d1ec2 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp @@ -20,8 +20,12 @@ NvResult nvhost_nvdec::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& switch (command.group) { case 0x0: switch (command.cmd) { - case 0x1: - return Submit(input, output); + case 0x1: { + if (!fd_to_id.contains(fd)) { + fd_to_id[fd] = next_id++; + } + return Submit(fd, input, output); + } case 0x2: return GetSyncpoint(input, output); case 0x3: @@ -66,7 +70,10 @@ void nvhost_nvdec::OnOpen(DeviceFD fd) {} void nvhost_nvdec::OnClose(DeviceFD fd) { LOG_INFO(Service_NVDRV, "NVDEC video stream ended"); - system.GPU().ClearCdmaInstance(); + const auto iter = fd_to_id.find(fd); + if (iter != fd_to_id.end()) { + system.GPU().ClearCdmaInstance(iter->second); + } } } // namespace Service::Nvidia::Devices |