diff options
author | Liam <byteslice@airmail.cc> | 2024-02-14 22:29:24 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-18 00:01:41 +0100 |
commit | dcce9837d240fa2492f29e5ae2649085ae8f711c (patch) | |
tree | 8a93012b952276e29fa63490b4183a57cf346878 /src/core/hle/service/am | |
parent | nvnflinger: convert to process (diff) | |
download | yuzu-dcce9837d240fa2492f29e5ae2649085ae8f711c.tar yuzu-dcce9837d240fa2492f29e5ae2649085ae8f711c.tar.gz yuzu-dcce9837d240fa2492f29e5ae2649085ae8f711c.tar.bz2 yuzu-dcce9837d240fa2492f29e5ae2649085ae8f711c.tar.lz yuzu-dcce9837d240fa2492f29e5ae2649085ae8f711c.tar.xz yuzu-dcce9837d240fa2492f29e5ae2649085ae8f711c.tar.zst yuzu-dcce9837d240fa2492f29e5ae2649085ae8f711c.zip |
Diffstat (limited to 'src/core/hle/service/am')
-rw-r--r-- | src/core/hle/service/am/display_layer_manager.cpp | 18 | ||||
-rw-r--r-- | src/core/hle/service/am/display_layer_manager.h | 5 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/core/hle/service/am/display_layer_manager.cpp b/src/core/hle/service/am/display_layer_manager.cpp index 6cf3c369c..dc742c1f6 100644 --- a/src/core/hle/service/am/display_layer_manager.cpp +++ b/src/core/hle/service/am/display_layer_manager.cpp @@ -3,11 +3,13 @@ #include "core/core.h" #include "core/hle/service/am/display_layer_manager.h" -#include "core/hle/service/nvnflinger/fb_share_buffer_manager.h" #include "core/hle/service/nvnflinger/hos_binder_driver.h" -#include "core/hle/service/nvnflinger/nvnflinger.h" #include "core/hle/service/sm/sm.h" +#include "core/hle/service/vi/application_display_service.h" +#include "core/hle/service/vi/fbshare_buffer_manager.h" +#include "core/hle/service/vi/manager_root_service.h" #include "core/hle/service/vi/vi_results.h" +#include "core/hle/service/vi/vi_types.h" namespace Service::AM { @@ -18,10 +20,14 @@ DisplayLayerManager::~DisplayLayerManager() { void DisplayLayerManager::Initialize(Core::System& system, Kernel::KProcess* process, AppletId applet_id, LibraryAppletMode mode) { - m_process = process; m_surface_flinger = system.ServiceManager() .GetService<Nvnflinger::IHOSBinderDriver>("dispdrv", true) ->GetSurfaceFlinger(); + R_ASSERT(system.ServiceManager() + .GetService<VI::IManagerRootService>("vi:m", true) + ->GetDisplayService(&m_display_service, VI::Policy::Compositor)); + + m_process = process; m_system_shared_buffer_id = 0; m_system_shared_layer_id = 0; m_applet_id = applet_id; @@ -46,7 +52,7 @@ void DisplayLayerManager::Finalize() { // Clean up shared layers. if (m_buffer_sharing_enabled) { - m_surface_flinger->GetSystemBufferManager().Finalize(m_process); + m_display_service->GetSharedBufferManager()->Finalize(m_process); } m_surface_flinger = nullptr; @@ -103,7 +109,7 @@ Result DisplayLayerManager::IsSystemBufferSharingEnabled() { const auto blend = m_blending_enabled ? Nvnflinger::LayerBlending::Coverage : Nvnflinger::LayerBlending::None; const auto display_id = m_surface_flinger->OpenDisplay("Default").value(); - R_TRY(m_surface_flinger->GetSystemBufferManager().Initialize( + R_TRY(m_display_service->GetSharedBufferManager()->Initialize( m_process, &m_system_shared_buffer_id, &m_system_shared_layer_id, display_id, blend)); // We succeeded, so set up remaining state. @@ -147,7 +153,7 @@ bool DisplayLayerManager::GetWindowVisibility() const { Result DisplayLayerManager::WriteAppletCaptureBuffer(bool* out_was_written, s32* out_fbshare_layer_index) { R_UNLESS(m_buffer_sharing_enabled, VI::ResultPermissionDenied); - R_RETURN(m_surface_flinger->GetSystemBufferManager().WriteAppletCaptureBuffer( + R_RETURN(m_display_service->GetSharedBufferManager()->WriteAppletCaptureBuffer( out_was_written, out_fbshare_layer_index)); } diff --git a/src/core/hle/service/am/display_layer_manager.h b/src/core/hle/service/am/display_layer_manager.h index 92ab9399f..7591b0e60 100644 --- a/src/core/hle/service/am/display_layer_manager.h +++ b/src/core/hle/service/am/display_layer_manager.h @@ -21,6 +21,10 @@ namespace Service::Nvnflinger { class Nvnflinger; } +namespace Service::VI { +class IApplicationDisplayService; +} + namespace Service::AM { class DisplayLayerManager { @@ -47,6 +51,7 @@ public: private: Kernel::KProcess* m_process{}; std::shared_ptr<Nvnflinger::Nvnflinger> m_surface_flinger{}; + std::shared_ptr<VI::IApplicationDisplayService> m_display_service{}; std::set<u64> m_managed_display_layers{}; std::set<u64> m_managed_display_recording_layers{}; u64 m_system_shared_buffer_id{}; |