diff options
| author | 2018-02-13 22:42:52 -0500 | |
|---|---|---|
| committer | 2018-02-13 23:54:12 -0500 | |
| commit | f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd (patch) | |
| tree | f59c5cbe12d835e3a12180975f0a45fb94f28a27 /src | |
| parent | nvdrv: Use ReadBuffer/WriteBuffer functions for Ioctl. (diff) | |
| download | yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar.gz yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.tar.xz yuzu-f16bb1dfcfa8f62818c1baba0e7ab9b8c65c30cd.zip | |
vi: Eliminate direct usage of BufferDescriptorB.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 17 |
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) { | |||
| 685 | u64 layer_id = rp.Pop<u64>(); | 685 | u64 layer_id = rp.Pop<u64>(); |
| 686 | u64 aruid = rp.Pop<u64>(); | 686 | u64 aruid = rp.Pop<u64>(); |
| 687 | 687 | ||
| 688 | auto& buffer = ctx.BufferDescriptorB()[0]; | ||
| 689 | |||
| 690 | u64 display_id = nv_flinger->OpenDisplay(display_name); | 688 | u64 display_id = nv_flinger->OpenDisplay(display_name); |
| 691 | u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); | 689 | u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); |
| 692 | 690 | ||
| 693 | NativeWindow native_window{buffer_queue_id}; | 691 | NativeWindow native_window{buffer_queue_id}; |
| 694 | auto data = native_window.Serialize(); | ||
| 695 | Memory::WriteBlock(buffer.Address(), data.data(), data.size()); | ||
| 696 | |||
| 697 | IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0); | 692 | IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0); |
| 698 | rb.Push(RESULT_SUCCESS); | 693 | rb.Push(RESULT_SUCCESS); |
| 699 | rb.Push<u64>(data.size()); | 694 | rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize())); |
| 700 | } | 695 | } |
| 701 | 696 | ||
| 702 | void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx) { | 697 | void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx) { |
| @@ -707,21 +702,16 @@ void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx | |||
| 707 | rp.Pop<u32>(); // padding | 702 | rp.Pop<u32>(); // padding |
| 708 | u64 display_id = rp.Pop<u64>(); | 703 | u64 display_id = rp.Pop<u64>(); |
| 709 | 704 | ||
| 710 | auto& buffer = ctx.BufferDescriptorB()[0]; | ||
| 711 | |||
| 712 | // TODO(Subv): What's the difference between a Stray and a Managed layer? | 705 | // TODO(Subv): What's the difference between a Stray and a Managed layer? |
| 713 | 706 | ||
| 714 | u64 layer_id = nv_flinger->CreateLayer(display_id); | 707 | u64 layer_id = nv_flinger->CreateLayer(display_id); |
| 715 | u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); | 708 | u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); |
| 716 | 709 | ||
| 717 | NativeWindow native_window{buffer_queue_id}; | 710 | NativeWindow native_window{buffer_queue_id}; |
| 718 | auto data = native_window.Serialize(); | ||
| 719 | Memory::WriteBlock(buffer.Address(), data.data(), data.size()); | ||
| 720 | |||
| 721 | IPC::ResponseBuilder rb = rp.MakeBuilder(6, 0, 0); | 711 | IPC::ResponseBuilder rb = rp.MakeBuilder(6, 0, 0); |
| 722 | rb.Push(RESULT_SUCCESS); | 712 | rb.Push(RESULT_SUCCESS); |
| 723 | rb.Push(layer_id); | 713 | rb.Push(layer_id); |
| 724 | rb.Push<u64>(data.size()); | 714 | rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize())); |
| 725 | } | 715 | } |
| 726 | 716 | ||
| 727 | void IApplicationDisplayService::DestroyStrayLayer(Kernel::HLERequestContext& ctx) { | 717 | void IApplicationDisplayService::DestroyStrayLayer(Kernel::HLERequestContext& ctx) { |
| @@ -747,8 +737,7 @@ void IApplicationDisplayService::SetLayerScalingMode(Kernel::HLERequestContext& | |||
| 747 | void IApplicationDisplayService::ListDisplays(Kernel::HLERequestContext& ctx) { | 737 | void IApplicationDisplayService::ListDisplays(Kernel::HLERequestContext& ctx) { |
| 748 | IPC::RequestParser rp{ctx}; | 738 | IPC::RequestParser rp{ctx}; |
| 749 | DisplayInfo display_info; | 739 | DisplayInfo display_info; |
| 750 | auto& buffer = ctx.BufferDescriptorB()[0]; | 740 | ctx.WriteBuffer(&display_info, sizeof(DisplayInfo)); |
| 751 | Memory::WriteBlock(buffer.Address(), &display_info, sizeof(DisplayInfo)); | ||
| 752 | IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0); | 741 | IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0); |
| 753 | rb.Push(RESULT_SUCCESS); | 742 | rb.Push(RESULT_SUCCESS); |
| 754 | rb.Push<u64>(1); | 743 | rb.Push<u64>(1); |