diff options
| author | 2024-02-14 11:39:42 -0500 | |
|---|---|---|
| committer | 2024-02-17 18:01:41 -0500 | |
| commit | ee8eccc5fa473f2ce210eb4e242e8eca40594db7 (patch) | |
| tree | 5c38fc738e52be88eddd7733e0fdeb248ef4783f /src/core/hle/service/nvdrv | |
| parent | am: unify display layer management (diff) | |
| download | yuzu-ee8eccc5fa473f2ce210eb4e242e8eca40594db7.tar.gz yuzu-ee8eccc5fa473f2ce210eb4e242e8eca40594db7.tar.xz yuzu-ee8eccc5fa473f2ce210eb4e242e8eca40594db7.zip | |
nvnflinger: convert to process
Diffstat (limited to 'src/core/hle/service/nvdrv')
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv_interface.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv_interface.h | 4 |
4 files changed, 10 insertions, 5 deletions
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index cb256e5b4..03eb507b9 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp | |||
| @@ -42,7 +42,7 @@ void EventInterface::FreeEvent(Kernel::KEvent* event) { | |||
| 42 | module.service_context.CloseEvent(event); | 42 | module.service_context.CloseEvent(event); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) { | 45 | void LoopProcess(Core::System& system) { |
| 46 | auto server_manager = std::make_unique<ServerManager>(system); | 46 | auto server_manager = std::make_unique<ServerManager>(system); |
| 47 | auto module = std::make_shared<Module>(system); | 47 | auto module = std::make_shared<Module>(system); |
| 48 | const auto NvdrvInterfaceFactoryForApplication = [&, module] { | 48 | const auto NvdrvInterfaceFactoryForApplication = [&, module] { |
| @@ -62,7 +62,6 @@ void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) { | |||
| 62 | server_manager->RegisterNamedService("nvdrv:s", NvdrvInterfaceFactoryForSysmodules); | 62 | server_manager->RegisterNamedService("nvdrv:s", NvdrvInterfaceFactoryForSysmodules); |
| 63 | server_manager->RegisterNamedService("nvdrv:t", NvdrvInterfaceFactoryForTesting); | 63 | server_manager->RegisterNamedService("nvdrv:t", NvdrvInterfaceFactoryForTesting); |
| 64 | server_manager->RegisterNamedService("nvmemp", std::make_shared<NVMEMP>(system)); | 64 | server_manager->RegisterNamedService("nvmemp", std::make_shared<NVMEMP>(system)); |
| 65 | nvnflinger.SetNVDrvInstance(module); | ||
| 66 | ServerManager::RunServer(std::move(server_manager)); | 65 | ServerManager::RunServer(std::move(server_manager)); |
| 67 | } | 66 | } |
| 68 | 67 | ||
diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index c594f0e5e..154c38951 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h | |||
| @@ -118,6 +118,6 @@ private: | |||
| 118 | std::unordered_map<std::string, std::function<FilesContainerType::iterator(DeviceFD)>> builders; | 118 | std::unordered_map<std::string, std::function<FilesContainerType::iterator(DeviceFD)>> builders; |
| 119 | }; | 119 | }; |
| 120 | 120 | ||
| 121 | void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system); | 121 | void LoopProcess(Core::System& system); |
| 122 | 122 | ||
| 123 | } // namespace Service::Nvidia | 123 | } // namespace Service::Nvidia |
diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp index ffe72f281..241006cc8 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp +++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp | |||
| @@ -263,8 +263,10 @@ NVDRV::NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* | |||
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | NVDRV::~NVDRV() { | 265 | NVDRV::~NVDRV() { |
| 266 | auto& container = nvdrv->GetContainer(); | 266 | if (is_initialized) { |
| 267 | container.CloseSession(session_id); | 267 | auto& container = nvdrv->GetContainer(); |
| 268 | container.CloseSession(session_id); | ||
| 269 | } | ||
| 268 | } | 270 | } |
| 269 | 271 | ||
| 270 | } // namespace Service::Nvidia | 272 | } // namespace Service::Nvidia |
diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.h b/src/core/hle/service/nvdrv/nvdrv_interface.h index f2195ae1e..c72f92597 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.h +++ b/src/core/hle/service/nvdrv/nvdrv_interface.h | |||
| @@ -16,6 +16,10 @@ public: | |||
| 16 | explicit NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* name); | 16 | explicit NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* name); |
| 17 | ~NVDRV() override; | 17 | ~NVDRV() override; |
| 18 | 18 | ||
| 19 | std::shared_ptr<Module> GetModule() const { | ||
| 20 | return nvdrv; | ||
| 21 | } | ||
| 22 | |||
| 19 | private: | 23 | private: |
| 20 | void Open(HLERequestContext& ctx); | 24 | void Open(HLERequestContext& ctx); |
| 21 | void Ioctl1(HLERequestContext& ctx); | 25 | void Ioctl1(HLERequestContext& ctx); |