diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-11-18 02:41:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-18 02:41:23 +0100 |
commit | 6c64d5aff29c004fbc6c7fd4657e8868144d5283 (patch) | |
tree | 5c283caec0d5f680b8d609b1375259a5ae5a5a3d /src/core/hle/service/nvnflinger/consumer_base.cpp | |
parent | Merge pull request #12055 from german77/activate (diff) | |
parent | nvnflinger: implement consumer abandonment (diff) | |
download | yuzu-6c64d5aff29c004fbc6c7fd4657e8868144d5283.tar yuzu-6c64d5aff29c004fbc6c7fd4657e8868144d5283.tar.gz yuzu-6c64d5aff29c004fbc6c7fd4657e8868144d5283.tar.bz2 yuzu-6c64d5aff29c004fbc6c7fd4657e8868144d5283.tar.lz yuzu-6c64d5aff29c004fbc6c7fd4657e8868144d5283.tar.xz yuzu-6c64d5aff29c004fbc6c7fd4657e8868144d5283.tar.zst yuzu-6c64d5aff29c004fbc6c7fd4657e8868144d5283.zip |
Diffstat (limited to 'src/core/hle/service/nvnflinger/consumer_base.cpp')
-rw-r--r-- | src/core/hle/service/nvnflinger/consumer_base.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/service/nvnflinger/consumer_base.cpp b/src/core/hle/service/nvnflinger/consumer_base.cpp index 4dcda8dac..1059e72bf 100644 --- a/src/core/hle/service/nvnflinger/consumer_base.cpp +++ b/src/core/hle/service/nvnflinger/consumer_base.cpp @@ -27,6 +27,26 @@ void ConsumerBase::Connect(bool controlled_by_app) { consumer->Connect(shared_from_this(), controlled_by_app); } +void ConsumerBase::Abandon() { + LOG_DEBUG(Service_Nvnflinger, "called"); + + std::scoped_lock lock{mutex}; + + if (!is_abandoned) { + this->AbandonLocked(); + is_abandoned = true; + } +} + +void ConsumerBase::AbandonLocked() { + for (int i = 0; i < BufferQueueDefs::NUM_BUFFER_SLOTS; i++) { + this->FreeBufferLocked(i); + } + // disconnect from the BufferQueue + consumer->Disconnect(); + consumer = nullptr; +} + void ConsumerBase::FreeBufferLocked(s32 slot_index) { LOG_DEBUG(Service_Nvnflinger, "slot_index={}", slot_index); |