summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h
index 0be55e442..ff85cbba6 100644
--- a/src/core/hle/service/nvflinger/nvflinger.h
+++ b/src/core/hle/service/nvflinger/nvflinger.h
@@ -54,12 +54,12 @@ public:
54 /// Opens the specified display and returns the ID. 54 /// Opens the specified display and returns the ID.
55 /// 55 ///
56 /// If an invalid display name is provided, then an empty optional is returned. 56 /// If an invalid display name is provided, then an empty optional is returned.
57 std::optional<u64> OpenDisplay(std::string_view name); 57 [[nodiscard]] std::optional<u64> OpenDisplay(std::string_view name);
58 58
59 /// Creates a layer on the specified display and returns the layer ID. 59 /// Creates a layer on the specified display and returns the layer ID.
60 /// 60 ///
61 /// If an invalid display ID is specified, then an empty optional is returned. 61 /// If an invalid display ID is specified, then an empty optional is returned.
62 std::optional<u64> CreateLayer(u64 display_id); 62 [[nodiscard]] std::optional<u64> CreateLayer(u64 display_id);
63 63
64 /// Closes a layer on all displays for the given layer ID. 64 /// Closes a layer on all displays for the given layer ID.
65 void CloseLayer(u64 layer_id); 65 void CloseLayer(u64 layer_id);
@@ -67,41 +67,39 @@ public:
67 /// Finds the buffer queue ID of the specified layer in the specified display. 67 /// Finds the buffer queue ID of the specified layer in the specified display.
68 /// 68 ///
69 /// If an invalid display ID or layer ID is provided, then an empty optional is returned. 69 /// If an invalid display ID or layer ID is provided, then an empty optional is returned.
70 std::optional<u32> FindBufferQueueId(u64 display_id, u64 layer_id) const; 70 [[nodiscard]] std::optional<u32> FindBufferQueueId(u64 display_id, u64 layer_id) const;
71 71
72 /// Gets the vsync event for the specified display. 72 /// Gets the vsync event for the specified display.
73 /// 73 ///
74 /// If an invalid display ID is provided, then nullptr is returned. 74 /// If an invalid display ID is provided, then nullptr is returned.
75 std::shared_ptr<Kernel::ReadableEvent> FindVsyncEvent(u64 display_id) const; 75 [[nodiscard]] std::shared_ptr<Kernel::ReadableEvent> FindVsyncEvent(u64 display_id) const;
76 76
77 /// Obtains a buffer queue identified by the ID. 77 /// Obtains a buffer queue identified by the ID.
78 BufferQueue& FindBufferQueue(u32 id); 78 [[nodiscard]] BufferQueue& FindBufferQueue(u32 id);
79 79
80 /// Obtains a buffer queue identified by the ID. 80 /// Obtains a buffer queue identified by the ID.
81 const BufferQueue& FindBufferQueue(u32 id) const; 81 [[nodiscard]] const BufferQueue& FindBufferQueue(u32 id) const;
82 82
83 /// Performs a composition request to the emulated nvidia GPU and triggers the vsync events when 83 /// Performs a composition request to the emulated nvidia GPU and triggers the vsync events when
84 /// finished. 84 /// finished.
85 void Compose(); 85 void Compose();
86 86
87 s64 GetNextTicks() const; 87 [[nodiscard]] s64 GetNextTicks() const;
88 88
89 std::unique_lock<std::mutex> Lock() const { 89 [[nodiscard]] std::unique_lock<std::mutex> Lock() const { return std::unique_lock{*guard}; }
90 return std::unique_lock{*guard};
91 }
92 90
93private: 91 private :
94 /// Finds the display identified by the specified ID. 92 /// Finds the display identified by the specified ID.
95 VI::Display* FindDisplay(u64 display_id); 93 [[nodiscard]] VI::Display* FindDisplay(u64 display_id);
96 94
97 /// Finds the display identified by the specified ID. 95 /// Finds the display identified by the specified ID.
98 const VI::Display* FindDisplay(u64 display_id) const; 96 [[nodiscard]] const VI::Display* FindDisplay(u64 display_id) const;
99 97
100 /// Finds the layer identified by the specified ID in the desired display. 98 /// Finds the layer identified by the specified ID in the desired display.
101 VI::Layer* FindLayer(u64 display_id, u64 layer_id); 99 [[nodiscard]] VI::Layer* FindLayer(u64 display_id, u64 layer_id);
102 100
103 /// Finds the layer identified by the specified ID in the desired display. 101 /// Finds the layer identified by the specified ID in the desired display.
104 const VI::Layer* FindLayer(u64 display_id, u64 layer_id) const; 102 [[nodiscard]] const VI::Layer* FindLayer(u64 display_id, u64 layer_id) const;
105 103
106 static void VSyncThread(NVFlinger& nv_flinger); 104 static void VSyncThread(NVFlinger& nv_flinger);
107 105