diff options
author | Feng Chen <vonchenplus@gmail.com> | 2021-12-02 05:19:43 +0100 |
---|---|---|
committer | Feng Chen <vonchenplus@gmail.com> | 2021-12-02 05:48:42 +0100 |
commit | 2c47f8aa1886522898b5b3a73185b5662be3e9f3 (patch) | |
tree | badff9fee7c63a693fd9da3c6fb2cfe34d2d9ed1 /src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | |
parent | Merge pull request #7483 from zhaobot/tx-update-20211201022129 (diff) | |
download | yuzu-2c47f8aa1886522898b5b3a73185b5662be3e9f3.tar yuzu-2c47f8aa1886522898b5b3a73185b5662be3e9f3.tar.gz yuzu-2c47f8aa1886522898b5b3a73185b5662be3e9f3.tar.bz2 yuzu-2c47f8aa1886522898b5b3a73185b5662be3e9f3.tar.lz yuzu-2c47f8aa1886522898b5b3a73185b5662be3e9f3.tar.xz yuzu-2c47f8aa1886522898b5b3a73185b5662be3e9f3.tar.zst yuzu-2c47f8aa1886522898b5b3a73185b5662be3e9f3.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 | 11 |
1 files changed, 8 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..8e2a16d86 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp @@ -21,7 +21,7 @@ NvResult nvhost_nvdec::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& case 0x0: switch (command.cmd) { case 0x1: - return Submit(input, output); + return Submit(fd, input, output); case 0x2: return GetSyncpoint(input, output); case 0x3: @@ -62,11 +62,16 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>& return NvResult::NotImplemented; } -void nvhost_nvdec::OnOpen(DeviceFD fd) {} +void nvhost_nvdec::OnOpen(DeviceFD fd) { + static u32 next_id{}; + fd_to_id[fd] = next_id++; +} void nvhost_nvdec::OnClose(DeviceFD fd) { LOG_INFO(Service_NVDRV, "NVDEC video stream ended"); - system.GPU().ClearCdmaInstance(); + if (fd_to_id.find(fd) != fd_to_id.end()) { + system.GPU().ClearCdmaInstance(fd_to_id[fd]); + } } } // namespace Service::Nvidia::Devices |