summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-02-14 04:42:52 +0100
committerbunnei <bunneidev@gmail.com>2018-02-14 05:54:12 +0100
commitf16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd (patch)
treef59c5cbe12d835e3a12180975f0a45fb94f28a27 /src
parentnvdrv: Use ReadBuffer/WriteBuffer functions for Ioctl. (diff)
downloadyuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar
yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar.gz
yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar.bz2
yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar.lz
yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar.xz
yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar.zst
yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/vi/vi.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 1f00a6cca..ff5005f71 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -685,18 +685,13 @@ void IApplicationDisplayService::OpenLayer(Kernel::HLERequestContext& ctx) {
u64 layer_id = rp.Pop<u64>();
u64 aruid = rp.Pop<u64>();
- auto& buffer = ctx.BufferDescriptorB()[0];
-
u64 display_id = nv_flinger->OpenDisplay(display_name);
u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id);
NativeWindow native_window{buffer_queue_id};
- auto data = native_window.Serialize();
- Memory::WriteBlock(buffer.Address(), data.data(), data.size());
-
IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
rb.Push(RESULT_SUCCESS);
- rb.Push<u64>(data.size());
+ rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize()));
}
void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx) {
@@ -707,21 +702,16 @@ void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx
rp.Pop<u32>(); // padding
u64 display_id = rp.Pop<u64>();
- auto& buffer = ctx.BufferDescriptorB()[0];
-
// TODO(Subv): What's the difference between a Stray and a Managed layer?
u64 layer_id = nv_flinger->CreateLayer(display_id);
u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id);
NativeWindow native_window{buffer_queue_id};
- auto data = native_window.Serialize();
- Memory::WriteBlock(buffer.Address(), data.data(), data.size());
-
IPC::ResponseBuilder rb = rp.MakeBuilder(6, 0, 0);
rb.Push(RESULT_SUCCESS);
rb.Push(layer_id);
- rb.Push<u64>(data.size());
+ rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize()));
}
void IApplicationDisplayService::DestroyStrayLayer(Kernel::HLERequestContext& ctx) {
@@ -747,8 +737,7 @@ void IApplicationDisplayService::SetLayerScalingMode(Kernel::HLERequestContext&
void IApplicationDisplayService::ListDisplays(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
DisplayInfo display_info;
- auto& buffer = ctx.BufferDescriptorB()[0];
- Memory::WriteBlock(buffer.Address(), &display_info, sizeof(DisplayInfo));
+ ctx.WriteBuffer(&display_info, sizeof(DisplayInfo));
IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
rb.Push(RESULT_SUCCESS);
rb.Push<u64>(1);