diff options
Diffstat (limited to 'src/core/hle/service/nvflinger/buffer_queue.cpp')
-rw-r--r-- | src/core/hle/service/nvflinger/buffer_queue.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp index 5578181a4..7842a82ed 100644 --- a/src/core/hle/service/nvflinger/buffer_queue.cpp +++ b/src/core/hle/service/nvflinger/buffer_queue.cpp @@ -7,16 +7,17 @@ #include "common/assert.h" #include "common/logging/log.h" #include "core/core.h" +#include "core/hle/kernel/k_event.h" +#include "core/hle/kernel/k_writable_event.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/readable_event.h" -#include "core/hle/kernel/writable_event.h" #include "core/hle/service/nvflinger/buffer_queue.h" namespace Service::NVFlinger { BufferQueue::BufferQueue(Kernel::KernelCore& kernel, u32 id, u64 layer_id) : id(id), layer_id(layer_id) { - buffer_wait_event = Kernel::WritableEvent::CreateEventPair(kernel, "BufferQueue NativeHandle"); + buffer_wait_event = Kernel::KEvent::Create(kernel, "BufferQueue:WaitEvent"); + buffer_wait_event->Initialize(); } BufferQueue::~BufferQueue() = default; @@ -41,7 +42,7 @@ void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer) .multi_fence = {}, }; - buffer_wait_event.writable->Signal(); + buffer_wait_event->GetWritableEvent()->Signal(); } std::optional<std::pair<u32, Service::Nvidia::MultiFence*>> BufferQueue::DequeueBuffer(u32 width, @@ -119,7 +120,7 @@ void BufferQueue::CancelBuffer(u32 slot, const Service::Nvidia::MultiFence& mult } free_buffers_condition.notify_one(); - buffer_wait_event.writable->Signal(); + buffer_wait_event->GetWritableEvent()->Signal(); } std::optional<std::reference_wrapper<const BufferQueue::Buffer>> BufferQueue::AcquireBuffer() { @@ -154,7 +155,7 @@ void BufferQueue::ReleaseBuffer(u32 slot) { } free_buffers_condition.notify_one(); - buffer_wait_event.writable->Signal(); + buffer_wait_event->GetWritableEvent()->Signal(); } void BufferQueue::Connect() { @@ -169,7 +170,7 @@ void BufferQueue::Disconnect() { std::unique_lock lock{queue_sequence_mutex}; queue_sequence.clear(); } - buffer_wait_event.writable->Signal(); + buffer_wait_event->GetWritableEvent()->Signal(); is_connect = false; free_buffers_condition.notify_one(); } @@ -188,12 +189,12 @@ u32 BufferQueue::Query(QueryType type) { return 0; } -std::shared_ptr<Kernel::WritableEvent> BufferQueue::GetWritableBufferWaitEvent() const { - return buffer_wait_event.writable; +std::shared_ptr<Kernel::KWritableEvent> BufferQueue::GetWritableBufferWaitEvent() const { + return buffer_wait_event->GetWritableEvent(); } -std::shared_ptr<Kernel::ReadableEvent> BufferQueue::GetBufferWaitEvent() const { - return buffer_wait_event.readable; +std::shared_ptr<Kernel::KReadableEvent> BufferQueue::GetBufferWaitEvent() const { + return buffer_wait_event->GetReadableEvent(); } } // namespace Service::NVFlinger |