diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-07-01 02:18:33 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:54 +0200 |
commit | d97d409647686aefe701aec1363e328be11d1443 (patch) | |
tree | 1151c282fe7dbf5e30d00298ec8224511d80462e /src/core/hle/service/nvdrv/devices | |
parent | Address Feedback from bylaws. (diff) | |
download | yuzu-d97d409647686aefe701aec1363e328be11d1443.tar yuzu-d97d409647686aefe701aec1363e328be11d1443.tar.gz yuzu-d97d409647686aefe701aec1363e328be11d1443.tar.bz2 yuzu-d97d409647686aefe701aec1363e328be11d1443.tar.lz yuzu-d97d409647686aefe701aec1363e328be11d1443.tar.xz yuzu-d97d409647686aefe701aec1363e328be11d1443.tar.zst yuzu-d97d409647686aefe701aec1363e328be11d1443.zip |
Diffstat (limited to 'src/core/hle/service/nvdrv/devices')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp index fe83423d5..2ec1ad3e9 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp @@ -47,15 +47,21 @@ std::size_t WriteVectors(std::vector<u8>& dst, const std::vector<T>& src, std::s } // Anonymous namespace std::unordered_map<DeviceFD, u32> nvhost_nvdec_common::fd_to_id{}; +std::deque<u32> nvhost_nvdec_common::syncpts_accumulated{}; nvhost_nvdec_common::nvhost_nvdec_common(Core::System& system_, NvCore::Container& core_, NvCore::ChannelType channel_type_) : nvdevice{system_}, core{core_}, syncpoint_manager{core.GetSyncpointManager()}, nvmap{core.GetNvMapFile()}, channel_type{channel_type_} { - channel_syncpoint = syncpoint_manager.AllocateSyncpoint(false); + if (syncpts_accumulated.empty()) { + channel_syncpoint = syncpoint_manager.AllocateSyncpoint(false); + } else { + channel_syncpoint = syncpts_accumulated.front(); + syncpts_accumulated.pop_front(); + } } nvhost_nvdec_common::~nvhost_nvdec_common() { - syncpoint_manager.FreeSyncpoint(channel_syncpoint); + syncpts_accumulated.push_back(channel_syncpoint); } NvResult nvhost_nvdec_common::SetNVMAPfd(const std::vector<u8>& input) { diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h index 4046b0e13..93990bb9b 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h @@ -3,6 +3,7 @@ #pragma once +#include <deque> #include <vector> #include "common/common_types.h" #include "common/swap.h" @@ -127,6 +128,8 @@ protected: NvCore::NvMap& nvmap; NvCore::ChannelType channel_type; std::array<u32, MaxSyncPoints> device_syncpoints{}; + + static std::deque<u32> syncpts_accumulated; }; }; // namespace Devices } // namespace Service::Nvidia |