diff options
| author | 2022-10-25 17:42:02 -0400 | |
|---|---|---|
| committer | 2022-10-27 08:27:38 -0400 | |
| commit | cdb9fe978ff29b1de2256f0d0cece550195f3fef (patch) | |
| tree | 0ae5fbd5632046b5f711bc9f302b0ede1f2cce88 /src/core/hle/service/nvflinger | |
| parent | Merge pull request #9125 from liamwhite/dummy-scheduler (diff) | |
| download | yuzu-cdb9fe978ff29b1de2256f0d0cece550195f3fef.tar.gz yuzu-cdb9fe978ff29b1de2256f0d0cece550195f3fef.tar.xz yuzu-cdb9fe978ff29b1de2256f0d0cece550195f3fef.zip | |
vi: implement CloseDisplay
Diffstat (limited to 'src/core/hle/service/nvflinger')
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 13 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.h | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index dad93b38e..c3af12c90 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -138,6 +138,19 @@ std::optional<u64> NVFlinger::OpenDisplay(std::string_view name) { | |||
| 138 | return itr->GetID(); | 138 | return itr->GetID(); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | bool NVFlinger::CloseDisplay(u64 display_id) { | ||
| 142 | const auto lock_guard = Lock(); | ||
| 143 | auto* const display = FindDisplay(display_id); | ||
| 144 | |||
| 145 | if (display == nullptr) { | ||
| 146 | return false; | ||
| 147 | } | ||
| 148 | |||
| 149 | display->Reset(); | ||
| 150 | |||
| 151 | return true; | ||
| 152 | } | ||
| 153 | |||
| 141 | std::optional<u64> NVFlinger::CreateLayer(u64 display_id) { | 154 | std::optional<u64> NVFlinger::CreateLayer(u64 display_id) { |
| 142 | const auto lock_guard = Lock(); | 155 | const auto lock_guard = Lock(); |
| 143 | auto* const display = FindDisplay(display_id); | 156 | auto* const display = FindDisplay(display_id); |
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index b8191c595..460bef976 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h | |||
| @@ -58,6 +58,11 @@ public: | |||
| 58 | /// If an invalid display name is provided, then an empty optional is returned. | 58 | /// If an invalid display name is provided, then an empty optional is returned. |
| 59 | [[nodiscard]] std::optional<u64> OpenDisplay(std::string_view name); | 59 | [[nodiscard]] std::optional<u64> OpenDisplay(std::string_view name); |
| 60 | 60 | ||
| 61 | /// Closes the specified display by its ID. | ||
| 62 | /// | ||
| 63 | /// Returns false if an invalid display ID is provided. | ||
| 64 | [[nodiscard]] bool CloseDisplay(u64 display_id); | ||
| 65 | |||
| 61 | /// Creates a layer on the specified display and returns the layer ID. | 66 | /// Creates a layer on the specified display and returns the layer ID. |
| 62 | /// | 67 | /// |
| 63 | /// If an invalid display ID is specified, then an empty optional is returned. | 68 | /// If an invalid display ID is specified, then an empty optional is returned. |