From d378d98e2628f83fa56242ec6b53e3cce7c6bb56 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 7 Aug 2018 09:17:09 -0400 Subject: nvdrv: Get rid of global std::weak_ptr Rather than use global state, we can simply pass the instance into the NVFlinger instance directly. --- src/core/hle/service/nvflinger/nvflinger.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/hle/service/nvflinger/nvflinger.h') diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index 5374df175..f7112949f 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h @@ -16,6 +16,10 @@ namespace CoreTiming { struct EventType; } +namespace Service::Nvidia { +class Module; +} + namespace Service::NVFlinger { class BufferQueue; @@ -44,6 +48,9 @@ public: NVFlinger(); ~NVFlinger(); + /// Sets the NVDrv module instance to use to send buffers to the GPU. + void SetNVDrvInstance(std::shared_ptr instance); + /// Opens the specified display and returns the id. u64 OpenDisplay(std::string_view name); @@ -70,6 +77,8 @@ private: /// Returns the layer identified by the specified id in the desired display. Layer& GetLayer(u64 display_id, u64 layer_id); + std::shared_ptr nvdrv; + std::vector displays; std::vector> buffer_queues; -- cgit v1.2.3