summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2022-06-27 21:23:06 +0200
committerGravatar Fernando Sahmkow2022-10-06 21:00:53 +0200
commitc2b7de66b325b52cebb7e26948db0d5b0eefee25 (patch)
tree40518080032ab9155a351b55fdfb60020b10370b /src/core
parentNvflinger: correct duplication. (diff)
downloadyuzu-c2b7de66b325b52cebb7e26948db0d5b0eefee25.tar.gz
yuzu-c2b7de66b325b52cebb7e26948db0d5b0eefee25.tar.xz
yuzu-c2b7de66b325b52cebb7e26948db0d5b0eefee25.zip
Address Feedback from bylaws.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nvdrv/core/nvmap.cpp6
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp2
2 files changed, 2 insertions, 6 deletions
diff --git a/src/core/hle/service/nvdrv/core/nvmap.cpp b/src/core/hle/service/nvdrv/core/nvmap.cpp
index f811b66a0..9b21da6b1 100644
--- a/src/core/hle/service/nvdrv/core/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/core/nvmap.cpp
@@ -41,22 +41,18 @@ NvResult NvMap::Handle::Alloc(Flags pFlags, u32 pAlign, u8 pKind, u64 pAddress)
41 size = Common::AlignUp(size, YUZU_PAGESIZE); 41 size = Common::AlignUp(size, YUZU_PAGESIZE);
42 aligned_size = Common::AlignUp(size, align); 42 aligned_size = Common::AlignUp(size, align);
43 address = pAddress; 43 address = pAddress;
44
45 // TODO: pin init
46
47 allocated = true; 44 allocated = true;
48 45
49 return NvResult::Success; 46 return NvResult::Success;
50} 47}
51 48
52NvResult NvMap::Handle::Duplicate(bool internal_session) { 49NvResult NvMap::Handle::Duplicate(bool internal_session) {
50 std::scoped_lock lock(mutex);
53 // Unallocated handles cannot be duplicated as duplication requires memory accounting (in HOS) 51 // Unallocated handles cannot be duplicated as duplication requires memory accounting (in HOS)
54 if (!allocated) [[unlikely]] { 52 if (!allocated) [[unlikely]] {
55 return NvResult::BadValue; 53 return NvResult::BadValue;
56 } 54 }
57 55
58 std::scoped_lock lock(mutex);
59
60 // If we internally use FromId the duplication tracking of handles won't work accurately due to 56 // If we internally use FromId the duplication tracking of handles won't work accurately due to
61 // us not implementing per-process handle refs. 57 // us not implementing per-process handle refs.
62 if (internal_session) { 58 if (internal_session) {
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index 908e60191..32e45540d 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -270,12 +270,12 @@ NvResult nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, std::vector<u8>
270 } 270 }
271 } 271 }
272 272
273 gpu.PushGPUEntries(bind_id, std::move(entries));
274 params.fence.id = channel_syncpoint; 273 params.fence.id = channel_syncpoint;
275 274
276 u32 increment{(flags.fence_increment.Value() != 0 ? 2 : 0) + 275 u32 increment{(flags.fence_increment.Value() != 0 ? 2 : 0) +
277 (flags.increment_value.Value() != 0 ? params.fence.value : 0)}; 276 (flags.increment_value.Value() != 0 ? params.fence.value : 0)};
278 params.fence.value = syncpoint_manager.IncrementSyncpointMaxExt(channel_syncpoint, increment); 277 params.fence.value = syncpoint_manager.IncrementSyncpointMaxExt(channel_syncpoint, increment);
278 gpu.PushGPUEntries(bind_id, std::move(entries));
279 279
280 if (flags.fence_increment.Value()) { 280 if (flags.fence_increment.Value()) {
281 if (flags.suppress_wfi.Value()) { 281 if (flags.suppress_wfi.Value()) {