summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-10 11:34:26 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:51 +0200
commit2e8d6fe9a0c07538397682e1cb25992bfd15676d (patch)
tree444ee462a197818e0114150a03c0a5898cadaa19 /src/core/hle/service/nvflinger
parenthle: ipc_helpers: Add methods for copy/move references. (diff)
downloadyuzu-2e8d6fe9a0c07538397682e1cb25992bfd15676d.tar
yuzu-2e8d6fe9a0c07538397682e1cb25992bfd15676d.tar.gz
yuzu-2e8d6fe9a0c07538397682e1cb25992bfd15676d.tar.bz2
yuzu-2e8d6fe9a0c07538397682e1cb25992bfd15676d.tar.lz
yuzu-2e8d6fe9a0c07538397682e1cb25992bfd15676d.tar.xz
yuzu-2e8d6fe9a0c07538397682e1cb25992bfd15676d.tar.zst
yuzu-2e8d6fe9a0c07538397682e1cb25992bfd15676d.zip
Diffstat (limited to 'src/core/hle/service/nvflinger')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.cpp12
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.h4
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp6
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index 95e5a5e7f..0b6e7430b 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -41,7 +41,7 @@ void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer)
.multi_fence = {},
};
- buffer_wait_event.GetWritableEvent()->Signal();
+ buffer_wait_event.GetWritableEvent().Signal();
}
std::optional<std::pair<u32, Service::Nvidia::MultiFence*>> BufferQueue::DequeueBuffer(u32 width,
@@ -119,7 +119,7 @@ void BufferQueue::CancelBuffer(u32 slot, const Service::Nvidia::MultiFence& mult
}
free_buffers_condition.notify_one();
- buffer_wait_event.GetWritableEvent()->Signal();
+ buffer_wait_event.GetWritableEvent().Signal();
}
std::optional<std::reference_wrapper<const BufferQueue::Buffer>> BufferQueue::AcquireBuffer() {
@@ -154,7 +154,7 @@ void BufferQueue::ReleaseBuffer(u32 slot) {
}
free_buffers_condition.notify_one();
- buffer_wait_event.GetWritableEvent()->Signal();
+ buffer_wait_event.GetWritableEvent().Signal();
}
void BufferQueue::Connect() {
@@ -169,7 +169,7 @@ void BufferQueue::Disconnect() {
std::unique_lock lock{queue_sequence_mutex};
queue_sequence.clear();
}
- buffer_wait_event.GetWritableEvent()->Signal();
+ buffer_wait_event.GetWritableEvent().Signal();
is_connect = false;
free_buffers_condition.notify_one();
}
@@ -188,11 +188,11 @@ u32 BufferQueue::Query(QueryType type) {
return 0;
}
-std::shared_ptr<Kernel::KWritableEvent> BufferQueue::GetWritableBufferWaitEvent() const {
+Kernel::KWritableEvent& BufferQueue::GetWritableBufferWaitEvent() {
return buffer_wait_event.GetWritableEvent();
}
-std::shared_ptr<Kernel::KReadableEvent> BufferQueue::GetBufferWaitEvent() const {
+Kernel::KReadableEvent& BufferQueue::GetBufferWaitEvent() {
return buffer_wait_event.GetReadableEvent();
}
diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h
index 0d2010ad5..044e51d08 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.h
+++ b/src/core/hle/service/nvflinger/buffer_queue.h
@@ -117,9 +117,9 @@ public:
return is_connect;
}
- std::shared_ptr<Kernel::KWritableEvent> GetWritableBufferWaitEvent() const;
+ Kernel::KWritableEvent& GetWritableBufferWaitEvent();
- std::shared_ptr<Kernel::KReadableEvent> GetBufferWaitEvent() const;
+ Kernel::KReadableEvent& GetBufferWaitEvent();
private:
BufferQueue(const BufferQueue&) = delete;
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index c90e4d083..7fb9133c7 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -165,15 +165,15 @@ std::optional<u32> NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) co
return layer->GetBufferQueue().GetId();
}
-std::shared_ptr<Kernel::KReadableEvent> NVFlinger::FindVsyncEvent(u64 display_id) {
- const auto lock_guard = Lock();
+Kernel::KReadableEvent* NVFlinger::FindVsyncEvent(u64 display_id) {
+ const auto lock_guard = Lock();
auto* const display = FindDisplay(display_id);
if (display == nullptr) {
return nullptr;
}
- return display->GetVSyncEvent();
+ return &display->GetVSyncEvent();
}
BufferQueue* NVFlinger::FindBufferQueue(u32 id) {
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h
index d51b905c1..1c0aa8ec4 100644
--- a/src/core/hle/service/nvflinger/nvflinger.h
+++ b/src/core/hle/service/nvflinger/nvflinger.h
@@ -73,7 +73,7 @@ public:
/// Gets the vsync event for the specified display.
///
/// If an invalid display ID is provided, then nullptr is returned.
- [[nodiscard]] std::shared_ptr<Kernel::KReadableEvent> FindVsyncEvent(u64 display_id);
+ [[nodiscard]] Kernel::KReadableEvent* FindVsyncEvent(u64 display_id);
/// Obtains a buffer queue identified by the ID.
[[nodiscard]] BufferQueue* FindBufferQueue(u32 id);