summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/vi/vi.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-12-17 06:09:06 +0100
committerbunnei <bunneidev@gmail.com>2020-12-29 06:33:34 +0100
commit6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e (patch)
treed2a9a23be1a80d9351f99d7feb7978f3c2237882 /src/core/hle/service/vi/vi.cpp
parenthle: service: Ensure system is powered on before writing IPC result. (diff)
downloadyuzu-6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e.tar
yuzu-6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e.tar.gz
yuzu-6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e.tar.bz2
yuzu-6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e.tar.lz
yuzu-6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e.tar.xz
yuzu-6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e.tar.zst
yuzu-6433b1dfd67f4c4f0c4b2e3742dc437a0d1e906e.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/vi/vi.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index ce0272e59..1051000f8 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -544,6 +544,12 @@ private:
Settings::values.resolution_factor.GetValue()),
static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedHeight) *
Settings::values.resolution_factor.GetValue())};
+
+ {
+ auto& buffer_queue = *nv_flinger.FindBufferQueue(id);
+ buffer_queue.Connect();
+ }
+
ctx.WriteBuffer(response.Serialize());
break;
}
@@ -565,18 +571,15 @@ private:
const u32 width{request.data.width};
const u32 height{request.data.height};
- std::optional<std::pair<u32, Service::Nvidia::MultiFence*>> result;
-
- while (!result) {
- auto& buffer_queue = *nv_flinger.FindBufferQueue(id);
- result = buffer_queue.DequeueBuffer(width, height);
-
- if (result) {
+ auto& buffer_queue = *nv_flinger.FindBufferQueue(id);
+ do {
+ if (auto result = buffer_queue.DequeueBuffer(width, height); result) {
// Buffer is available
IGBPDequeueBufferResponseParcel response{result->first, *result->second};
ctx.WriteBuffer(response.Serialize());
+ break;
}
- }
+ } while (buffer_queue.IsConnected());
break;
}