|
|
@ -13,8 +13,8 @@ namespace Service {
|
|
|
|
namespace NVFlinger {
|
|
|
|
namespace NVFlinger {
|
|
|
|
|
|
|
|
|
|
|
|
BufferQueue::BufferQueue(u32 id, u64 layer_id) : id(id), layer_id(layer_id) {
|
|
|
|
BufferQueue::BufferQueue(u32 id, u64 layer_id) : id(id), layer_id(layer_id) {
|
|
|
|
native_handle = Kernel::Event::Create(Kernel::ResetType::OneShot, "BufferQueue NativeHandle");
|
|
|
|
buffer_wait_event =
|
|
|
|
native_handle->Signal();
|
|
|
|
Kernel::Event::Create(Kernel::ResetType::Sticky, "BufferQueue NativeHandle");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void BufferQueue::SetPreallocatedBuffer(u32 slot, IGBPBuffer& igbp_buffer) {
|
|
|
|
void BufferQueue::SetPreallocatedBuffer(u32 slot, IGBPBuffer& igbp_buffer) {
|
|
|
@ -26,10 +26,7 @@ void BufferQueue::SetPreallocatedBuffer(u32 slot, IGBPBuffer& igbp_buffer) {
|
|
|
|
LOG_WARNING(Service, "Adding graphics buffer {}", slot);
|
|
|
|
LOG_WARNING(Service, "Adding graphics buffer {}", slot);
|
|
|
|
|
|
|
|
|
|
|
|
queue.emplace_back(buffer);
|
|
|
|
queue.emplace_back(buffer);
|
|
|
|
|
|
|
|
buffer_wait_event->Signal();
|
|
|
|
if (buffer_wait_event) {
|
|
|
|
|
|
|
|
buffer_wait_event->Signal();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boost::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
|
|
|
|
boost::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
|
|
|
@ -48,8 +45,6 @@ boost::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
|
|
|
|
return boost::none;
|
|
|
|
return boost::none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
buffer_wait_event = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
itr->status = Buffer::Status::Dequeued;
|
|
|
|
itr->status = Buffer::Status::Dequeued;
|
|
|
|
return itr->slot;
|
|
|
|
return itr->slot;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -88,9 +83,7 @@ void BufferQueue::ReleaseBuffer(u32 slot) {
|
|
|
|
ASSERT(itr->status == Buffer::Status::Acquired);
|
|
|
|
ASSERT(itr->status == Buffer::Status::Acquired);
|
|
|
|
itr->status = Buffer::Status::Free;
|
|
|
|
itr->status = Buffer::Status::Free;
|
|
|
|
|
|
|
|
|
|
|
|
if (buffer_wait_event) {
|
|
|
|
buffer_wait_event->Signal();
|
|
|
|
buffer_wait_event->Signal();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
u32 BufferQueue::Query(QueryType type) {
|
|
|
|
u32 BufferQueue::Query(QueryType type) {
|
|
|
@ -106,10 +99,5 @@ u32 BufferQueue::Query(QueryType type) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void BufferQueue::SetBufferWaitEvent(Kernel::SharedPtr<Kernel::Event>&& wait_event) {
|
|
|
|
|
|
|
|
ASSERT_MSG(!buffer_wait_event, "buffer_wait_event only supports a single waiting thread!");
|
|
|
|
|
|
|
|
buffer_wait_event = std::move(wait_event);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace NVFlinger
|
|
|
|
} // namespace NVFlinger
|
|
|
|
} // namespace Service
|
|
|
|
} // namespace Service
|
|
|
|