summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/core/nvmap.cpp
diff options
context:
space:
mode:
authorVonChenPlus <vonchenplus@gmail.com>2022-06-27 06:39:57 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-10-06 21:00:53 +0200
commit9982cff98b4db38565715cc515ea496b6195725b (patch)
tree08ac644dcb6d51b4deda281133fa31b40b7cc3d7 /src/core/hle/service/nvdrv/core/nvmap.cpp
parentGeneral: Fix clang format. (diff)
downloadyuzu-9982cff98b4db38565715cc515ea496b6195725b.tar
yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.gz
yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.bz2
yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.lz
yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.xz
yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.zst
yuzu-9982cff98b4db38565715cc515ea496b6195725b.zip
Diffstat (limited to 'src/core/hle/service/nvdrv/core/nvmap.cpp')
-rw-r--r--src/core/hle/service/nvdrv/core/nvmap.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/core/hle/service/nvdrv/core/nvmap.cpp b/src/core/hle/service/nvdrv/core/nvmap.cpp
index b02dbb9c9..dd30e156e 100644
--- a/src/core/hle/service/nvdrv/core/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/core/nvmap.cpp
@@ -207,6 +207,19 @@ void NvMap::UnpinHandle(Handle::Id handle) {
}
}
+void NvMap::DuplicateHandle(Handle::Id handle) {
+ auto handle_description{GetHandle(handle)};
+ if (!handle_description) {
+ LOG_CRITICAL(Service_NVDRV, "Unregistered handle!");
+ return;
+ }
+
+ auto result = handle_description->Duplicate(false);
+ if (result != NvResult::Success) {
+ LOG_CRITICAL(Service_NVDRV, "Could not duplicate handle!");
+ }
+}
+
std::optional<NvMap::FreeInfo> NvMap::FreeHandle(Handle::Id handle, bool internal_session) {
std::weak_ptr<Handle> hWeak{GetHandle(handle)};
FreeInfo freeInfo;
@@ -254,7 +267,7 @@ std::optional<NvMap::FreeInfo> NvMap::FreeHandle(Handle::Id handle, bool interna
// Handle hasn't been freed from memory, set address to 0 to mark that the handle wasn't freed
if (!hWeak.expired()) {
- LOG_ERROR(Service_NVDRV, "nvmap handle: {} wasn't freed as it is still in use", handle);
+ LOG_DEBUG(Service_NVDRV, "nvmap handle: {} wasn't freed as it is still in use", handle);
freeInfo.address = 0;
}