Skip to content
Snippets Groups Projects
Commit d6e830d8 authored by David Marcec's avatar David Marcec
Browse files

Deglobalize System: NvFlinger

parent f21ab654
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,8 @@ namespace Service::NVFlinger { ...@@ -29,7 +29,8 @@ namespace Service::NVFlinger {
constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60); constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60);
constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 30); constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 30);
NVFlinger::NVFlinger(Core::Timing::CoreTiming& core_timing) : core_timing{core_timing} { NVFlinger::NVFlinger(Core::Timing::CoreTiming& core_timing, Core::System& system)
: core_timing{core_timing}, system(system) {
displays.emplace_back(0, "Default"); displays.emplace_back(0, "Default");
displays.emplace_back(1, "External"); displays.emplace_back(1, "External");
displays.emplace_back(2, "Edid"); displays.emplace_back(2, "Edid");
...@@ -185,11 +186,9 @@ void NVFlinger::Compose() { ...@@ -185,11 +186,9 @@ void NVFlinger::Compose() {
MicroProfileFlip(); MicroProfileFlip();
if (!buffer) { if (!buffer) {
auto& system_instance = Core::System::GetInstance();
// There was no queued buffer to draw, render previous frame // There was no queued buffer to draw, render previous frame
system_instance.GetPerfStats().EndGameFrame(); system.GetPerfStats().EndGameFrame();
system_instance.GPU().SwapBuffers({}); system.GPU().SwapBuffers({});
continue; continue;
} }
......
...@@ -38,7 +38,7 @@ class BufferQueue; ...@@ -38,7 +38,7 @@ class BufferQueue;
class NVFlinger final { class NVFlinger final {
public: public:
explicit NVFlinger(Core::Timing::CoreTiming& core_timing); explicit NVFlinger(Core::Timing::CoreTiming& core_timing, Core::System& system);
~NVFlinger(); ~NVFlinger();
/// Sets the NVDrv module instance to use to send buffers to the GPU. /// Sets the NVDrv module instance to use to send buffers to the GPU.
...@@ -107,6 +107,8 @@ private: ...@@ -107,6 +107,8 @@ private:
/// Core timing instance for registering/unregistering the composition event. /// Core timing instance for registering/unregistering the composition event.
Core::Timing::CoreTiming& core_timing; Core::Timing::CoreTiming& core_timing;
Core::System& system;
}; };
} // namespace Service::NVFlinger } // namespace Service::NVFlinger
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment