summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
diff options
context:
space:
mode:
authorFeng Chen <vonchenplus@gmail.com>2021-12-03 05:31:07 +0100
committervonchenplus <vonchenplus@gmail.com>2021-12-04 17:06:14 +0100
commit5462485cc3835941713b835bce3b671b15d210b7 (patch)
treee054071cd06fd36a0ca03478e168cb866a057b15 /src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
parentSupport multiple videos playing (diff)
downloadyuzu-5462485cc3835941713b835bce3b671b15d210b7.tar
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.gz
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.bz2
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.lz
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.xz
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.zst
yuzu-5462485cc3835941713b835bce3b671b15d210b7.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_vic.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
index 420fe21c8..76b39806f 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
@@ -21,6 +21,9 @@ NvResult nvhost_vic::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& i
case 0x0:
switch (command.cmd) {
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);
@@ -62,14 +65,12 @@ NvResult nvhost_vic::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>& i
return NvResult::NotImplemented;
}
-void nvhost_vic::OnOpen(DeviceFD fd) {
- static u32 next_id{};
- fd_to_id[fd] = next_id++;
-}
+void nvhost_vic::OnOpen(DeviceFD fd) {}
void nvhost_vic::OnClose(DeviceFD fd) {
- if (fd_to_id.find(fd) != fd_to_id.end()) {
- system.GPU().ClearCdmaInstance(fd_to_id[fd]);
+ const auto iter = fd_to_id.find(fd);
+ if (iter != fd_to_id.end()) {
+ system.GPU().ClearCdmaInstance(iter->second);
}
}