diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-20 19:34:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-20 19:34:32 +0100 |
commit | 23fd1041c1373aea8ac36236c8bc681f9483d25d (patch) | |
tree | 116693463c6c32b2eab47adc2262526218018a41 /src/core/hle/service/vi/display/vi_display.cpp | |
parent | Merge pull request #12713 from shinra-electric/mvk-127 (diff) | |
parent | vi: check layer state before opening or closing (diff) | |
download | yuzu-23fd1041c1373aea8ac36236c8bc681f9483d25d.tar yuzu-23fd1041c1373aea8ac36236c8bc681f9483d25d.tar.gz yuzu-23fd1041c1373aea8ac36236c8bc681f9483d25d.tar.bz2 yuzu-23fd1041c1373aea8ac36236c8bc681f9483d25d.tar.lz yuzu-23fd1041c1373aea8ac36236c8bc681f9483d25d.tar.xz yuzu-23fd1041c1373aea8ac36236c8bc681f9483d25d.tar.zst yuzu-23fd1041c1373aea8ac36236c8bc681f9483d25d.zip |
Diffstat (limited to 'src/core/hle/service/vi/display/vi_display.cpp')
-rw-r--r-- | src/core/hle/service/vi/display/vi_display.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index e2d9cd98a..725311c53 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp @@ -91,6 +91,10 @@ void Display::CreateLayer(u64 layer_id, u32 binder_id, layers.emplace_back(std::make_unique<Layer>(layer_id, binder_id, *core, *producer, std::move(buffer_item_consumer))); + if (is_abandoned) { + this->FindLayer(layer_id)->GetConsumer().Abandon(); + } + hos_binder_driver_server.RegisterProducer(std::move(producer)); } @@ -103,6 +107,13 @@ void Display::DestroyLayer(u64 layer_id) { [layer_id](const auto& layer) { return layer->GetLayerId() == layer_id; }); } +void Display::Abandon() { + for (auto& layer : layers) { + layer->GetConsumer().Abandon(); + } + is_abandoned = true; +} + Layer* Display::FindLayer(u64 layer_id) { const auto itr = std::find_if(layers.begin(), layers.end(), [layer_id](const std::unique_ptr<Layer>& layer) { |