mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-11-22 22:55:44 +01:00
Address feedback
This commit is contained in:
parent
2c47f8aa18
commit
5462485cc3
@ -20,8 +20,12 @@ NvResult nvhost_nvdec::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>&
|
|||||||
switch (command.group) {
|
switch (command.group) {
|
||||||
case 0x0:
|
case 0x0:
|
||||||
switch (command.cmd) {
|
switch (command.cmd) {
|
||||||
case 0x1:
|
case 0x1: {
|
||||||
|
if (!fd_to_id.contains(fd)) {
|
||||||
|
fd_to_id[fd] = next_id++;
|
||||||
|
}
|
||||||
return Submit(fd, input, output);
|
return Submit(fd, input, output);
|
||||||
|
}
|
||||||
case 0x2:
|
case 0x2:
|
||||||
return GetSyncpoint(input, output);
|
return GetSyncpoint(input, output);
|
||||||
case 0x3:
|
case 0x3:
|
||||||
@ -62,15 +66,13 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>&
|
|||||||
return NvResult::NotImplemented;
|
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) {
|
void nvhost_nvdec::OnClose(DeviceFD fd) {
|
||||||
LOG_INFO(Service_NVDRV, "NVDEC video stream ended");
|
LOG_INFO(Service_NVDRV, "NVDEC video stream ended");
|
||||||
if (fd_to_id.find(fd) != fd_to_id.end()) {
|
const auto iter = fd_to_id.find(fd);
|
||||||
system.GPU().ClearCdmaInstance(fd_to_id[fd]);
|
if (iter != fd_to_id.end()) {
|
||||||
|
system.GPU().ClearCdmaInstance(iter->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,9 @@ public:
|
|||||||
|
|
||||||
void OnOpen(DeviceFD fd) override;
|
void OnOpen(DeviceFD fd) override;
|
||||||
void OnClose(DeviceFD fd) override;
|
void OnClose(DeviceFD fd) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
u32 next_id{};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Service::Nvidia::Devices
|
} // namespace Service::Nvidia::Devices
|
||||||
|
@ -21,6 +21,9 @@ NvResult nvhost_vic::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& i
|
|||||||
case 0x0:
|
case 0x0:
|
||||||
switch (command.cmd) {
|
switch (command.cmd) {
|
||||||
case 0x1:
|
case 0x1:
|
||||||
|
if (!fd_to_id.contains(fd)) {
|
||||||
|
fd_to_id[fd] = next_id++;
|
||||||
|
}
|
||||||
return Submit(fd, input, output);
|
return Submit(fd, input, output);
|
||||||
case 0x2:
|
case 0x2:
|
||||||
return GetSyncpoint(input, output);
|
return GetSyncpoint(input, output);
|
||||||
@ -62,14 +65,12 @@ NvResult nvhost_vic::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>& i
|
|||||||
return NvResult::NotImplemented;
|
return NvResult::NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nvhost_vic::OnOpen(DeviceFD fd) {
|
void nvhost_vic::OnOpen(DeviceFD fd) {}
|
||||||
static u32 next_id{};
|
|
||||||
fd_to_id[fd] = next_id++;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nvhost_vic::OnClose(DeviceFD fd) {
|
void nvhost_vic::OnClose(DeviceFD fd) {
|
||||||
if (fd_to_id.find(fd) != fd_to_id.end()) {
|
const auto iter = fd_to_id.find(fd);
|
||||||
system.GPU().ClearCdmaInstance(fd_to_id[fd]);
|
if (iter != fd_to_id.end()) {
|
||||||
|
system.GPU().ClearCdmaInstance(iter->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,5 +23,8 @@ public:
|
|||||||
|
|
||||||
void OnOpen(DeviceFD fd) override;
|
void OnOpen(DeviceFD fd) override;
|
||||||
void OnClose(DeviceFD fd) override;
|
void OnClose(DeviceFD fd) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
u32 next_id{};
|
||||||
};
|
};
|
||||||
} // namespace Service::Nvidia::Devices
|
} // namespace Service::Nvidia::Devices
|
||||||
|
@ -333,8 +333,8 @@ struct GPU::Impl {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cdma_pushers.find(id) == cdma_pushers.end()) {
|
if (!cdma_pushers.contains(id)) {
|
||||||
cdma_pushers[id] = std::make_unique<Tegra::CDmaPusher>(gpu);
|
cdma_pushers.insert_or_assign(id, std::make_unique<Tegra::CDmaPusher>(gpu));
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubmitCommandBuffer would make the nvdec operations async, this is not currently working
|
// SubmitCommandBuffer would make the nvdec operations async, this is not currently working
|
||||||
@ -345,8 +345,9 @@ struct GPU::Impl {
|
|||||||
|
|
||||||
/// Frees the CDMAPusher instance to free up resources
|
/// Frees the CDMAPusher instance to free up resources
|
||||||
void ClearCdmaInstance(u32 id) {
|
void ClearCdmaInstance(u32 id) {
|
||||||
if (cdma_pushers.find(id) != cdma_pushers.end()) {
|
const auto iter = cdma_pushers.find(id);
|
||||||
cdma_pushers.erase(id);
|
if (iter != cdma_pushers.end()) {
|
||||||
|
cdma_pushers.erase(iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user