diff options
author | Liam <byteslice@airmail.cc> | 2024-02-15 05:44:05 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-18 00:08:38 +0100 |
commit | 812f23d05c77fb10407546c3e7a95447fcbea395 (patch) | |
tree | bbfb035c35ccffb6dbe0995002c2937bd94edc2d /src/core/hle/service/vi/vi.cpp | |
parent | vi: move shared buffer management from nvnflinger (diff) | |
download | yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.gz yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.bz2 yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.lz yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.xz yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.zst yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/vi/vi.cpp | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index f361b9f4c..b388efaf6 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -2,38 +2,29 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/core.h" -#include "core/hle/service/nvdrv/nvdrv_interface.h" -#include "core/hle/service/nvnflinger/hos_binder_driver.h" #include "core/hle/service/server_manager.h" -#include "core/hle/service/sm/sm.h" -#include "core/hle/service/vi/application_display_service.h" #include "core/hle/service/vi/application_root_service.h" -#include "core/hle/service/vi/fbshare_buffer_manager.h" +#include "core/hle/service/vi/container.h" #include "core/hle/service/vi/manager_root_service.h" #include "core/hle/service/vi/system_root_service.h" #include "core/hle/service/vi/vi.h" namespace Service::VI { -void LoopProcess(Core::System& system) { - const auto binder_service = - system.ServiceManager().GetService<Nvnflinger::IHOSBinderDriver>("dispdrv", true); - const auto nvdrv = - system.ServiceManager().GetService<Nvidia::NVDRV>("nvdrv:s", true)->GetModule(); - const auto shared_buffer_manager = - std::make_shared<FbshareBufferManager>(system, binder_service->GetSurfaceFlinger(), nvdrv); +void LoopProcess(Core::System& system, std::stop_token token) { + const auto container = std::make_shared<Container>(system); auto server_manager = std::make_unique<ServerManager>(system); + server_manager->RegisterNamedService("vi:m", + std::make_shared<IManagerRootService>(system, container)); + server_manager->RegisterNamedService("vi:s", + std::make_shared<ISystemRootService>(system, container)); server_manager->RegisterNamedService( - "vi:m", - std::make_shared<IManagerRootService>(system, binder_service, shared_buffer_manager)); - server_manager->RegisterNamedService( - "vi:s", - std::make_shared<ISystemRootService>(system, binder_service, shared_buffer_manager)); - server_manager->RegisterNamedService( - "vi:u", - std::make_shared<IApplicationRootService>(system, binder_service, shared_buffer_manager)); + "vi:u", std::make_shared<IApplicationRootService>(system, container)); + + std::stop_callback cb(token, [=] { container->OnTerminate(); }); + ServerManager::RunServer(std::move(server_manager)); } |