diff options
| author | bunnei <bunneidev@gmail.com> | 2018-01-22 17:52:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-22 17:52:47 -0500 |
| commit | d8bd70d396597d652e8eb891175192ffaf728593 (patch) | |
| tree | 01062c3da533e1b1469fed9781c38aecb91ce3ba /src/core/hle/service/am/applet_oe.cpp | |
| parent | de2e5a0855c11f8ef284708d2b55fa156594d1c4 (diff) | |
| parent | 10c67bf39504aae36b06d4abe8055aaf6feeb2ad (diff) | |
Merge pull request #133 from Subv/nvflinger2
AppletOE: Stubbed CreateManagedDisplayLayer to create a new layer in the default display.
Diffstat (limited to 'src/core/hle/service/am/applet_oe.cpp')
| -rw-r--r-- | src/core/hle/service/am/applet_oe.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index b4a6ad232..7d16b45f3 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"}, @@ -65,6 +67,7 @@ public: {14, &ISelfController::SetRestartMessageEnabled, "SetRestartMessageEnabled"}, {16, &ISelfController::SetOutOfFocusSuspendingEnabled, "SetOutOfFocusSuspendingEnabled"}, + {40, &ISelfController::CreateManagedDisplayLayer, "CreateManagedDisplayLayer"}, }; RegisterHandlers(functions); } @@ -144,6 +147,21 @@ private: LOG_WARNING(Service, "(STUBBED) called"); } + + void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) { + // TODO(Subv): Find out how AM determines the display to use, for now just create the layer + // in the Default display. + u64 display_id = nvflinger->OpenDisplay("Default"); + u64 layer_id = nvflinger->CreateLayer(display_id); + + IPC::RequestBuilder rb{ctx, 4}; + rb.Push(RESULT_SUCCESS); + rb.Push(layer_id); + + LOG_WARNING(Service, "(STUBBED) called"); + } + + std::shared_ptr<NVFlinger::NVFlinger> nvflinger; }; class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { @@ -367,7 +385,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 +432,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 +456,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"}, }; |
