service: nvnflinger: Implement shared buffer

Co-authored-by: Liam <byteslice@airmail.cc>
This commit is contained in:
Narr the Reg
2023-09-28 23:45:49 -06:00
parent f1f3d490ef
commit 35f25882e0
12 changed files with 572 additions and 22 deletions

View File

@@ -45,6 +45,9 @@ class BufferQueueProducer;
namespace Service::Nvnflinger {
class FbShareBufferManager;
class HosBinderDriverServer;
class Nvnflinger final {
public:
explicit Nvnflinger(Core::System& system_, HosBinderDriverServer& hos_binder_driver_server_);
@@ -90,12 +93,16 @@ public:
[[nodiscard]] s64 GetNextTicks() const;
FbShareBufferManager& GetSystemBufferManager();
private:
struct Layer {
std::unique_ptr<android::BufferQueueCore> core;
std::unique_ptr<android::BufferQueueProducer> producer;
};
friend class FbShareBufferManager;
private:
[[nodiscard]] std::unique_lock<std::mutex> Lock() const {
return std::unique_lock{*guard};
@@ -140,6 +147,8 @@ private:
std::shared_ptr<Core::Timing::EventType> multi_composition_event;
std::shared_ptr<Core::Timing::EventType> single_composition_event;
std::unique_ptr<FbShareBufferManager> system_buffer_manager;
std::shared_ptr<std::mutex> guard;
Core::System& system;