summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/vi/vi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/vi/vi.cpp')
-rw-r--r--src/core/hle/service/vi/vi.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 1f3d82c57..d508ed28c 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -195,8 +195,9 @@ private:
void GetSharedBufferMemoryHandleId(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const u64 buffer_id = rp.PopRaw<u64>();
+ const u64 aruid = ctx.GetPID();
- LOG_INFO(Service_VI, "called. buffer_id={:#x}", buffer_id);
+ LOG_INFO(Service_VI, "called. buffer_id={:#x}, aruid={:#x}", buffer_id, aruid);
struct OutputParameters {
s32 nvmap_handle;
@@ -206,7 +207,7 @@ private:
OutputParameters out{};
Nvnflinger::SharedMemoryPoolLayout layout{};
const auto result = nvnflinger.GetSystemBufferManager().GetSharedBufferMemoryHandleId(
- &out.size, &out.nvmap_handle, &layout, buffer_id, 0);
+ &out.size, &out.nvmap_handle, &layout, buffer_id, aruid);
ctx.WriteBuffer(&layout, sizeof(layout));
@@ -535,6 +536,12 @@ public:
RegisterHandlers(functions);
}
+ ~IApplicationDisplayService() {
+ for (const auto layer_id : stray_layer_ids) {
+ nvnflinger.DestroyLayer(layer_id);
+ }
+ }
+
private:
enum class ConvertedScaleMode : u64 {
Freeze = 0,
@@ -770,6 +777,7 @@ private:
return;
}
+ stray_layer_ids.push_back(*layer_id);
const auto buffer_queue_id = nvnflinger.FindBufferQueueId(display_id, *layer_id);
if (!buffer_queue_id) {
LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", display_id);
@@ -916,6 +924,7 @@ private:
Nvnflinger::Nvnflinger& nvnflinger;
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server;
+ std::vector<u64> stray_layer_ids;
bool vsync_event_fetched{false};
};