summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/service/vi/vi.cpp242
-rw-r--r--src/core/hle/service/vi/vi.h34
-rw-r--r--src/core/hle/service/vi/vi_m.cpp15
-rw-r--r--src/core/hle/service/vi/vi_m.h17
-rw-r--r--src/core/hle/service/vi/vi_s.cpp15
-rw-r--r--src/core/hle/service/vi/vi_s.h17
-rw-r--r--src/core/hle/service/vi/vi_u.cpp15
-rw-r--r--src/core/hle/service/vi/vi_u.h17
8 files changed, 160 insertions, 212 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 6135eabf8..06c34e979 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -4,10 +4,13 @@
4 4
5#include <algorithm> 5#include <algorithm>
6#include <array> 6#include <array>
7#include <memory>
8#include <boost/optional.hpp>
7#include "common/alignment.h" 9#include "common/alignment.h"
8#include "common/scope_exit.h" 10#include "common/scope_exit.h"
9#include "core/core_timing.h" 11#include "core/core_timing.h"
10#include "core/hle/ipc_helpers.h" 12#include "core/hle/ipc_helpers.h"
13#include "core/hle/kernel/event.h"
11#include "core/hle/service/nvdrv/nvdrv.h" 14#include "core/hle/service/nvdrv/nvdrv.h"
12#include "core/hle/service/nvflinger/buffer_queue.h" 15#include "core/hle/service/nvflinger/buffer_queue.h"
13#include "core/hle/service/vi/vi.h" 16#include "core/hle/service/vi/vi.h"
@@ -646,144 +649,152 @@ private:
646 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger; 649 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
647}; 650};
648 651
649void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx) { 652class IApplicationDisplayService final : public ServiceFramework<IApplicationDisplayService> {
650 LOG_WARNING(Service_VI, "(STUBBED) called"); 653public:
654 IApplicationDisplayService(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger);
655 ~IApplicationDisplayService() = default;
651 656
652 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 657private:
653 rb.Push(RESULT_SUCCESS); 658 void GetRelayService(Kernel::HLERequestContext& ctx) {
654 rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger); 659 LOG_WARNING(Service_VI, "(STUBBED) called");
655}
656 660
657void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestContext& ctx) { 661 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
658 LOG_WARNING(Service_VI, "(STUBBED) called"); 662 rb.Push(RESULT_SUCCESS);
663 rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger);
664 }
659 665
660 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 666 void GetSystemDisplayService(Kernel::HLERequestContext& ctx) {
661 rb.Push(RESULT_SUCCESS); 667 LOG_WARNING(Service_VI, "(STUBBED) called");
662 rb.PushIpcInterface<ISystemDisplayService>();
663}
664 668
665void IApplicationDisplayService::GetManagerDisplayService(Kernel::HLERequestContext& ctx) { 669 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
666 LOG_WARNING(Service_VI, "(STUBBED) called"); 670 rb.Push(RESULT_SUCCESS);
671 rb.PushIpcInterface<ISystemDisplayService>();
672 }
667 673
668 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 674 void GetManagerDisplayService(Kernel::HLERequestContext& ctx) {
669 rb.Push(RESULT_SUCCESS); 675 LOG_WARNING(Service_VI, "(STUBBED) called");
670 rb.PushIpcInterface<IManagerDisplayService>(nv_flinger);
671}
672 676
673void IApplicationDisplayService::GetIndirectDisplayTransactionService( 677 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
674 Kernel::HLERequestContext& ctx) { 678 rb.Push(RESULT_SUCCESS);
675 LOG_WARNING(Service_VI, "(STUBBED) called"); 679 rb.PushIpcInterface<IManagerDisplayService>(nv_flinger);
680 }
676 681
677 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 682 void GetIndirectDisplayTransactionService(Kernel::HLERequestContext& ctx) {
678 rb.Push(RESULT_SUCCESS); 683 LOG_WARNING(Service_VI, "(STUBBED) called");
679 rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger);
680}
681 684
682void IApplicationDisplayService::OpenDisplay(Kernel::HLERequestContext& ctx) { 685 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
683 LOG_WARNING(Service_VI, "(STUBBED) called"); 686 rb.Push(RESULT_SUCCESS);
684 IPC::RequestParser rp{ctx}; 687 rb.PushIpcInterface<IHOSBinderDriver>(nv_flinger);
685 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); 688 }
686 auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
687 689
688 std::string name(name_buf.begin(), end); 690 void OpenDisplay(Kernel::HLERequestContext& ctx) {
691 LOG_WARNING(Service_VI, "(STUBBED) called");
692 IPC::RequestParser rp{ctx};
693 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
694 auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
689 695
690 ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet"); 696 std::string name(name_buf.begin(), end);
691 697
692 IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0); 698 ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet");
693 rb.Push(RESULT_SUCCESS);
694 rb.Push<u64>(nv_flinger->OpenDisplay(name));
695}
696 699
697void IApplicationDisplayService::CloseDisplay(Kernel::HLERequestContext& ctx) { 700 IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
698 LOG_WARNING(Service_VI, "(STUBBED) called"); 701 rb.Push(RESULT_SUCCESS);
699 IPC::RequestParser rp{ctx}; 702 rb.Push<u64>(nv_flinger->OpenDisplay(name));
700 u64 display_id = rp.Pop<u64>(); 703 }
701 704
702 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); 705 void CloseDisplay(Kernel::HLERequestContext& ctx) {
703 rb.Push(RESULT_SUCCESS); 706 LOG_WARNING(Service_VI, "(STUBBED) called");
704} 707 IPC::RequestParser rp{ctx};
708 u64 display_id = rp.Pop<u64>();
705 709
706void IApplicationDisplayService::OpenLayer(Kernel::HLERequestContext& ctx) { 710 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
707 LOG_DEBUG(Service_VI, "called"); 711 rb.Push(RESULT_SUCCESS);
708 IPC::RequestParser rp{ctx}; 712 }
709 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
710 auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
711 713
712 std::string display_name(name_buf.begin(), end); 714 void SetLayerScalingMode(Kernel::HLERequestContext& ctx) {
715 LOG_WARNING(Service_VI, "(STUBBED) called");
716 IPC::RequestParser rp{ctx};
717 u32 scaling_mode = rp.Pop<u32>();
718 u64 unknown = rp.Pop<u64>();
713 719
714 u64 layer_id = rp.Pop<u64>(); 720 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
715 u64 aruid = rp.Pop<u64>(); 721 rb.Push(RESULT_SUCCESS);
722 }
716 723
717 u64 display_id = nv_flinger->OpenDisplay(display_name); 724 void ListDisplays(Kernel::HLERequestContext& ctx) {
718 u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); 725 IPC::RequestParser rp{ctx};
726 DisplayInfo display_info;
727 ctx.WriteBuffer(&display_info, sizeof(DisplayInfo));
728 IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
729 rb.Push(RESULT_SUCCESS);
730 rb.Push<u64>(1);
731 LOG_WARNING(Service_VI, "(STUBBED) called");
732 }
719 733
720 NativeWindow native_window{buffer_queue_id}; 734 void OpenLayer(Kernel::HLERequestContext& ctx) {
721 IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0); 735 LOG_DEBUG(Service_VI, "called");
722 rb.Push(RESULT_SUCCESS); 736 IPC::RequestParser rp{ctx};
723 rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize())); 737 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
724} 738 auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
725 739
726void IApplicationDisplayService::CreateStrayLayer(Kernel::HLERequestContext& ctx) { 740 std::string display_name(name_buf.begin(), end);
727 LOG_DEBUG(Service_VI, "called");
728 741
729 IPC::RequestParser rp{ctx}; 742 u64 layer_id = rp.Pop<u64>();
730 u32 flags = rp.Pop<u32>(); 743 u64 aruid = rp.Pop<u64>();
731 rp.Pop<u32>(); // padding
732 u64 display_id = rp.Pop<u64>();
733 744
734 // TODO(Subv): What's the difference between a Stray and a Managed layer? 745 u64 display_id = nv_flinger->OpenDisplay(display_name);
746 u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id);
735 747
736 u64 layer_id = nv_flinger->CreateLayer(display_id); 748 NativeWindow native_window{buffer_queue_id};
737 u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); 749 IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
750 rb.Push(RESULT_SUCCESS);
751 rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize()));
752 }
738 753
739 NativeWindow native_window{buffer_queue_id}; 754 void CreateStrayLayer(Kernel::HLERequestContext& ctx) {
740 IPC::ResponseBuilder rb = rp.MakeBuilder(6, 0, 0); 755 LOG_DEBUG(Service_VI, "called");
741 rb.Push(RESULT_SUCCESS);
742 rb.Push(layer_id);
743 rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize()));
744}
745 756
746void IApplicationDisplayService::DestroyStrayLayer(Kernel::HLERequestContext& ctx) { 757 IPC::RequestParser rp{ctx};
747 LOG_WARNING(Service_VI, "(STUBBED) called"); 758 u32 flags = rp.Pop<u32>();
759 rp.Pop<u32>(); // padding
760 u64 display_id = rp.Pop<u64>();
748 761
749 IPC::RequestParser rp{ctx}; 762 // TODO(Subv): What's the difference between a Stray and a Managed layer?
750 u64 layer_id = rp.Pop<u64>();
751 763
752 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); 764 u64 layer_id = nv_flinger->CreateLayer(display_id);
753 rb.Push(RESULT_SUCCESS); 765 u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id);
754}
755 766
756void IApplicationDisplayService::SetLayerScalingMode(Kernel::HLERequestContext& ctx) { 767 NativeWindow native_window{buffer_queue_id};
757 LOG_WARNING(Service_VI, "(STUBBED) called"); 768 IPC::ResponseBuilder rb = rp.MakeBuilder(6, 0, 0);
758 IPC::RequestParser rp{ctx}; 769 rb.Push(RESULT_SUCCESS);
759 u32 scaling_mode = rp.Pop<u32>(); 770 rb.Push(layer_id);
760 u64 unknown = rp.Pop<u64>(); 771 rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize()));
772 }
761 773
762 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); 774 void DestroyStrayLayer(Kernel::HLERequestContext& ctx) {
763 rb.Push(RESULT_SUCCESS); 775 LOG_WARNING(Service_VI, "(STUBBED) called");
764}
765 776
766void IApplicationDisplayService::ListDisplays(Kernel::HLERequestContext& ctx) { 777 IPC::RequestParser rp{ctx};
767 IPC::RequestParser rp{ctx}; 778 u64 layer_id = rp.Pop<u64>();
768 DisplayInfo display_info;
769 ctx.WriteBuffer(&display_info, sizeof(DisplayInfo));
770 IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
771 rb.Push(RESULT_SUCCESS);
772 rb.Push<u64>(1);
773 LOG_WARNING(Service_VI, "(STUBBED) called");
774}
775 779
776void IApplicationDisplayService::GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) { 780 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
777 LOG_WARNING(Service_VI, "(STUBBED) called"); 781 rb.Push(RESULT_SUCCESS);
778 IPC::RequestParser rp{ctx}; 782 }
779 u64 display_id = rp.Pop<u64>();
780 783
781 auto vsync_event = nv_flinger->GetVsyncEvent(display_id); 784 void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) {
785 LOG_WARNING(Service_VI, "(STUBBED) called");
786 IPC::RequestParser rp{ctx};
787 u64 display_id = rp.Pop<u64>();
782 788
783 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 1, 0); 789 auto vsync_event = nv_flinger->GetVsyncEvent(display_id);
784 rb.Push(RESULT_SUCCESS); 790
785 rb.PushCopyObjects(vsync_event); 791 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 1, 0);
786} 792 rb.Push(RESULT_SUCCESS);
793 rb.PushCopyObjects(vsync_event);
794 }
795
796 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
797};
787 798
788IApplicationDisplayService::IApplicationDisplayService( 799IApplicationDisplayService::IApplicationDisplayService(
789 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger) 800 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
@@ -806,11 +817,24 @@ IApplicationDisplayService::IApplicationDisplayService(
806 RegisterHandlers(functions); 817 RegisterHandlers(functions);
807} 818}
808 819
820Module::Interface::Interface(std::shared_ptr<Module> module, const char* name,
821 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
822 : ServiceFramework(name), module(std::move(module)), nv_flinger(std::move(nv_flinger)) {}
823
824void Module::Interface::GetDisplayService(Kernel::HLERequestContext& ctx) {
825 LOG_WARNING(Service_VI, "(STUBBED) called");
826
827 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
828 rb.Push(RESULT_SUCCESS);
829 rb.PushIpcInterface<IApplicationDisplayService>(nv_flinger);
830}
831
809void InstallInterfaces(SM::ServiceManager& service_manager, 832void InstallInterfaces(SM::ServiceManager& service_manager,
810 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger) { 833 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger) {
811 std::make_shared<VI_M>(nv_flinger)->InstallAsService(service_manager); 834 auto module = std::make_shared<Module>();
812 std::make_shared<VI_S>(nv_flinger)->InstallAsService(service_manager); 835 std::make_shared<VI_M>(module, nv_flinger)->InstallAsService(service_manager);
813 std::make_shared<VI_U>(nv_flinger)->InstallAsService(service_manager); 836 std::make_shared<VI_S>(module, nv_flinger)->InstallAsService(service_manager);
837 std::make_shared<VI_U>(module, nv_flinger)->InstallAsService(service_manager);
814} 838}
815 839
816} // namespace VI 840} // namespace VI
diff --git a/src/core/hle/service/vi/vi.h b/src/core/hle/service/vi/vi.h
index f6be7d1e6..985c9d27c 100644
--- a/src/core/hle/service/vi/vi.h
+++ b/src/core/hle/service/vi/vi.h
@@ -4,9 +4,6 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <memory>
8#include <boost/optional.hpp>
9#include "core/hle/kernel/event.h"
10#include "core/hle/service/nvflinger/nvflinger.h" 7#include "core/hle/service/nvflinger/nvflinger.h"
11#include "core/hle/service/service.h" 8#include "core/hle/service/service.h"
12 9
@@ -17,26 +14,19 @@ struct EventType;
17namespace Service { 14namespace Service {
18namespace VI { 15namespace VI {
19 16
20class IApplicationDisplayService final : public ServiceFramework<IApplicationDisplayService> { 17class Module final {
21public: 18public:
22 IApplicationDisplayService(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger); 19 class Interface : public ServiceFramework<Interface> {
23 ~IApplicationDisplayService() = default; 20 public:
24 21 Interface(std::shared_ptr<Module> module, const char* name,
25private: 22 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger);
26 void GetRelayService(Kernel::HLERequestContext& ctx); 23
27 void GetSystemDisplayService(Kernel::HLERequestContext& ctx); 24 void GetDisplayService(Kernel::HLERequestContext& ctx);
28 void GetManagerDisplayService(Kernel::HLERequestContext& ctx); 25
29 void GetIndirectDisplayTransactionService(Kernel::HLERequestContext& ctx); 26 protected:
30 void OpenDisplay(Kernel::HLERequestContext& ctx); 27 std::shared_ptr<Module> module;
31 void CloseDisplay(Kernel::HLERequestContext& ctx); 28 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
32 void SetLayerScalingMode(Kernel::HLERequestContext& ctx); 29 };
33 void ListDisplays(Kernel::HLERequestContext& ctx);
34 void OpenLayer(Kernel::HLERequestContext& ctx);
35 void CreateStrayLayer(Kernel::HLERequestContext& ctx);
36 void DestroyStrayLayer(Kernel::HLERequestContext& ctx);
37 void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx);
38
39 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
40}; 30};
41 31
42/// Registers all VI services with the specified service manager. 32/// Registers all VI services with the specified service manager.
diff --git a/src/core/hle/service/vi/vi_m.cpp b/src/core/hle/service/vi/vi_m.cpp
index 5d99647dc..5781fa9ec 100644
--- a/src/core/hle/service/vi/vi_m.cpp
+++ b/src/core/hle/service/vi/vi_m.cpp
@@ -2,24 +2,13 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/vi/vi.h"
8#include "core/hle/service/vi/vi_m.h" 5#include "core/hle/service/vi/vi_m.h"
9 6
10namespace Service { 7namespace Service {
11namespace VI { 8namespace VI {
12 9
13void VI_M::GetDisplayService(Kernel::HLERequestContext& ctx) { 10VI_M::VI_M(std::shared_ptr<Module> module, std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
14 LOG_WARNING(Service_VI, "(STUBBED) called"); 11 : Module::Interface(std::move(module), "vi:m", std::move(nv_flinger)) {
15
16 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
17 rb.Push(RESULT_SUCCESS);
18 rb.PushIpcInterface<IApplicationDisplayService>(nv_flinger);
19}
20
21VI_M::VI_M(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
22 : ServiceFramework("vi:m"), nv_flinger(std::move(nv_flinger)) {
23 static const FunctionInfo functions[] = { 12 static const FunctionInfo functions[] = {
24 {2, &VI_M::GetDisplayService, "GetDisplayService"}, 13 {2, &VI_M::GetDisplayService, "GetDisplayService"},
25 {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, 14 {3, nullptr, "GetDisplayServiceWithProxyNameExchange"},
diff --git a/src/core/hle/service/vi/vi_m.h b/src/core/hle/service/vi/vi_m.h
index e5319b1e7..0f7b799d6 100644
--- a/src/core/hle/service/vi/vi_m.h
+++ b/src/core/hle/service/vi/vi_m.h
@@ -4,25 +4,14 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <memory> 7#include "core/hle/service/vi/vi.h"
8#include "core/hle/service/service.h"
9 8
10namespace Service { 9namespace Service {
11namespace NVFlinger {
12class NVFlinger;
13}
14
15namespace VI { 10namespace VI {
16 11
17class VI_M final : public ServiceFramework<VI_M> { 12class VI_M final : public Module::Interface {
18public: 13public:
19 VI_M(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger); 14 explicit VI_M(std::shared_ptr<Module> module, std::shared_ptr<NVFlinger::NVFlinger> nv_flinger);
20 ~VI_M() = default;
21
22private:
23 void GetDisplayService(Kernel::HLERequestContext& ctx);
24
25 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
26}; 15};
27 16
28} // namespace VI 17} // namespace VI
diff --git a/src/core/hle/service/vi/vi_s.cpp b/src/core/hle/service/vi/vi_s.cpp
index 411757981..1f937b2a8 100644
--- a/src/core/hle/service/vi/vi_s.cpp
+++ b/src/core/hle/service/vi/vi_s.cpp
@@ -2,24 +2,13 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/vi/vi.h"
8#include "core/hle/service/vi/vi_s.h" 5#include "core/hle/service/vi/vi_s.h"
9 6
10namespace Service { 7namespace Service {
11namespace VI { 8namespace VI {
12 9
13void VI_S::GetDisplayService(Kernel::HLERequestContext& ctx) { 10VI_S::VI_S(std::shared_ptr<Module> module, std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
14 LOG_WARNING(Service_VI, "(STUBBED) called"); 11 : Module::Interface(std::move(module), "vi:s", std::move(nv_flinger)) {
15
16 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
17 rb.Push(RESULT_SUCCESS);
18 rb.PushIpcInterface<IApplicationDisplayService>(nv_flinger);
19}
20
21VI_S::VI_S(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
22 : ServiceFramework("vi:s"), nv_flinger(std::move(nv_flinger)) {
23 static const FunctionInfo functions[] = { 12 static const FunctionInfo functions[] = {
24 {1, &VI_S::GetDisplayService, "GetDisplayService"}, 13 {1, &VI_S::GetDisplayService, "GetDisplayService"},
25 {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, 14 {3, nullptr, "GetDisplayServiceWithProxyNameExchange"},
diff --git a/src/core/hle/service/vi/vi_s.h b/src/core/hle/service/vi/vi_s.h
index 6978fd700..7b32fdddc 100644
--- a/src/core/hle/service/vi/vi_s.h
+++ b/src/core/hle/service/vi/vi_s.h
@@ -4,25 +4,14 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <memory> 7#include "core/hle/service/vi/vi.h"
8#include "core/hle/service/service.h"
9 8
10namespace Service { 9namespace Service {
11namespace NVFlinger {
12class NVFlinger;
13}
14
15namespace VI { 10namespace VI {
16 11
17class VI_S final : public ServiceFramework<VI_S> { 12class VI_S final : public Module::Interface {
18public: 13public:
19 VI_S(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger); 14 explicit VI_S(std::shared_ptr<Module> module, std::shared_ptr<NVFlinger::NVFlinger> nv_flinger);
20 ~VI_S() = default;
21
22private:
23 void GetDisplayService(Kernel::HLERequestContext& ctx);
24
25 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
26}; 15};
27 16
28} // namespace VI 17} // namespace VI
diff --git a/src/core/hle/service/vi/vi_u.cpp b/src/core/hle/service/vi/vi_u.cpp
index f5568383b..14e375b86 100644
--- a/src/core/hle/service/vi/vi_u.cpp
+++ b/src/core/hle/service/vi/vi_u.cpp
@@ -2,24 +2,13 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/vi/vi.h"
8#include "core/hle/service/vi/vi_u.h" 5#include "core/hle/service/vi/vi_u.h"
9 6
10namespace Service { 7namespace Service {
11namespace VI { 8namespace VI {
12 9
13void VI_U::GetDisplayService(Kernel::HLERequestContext& ctx) { 10VI_U::VI_U(std::shared_ptr<Module> module, std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
14 LOG_WARNING(Service_VI, "(STUBBED) called"); 11 : Module::Interface(std::move(module), "vi:u", std::move(nv_flinger)) {
15
16 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
17 rb.Push(RESULT_SUCCESS);
18 rb.PushIpcInterface<IApplicationDisplayService>(nv_flinger);
19}
20
21VI_U::VI_U(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger)
22 : ServiceFramework("vi:u"), nv_flinger(std::move(nv_flinger)) {
23 static const FunctionInfo functions[] = { 12 static const FunctionInfo functions[] = {
24 {0, &VI_U::GetDisplayService, "GetDisplayService"}, 13 {0, &VI_U::GetDisplayService, "GetDisplayService"},
25 {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, 14 {3, nullptr, "GetDisplayServiceWithProxyNameExchange"},
diff --git a/src/core/hle/service/vi/vi_u.h b/src/core/hle/service/vi/vi_u.h
index b3e9c094d..c557a2235 100644
--- a/src/core/hle/service/vi/vi_u.h
+++ b/src/core/hle/service/vi/vi_u.h
@@ -4,25 +4,14 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <memory> 7#include "core/hle/service/vi/vi.h"
8#include "core/hle/service/service.h"
9 8
10namespace Service { 9namespace Service {
11namespace NVFlinger {
12class NVFlinger;
13}
14
15namespace VI { 10namespace VI {
16 11
17class VI_U final : public ServiceFramework<VI_U> { 12class VI_U final : public Module::Interface {
18public: 13public:
19 VI_U(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger); 14 explicit VI_U(std::shared_ptr<Module> module, std::shared_ptr<NVFlinger::NVFlinger> nv_flinger);
20 ~VI_U() = default;
21
22private:
23 void GetDisplayService(Kernel::HLERequestContext& ctx);
24
25 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
26}; 15};
27 16
28} // namespace VI 17} // namespace VI