summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-01-22 19:46:36 +0100
committerSubv <subv2112@gmail.com>2018-01-22 19:46:36 +0100
commiteb58f852f8cd961853120e756e5cd91ad8c33bfd (patch)
treee12f715efbd837c8753f79555c551748c45e2ede
parentServices: Vi shouldn't be responsible for creating nvflinger. (diff)
downloadyuzu-eb58f852f8cd961853120e756e5cd91ad8c33bfd.tar
yuzu-eb58f852f8cd961853120e756e5cd91ad8c33bfd.tar.gz
yuzu-eb58f852f8cd961853120e756e5cd91ad8c33bfd.tar.bz2
yuzu-eb58f852f8cd961853120e756e5cd91ad8c33bfd.tar.lz
yuzu-eb58f852f8cd961853120e756e5cd91ad8c33bfd.tar.xz
yuzu-eb58f852f8cd961853120e756e5cd91ad8c33bfd.tar.zst
yuzu-eb58f852f8cd961853120e756e5cd91ad8c33bfd.zip
-rw-r--r--src/core/hle/service/am/am.cpp5
-rw-r--r--src/core/hle/service/am/am.h8
-rw-r--r--src/core/hle/service/am/applet_oe.cpp18
-rw-r--r--src/core/hle/service/am/applet_oe.h9
-rw-r--r--src/core/hle/service/service.cpp2
5 files changed, 32 insertions, 10 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index a761bea65..b6896852e 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -8,8 +8,9 @@
namespace Service {
namespace AM {
-void InstallInterfaces(SM::ServiceManager& service_manager) {
- std::make_shared<AppletOE>()->InstallAsService(service_manager);
+void InstallInterfaces(SM::ServiceManager& service_manager,
+ std::shared_ptr<NVFlinger::NVFlinger> nvflinger) {
+ std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager);
}
} // namespace AM
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 63d86cd41..3b8a06c1d 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -4,13 +4,19 @@
#pragma once
+#include <memory>
#include "core/hle/service/service.h"
namespace Service {
+namespace NVFlinger {
+class NVFlinger;
+}
+
namespace AM {
/// Registers all AM services with the specified service manager.
-void InstallInterfaces(SM::ServiceManager& service_manager);
+void InstallInterfaces(SM::ServiceManager& service_manager,
+ std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
} // namespace AM
} // namespace Service
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index b4a6ad232..f593840b3 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -7,6 +7,7 @@
#include "core/hle/kernel/event.h"
#include "core/hle/service/am/applet_oe.h"
#include "core/hle/service/apm/apm.h"
+#include "core/hle/service/nvflinger/nvflinger.h"
namespace Service {
namespace AM {
@@ -53,7 +54,8 @@ public:
class ISelfController final : public ServiceFramework<ISelfController> {
public:
- ISelfController() : ServiceFramework("ISelfController") {
+ ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
+ : ServiceFramework("ISelfController"), nvflinger(std::move(nvflinger)) {
static const FunctionInfo functions[] = {
{1, &ISelfController::LockExit, "LockExit"},
{2, &ISelfController::UnlockExit, "UnlockExit"},
@@ -144,6 +146,8 @@ private:
LOG_WARNING(Service, "(STUBBED) called");
}
+
+ std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
};
class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
@@ -367,7 +371,8 @@ public:
class IApplicationProxy final : public ServiceFramework<IApplicationProxy> {
public:
- IApplicationProxy() : ServiceFramework("IApplicationProxy") {
+ IApplicationProxy(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
+ : ServiceFramework("IApplicationProxy"), nvflinger(std::move(nvflinger)) {
static const FunctionInfo functions[] = {
{0, &IApplicationProxy::GetCommonStateGetter, "GetCommonStateGetter"},
{1, &IApplicationProxy::GetSelfController, "GetSelfController"},
@@ -413,7 +418,7 @@ private:
void GetSelfController(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<ISelfController>();
+ rb.PushIpcInterface<ISelfController>(nvflinger);
LOG_DEBUG(Service, "called");
}
@@ -437,16 +442,19 @@ private:
rb.PushIpcInterface<IApplicationFunctions>();
LOG_DEBUG(Service, "called");
}
+
+ std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
};
void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb{ctx, 2, 0, 0, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IApplicationProxy>();
+ rb.PushIpcInterface<IApplicationProxy>(nvflinger);
LOG_DEBUG(Service, "called");
}
-AppletOE::AppletOE() : ServiceFramework("appletOE") {
+AppletOE::AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
+ : ServiceFramework("appletOE"), nvflinger(std::move(nvflinger)) {
static const FunctionInfo functions[] = {
{0x00000000, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"},
};
diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h
index 6ee5b0e9f..8083135c3 100644
--- a/src/core/hle/service/am/applet_oe.h
+++ b/src/core/hle/service/am/applet_oe.h
@@ -4,10 +4,15 @@
#pragma once
+#include <memory>
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/service.h"
namespace Service {
+namespace NVFlinger {
+class NVFlinger;
+}
+
namespace AM {
// TODO: Add more languages
@@ -18,11 +23,13 @@ enum SystemLanguage {
class AppletOE final : public ServiceFramework<AppletOE> {
public:
- AppletOE();
+ AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
~AppletOE() = default;
private:
void OpenApplicationProxy(Kernel::HLERequestContext& ctx);
+
+ std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
};
} // namespace AM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 403cce8e5..1b8565351 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -173,7 +173,7 @@ void Init() {
SM::ServiceManager::InstallInterfaces(SM::g_service_manager);
Account::InstallInterfaces(*SM::g_service_manager);
- AM::InstallInterfaces(*SM::g_service_manager);
+ AM::InstallInterfaces(*SM::g_service_manager, nv_flinger);
AOC::InstallInterfaces(*SM::g_service_manager);
APM::InstallInterfaces(*SM::g_service_manager);
Audio::InstallInterfaces(*SM::g_service_manager);