diff options
| -rw-r--r-- | src/core/hle/service/nvnflinger/buffer_queue_core.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/nvnflinger/buffer_queue_producer.cpp | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/core/hle/service/nvnflinger/buffer_queue_core.cpp b/src/core/hle/service/nvnflinger/buffer_queue_core.cpp index 2dbe29616..ed66f6f5b 100644 --- a/src/core/hle/service/nvnflinger/buffer_queue_core.cpp +++ b/src/core/hle/service/nvnflinger/buffer_queue_core.cpp | |||
| @@ -41,7 +41,7 @@ bool BufferQueueCore::WaitForDequeueCondition(std::unique_lock<std::mutex>& lk) | |||
| 41 | s32 BufferQueueCore::GetMinUndequeuedBufferCountLocked(bool async) const { | 41 | s32 BufferQueueCore::GetMinUndequeuedBufferCountLocked(bool async) const { |
| 42 | // If DequeueBuffer is allowed to error out, we don't have to add an extra buffer. | 42 | // If DequeueBuffer is allowed to error out, we don't have to add an extra buffer. |
| 43 | if (!use_async_buffer) { | 43 | if (!use_async_buffer) { |
| 44 | return max_acquired_buffer_count; | 44 | return 0; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | if (dequeue_buffer_cannot_block || async) { | 47 | if (dequeue_buffer_cannot_block || async) { |
| @@ -52,7 +52,7 @@ s32 BufferQueueCore::GetMinUndequeuedBufferCountLocked(bool async) const { | |||
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | s32 BufferQueueCore::GetMinMaxBufferCountLocked(bool async) const { | 54 | s32 BufferQueueCore::GetMinMaxBufferCountLocked(bool async) const { |
| 55 | return GetMinUndequeuedBufferCountLocked(async) + 1; | 55 | return GetMinUndequeuedBufferCountLocked(async); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | s32 BufferQueueCore::GetMaxBufferCountLocked(bool async) const { | 58 | s32 BufferQueueCore::GetMaxBufferCountLocked(bool async) const { |
| @@ -61,7 +61,7 @@ s32 BufferQueueCore::GetMaxBufferCountLocked(bool async) const { | |||
| 61 | 61 | ||
| 62 | if (override_max_buffer_count != 0) { | 62 | if (override_max_buffer_count != 0) { |
| 63 | ASSERT(override_max_buffer_count >= min_buffer_count); | 63 | ASSERT(override_max_buffer_count >= min_buffer_count); |
| 64 | max_buffer_count = override_max_buffer_count; | 64 | return override_max_buffer_count; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | // Any buffers that are dequeued by the producer or sitting in the queue waiting to be consumed | 67 | // Any buffers that are dequeued by the producer or sitting in the queue waiting to be consumed |
diff --git a/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp b/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp index dc6917d5d..6e7a49658 100644 --- a/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp +++ b/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp | |||
| @@ -134,7 +134,7 @@ Status BufferQueueProducer::WaitForFreeSlotThenRelock(bool async, s32* found, St | |||
| 134 | const s32 max_buffer_count = core->GetMaxBufferCountLocked(async); | 134 | const s32 max_buffer_count = core->GetMaxBufferCountLocked(async); |
| 135 | if (async && core->override_max_buffer_count) { | 135 | if (async && core->override_max_buffer_count) { |
| 136 | if (core->override_max_buffer_count < max_buffer_count) { | 136 | if (core->override_max_buffer_count < max_buffer_count) { |
| 137 | LOG_ERROR(Service_Nvnflinger, "async mode is invalid with buffer count override"); | 137 | *found = BufferQueueCore::INVALID_BUFFER_SLOT; |
| 138 | return Status::BadValue; | 138 | return Status::BadValue; |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| @@ -142,7 +142,8 @@ Status BufferQueueProducer::WaitForFreeSlotThenRelock(bool async, s32* found, St | |||
| 142 | // Free up any buffers that are in slots beyond the max buffer count | 142 | // Free up any buffers that are in slots beyond the max buffer count |
| 143 | for (s32 s = max_buffer_count; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) { | 143 | for (s32 s = max_buffer_count; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) { |
| 144 | ASSERT(slots[s].buffer_state == BufferState::Free); | 144 | ASSERT(slots[s].buffer_state == BufferState::Free); |
| 145 | if (slots[s].graphic_buffer != nullptr) { | 145 | if (slots[s].graphic_buffer != nullptr && slots[s].buffer_state == BufferState::Free && |
| 146 | !slots[s].is_preallocated) { | ||
| 146 | core->FreeBufferLocked(s); | 147 | core->FreeBufferLocked(s); |
| 147 | *return_flags |= Status::ReleaseAllBuffers; | 148 | *return_flags |= Status::ReleaseAllBuffers; |
| 148 | } | 149 | } |