summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2022-03-19 22:06:46 -0700
committerGravatar bunnei2022-03-24 18:13:33 -0700
commitddd5a2b1c67a82f0b1dbaa75dc4b99ee71f93173 (patch)
tree51dd49fec795ed3d2e4db833e191e5b142f1fe8b /src/core
parenthle: nvflinger: buffer_queue_core: Cleanup locking. (diff)
downloadyuzu-ddd5a2b1c67a82f0b1dbaa75dc4b99ee71f93173.tar.gz
yuzu-ddd5a2b1c67a82f0b1dbaa75dc4b99ee71f93173.tar.xz
yuzu-ddd5a2b1c67a82f0b1dbaa75dc4b99ee71f93173.zip
hle: nvflinger: buffer_queue_core: StillTracking: Take const reference.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue_consumer.cpp4
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue_core.cpp6
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue_core.h2
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue_producer.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp b/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp
index 5184d876a..cf12cceff 100644
--- a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp
@@ -74,7 +74,7 @@ Status BufferQueueConsumer::AcquireBuffer(BufferItem* out_buffer,
74 LOG_DEBUG(Service_NVFlinger, "drop desire={} expect={} size={}", desired_present, 74 LOG_DEBUG(Service_NVFlinger, "drop desire={} expect={} size={}", desired_present,
75 expected_present.count(), core->queue.size()); 75 expected_present.count(), core->queue.size());
76 76
77 if (core->StillTracking(&*front)) { 77 if (core->StillTracking(*front)) {
78 // Front buffer is still in mSlots, so mark the slot as free 78 // Front buffer is still in mSlots, so mark the slot as free
79 slots[front->slot].buffer_state = BufferState::Free; 79 slots[front->slot].buffer_state = BufferState::Free;
80 core->free_buffers.push_back(front->slot); 80 core->free_buffers.push_back(front->slot);
@@ -110,7 +110,7 @@ Status BufferQueueConsumer::AcquireBuffer(BufferItem* out_buffer,
110 LOG_DEBUG(Service_NVFlinger, "acquiring slot={}", slot); 110 LOG_DEBUG(Service_NVFlinger, "acquiring slot={}", slot);
111 111
112 // If the front buffer is still being tracked, update its slot state 112 // If the front buffer is still being tracked, update its slot state
113 if (core->StillTracking(&*front)) { 113 if (core->StillTracking(*front)) {
114 slots[slot].acquire_called = true; 114 slots[slot].acquire_called = true;
115 slots[slot].needs_cleanup_on_release = false; 115 slots[slot].needs_cleanup_on_release = false;
116 slots[slot].buffer_state = BufferState::Acquired; 116 slots[slot].buffer_state = BufferState::Acquired;
diff --git a/src/core/hle/service/nvflinger/buffer_queue_core.cpp b/src/core/hle/service/nvflinger/buffer_queue_core.cpp
index 4a26d2fdc..3f1ce78b0 100644
--- a/src/core/hle/service/nvflinger/buffer_queue_core.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue_core.cpp
@@ -116,10 +116,10 @@ void BufferQueueCore::FreeAllBuffersLocked() {
116 } 116 }
117} 117}
118 118
119bool BufferQueueCore::StillTracking(const BufferItem* item) const { 119bool BufferQueueCore::StillTracking(const BufferItem& item) const {
120 const BufferSlot& slot = slots[item->slot]; 120 const BufferSlot& slot = slots[item.slot];
121 121
122 return (slot.graphic_buffer != nullptr) && (item->graphic_buffer == slot.graphic_buffer); 122 return (slot.graphic_buffer != nullptr) && (item.graphic_buffer == slot.graphic_buffer);
123} 123}
124 124
125void BufferQueueCore::WaitWhileAllocatingLocked() const { 125void BufferQueueCore::WaitWhileAllocatingLocked() const {
diff --git a/src/core/hle/service/nvflinger/buffer_queue_core.h b/src/core/hle/service/nvflinger/buffer_queue_core.h
index 252a36350..ad10b4c3c 100644
--- a/src/core/hle/service/nvflinger/buffer_queue_core.h
+++ b/src/core/hle/service/nvflinger/buffer_queue_core.h
@@ -45,7 +45,7 @@ private:
45 s32 GetPreallocatedBufferCountLocked() const; 45 s32 GetPreallocatedBufferCountLocked() const;
46 void FreeBufferLocked(s32 slot); 46 void FreeBufferLocked(s32 slot);
47 void FreeAllBuffersLocked(); 47 void FreeAllBuffersLocked();
48 bool StillTracking(const BufferItem* item) const; 48 bool StillTracking(const BufferItem& item) const;
49 void WaitWhileAllocatingLocked() const; 49 void WaitWhileAllocatingLocked() const;
50 50
51private: 51private:
diff --git a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp
index 2f7e9dcfc..eba486754 100644
--- a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp
@@ -554,7 +554,7 @@ Status BufferQueueProducer::QueueBuffer(s32 slot, const QueueBufferInput& input,
554 if (front->is_droppable) { 554 if (front->is_droppable) {
555 // If the front queued buffer is still being tracked, we first 555 // If the front queued buffer is still being tracked, we first
556 // mark it as freed 556 // mark it as freed
557 if (core->StillTracking(&*front)) { 557 if (core->StillTracking(*front)) {
558 slots[front->slot].buffer_state = BufferState::Free; 558 slots[front->slot].buffer_state = BufferState::Free;
559 core->free_buffers.push_front(front->slot); 559 core->free_buffers.push_front(front->slot);
560 } 560 }