summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/am/am.cpp26
-rw-r--r--src/core/hle/service/am/am.h5
-rw-r--r--src/core/hle/service/am/applet_ae.cpp4
-rw-r--r--src/core/hle/service/am/applet_oe.cpp2
-rw-r--r--src/core/hle/service/service.cpp2
5 files changed, 26 insertions, 13 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 33cebb48b..4b5baf283 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -29,7 +29,8 @@
29#include "core/hle/service/am/omm.h" 29#include "core/hle/service/am/omm.h"
30#include "core/hle/service/am/spsm.h" 30#include "core/hle/service/am/spsm.h"
31#include "core/hle/service/am/tcap.h" 31#include "core/hle/service/am/tcap.h"
32#include "core/hle/service/apm/apm.h" 32#include "core/hle/service/apm/controller.h"
33#include "core/hle/service/apm/interface.h"
33#include "core/hle/service/filesystem/filesystem.h" 34#include "core/hle/service/filesystem/filesystem.h"
34#include "core/hle/service/ns/ns.h" 35#include "core/hle/service/ns/ns.h"
35#include "core/hle/service/nvflinger/nvflinger.h" 36#include "core/hle/service/nvflinger/nvflinger.h"
@@ -508,8 +509,9 @@ void AppletMessageQueue::OperationModeChanged() {
508 on_operation_mode_changed.writable->Signal(); 509 on_operation_mode_changed.writable->Signal();
509} 510}
510 511
511ICommonStateGetter::ICommonStateGetter(std::shared_ptr<AppletMessageQueue> msg_queue) 512ICommonStateGetter::ICommonStateGetter(Core::System& system,
512 : ServiceFramework("ICommonStateGetter"), msg_queue(std::move(msg_queue)) { 513 std::shared_ptr<AppletMessageQueue> msg_queue)
514 : ServiceFramework("ICommonStateGetter"), system(system), msg_queue(std::move(msg_queue)) {
513 // clang-format off 515 // clang-format off
514 static const FunctionInfo functions[] = { 516 static const FunctionInfo functions[] = {
515 {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"}, 517 {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"},
@@ -542,7 +544,7 @@ ICommonStateGetter::ICommonStateGetter(std::shared_ptr<AppletMessageQueue> msg_q
542 {63, nullptr, "GetHdcpAuthenticationStateChangeEvent"}, 544 {63, nullptr, "GetHdcpAuthenticationStateChangeEvent"},
543 {64, nullptr, "SetTvPowerStateMatchingMode"}, 545 {64, nullptr, "SetTvPowerStateMatchingMode"},
544 {65, nullptr, "GetApplicationIdByContentActionName"}, 546 {65, nullptr, "GetApplicationIdByContentActionName"},
545 {66, nullptr, "SetCpuBoostMode"}, 547 {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
546 {80, nullptr, "PerformSystemButtonPressingIfInFocus"}, 548 {80, nullptr, "PerformSystemButtonPressingIfInFocus"},
547 {90, nullptr, "SetPerformanceConfigurationChangedNotification"}, 549 {90, nullptr, "SetPerformanceConfigurationChangedNotification"},
548 {91, nullptr, "GetCurrentPerformanceConfiguration"}, 550 {91, nullptr, "GetCurrentPerformanceConfiguration"},
@@ -623,6 +625,16 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext&
623 } 625 }
624} 626}
625 627
628void ICommonStateGetter::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
629 LOG_DEBUG(Service_AM, "called, forwarding to APM:SYS");
630
631 const auto& sm = system.ServiceManager();
632 const auto apm_sys = sm.GetService<APM::APM_Sys>("apm:sys");
633 ASSERT(apm_sys != nullptr);
634
635 apm_sys->SetCpuBoostMode(ctx);
636}
637
626IStorage::IStorage(std::vector<u8> buffer) 638IStorage::IStorage(std::vector<u8> buffer)
627 : ServiceFramework("IStorage"), buffer(std::move(buffer)) { 639 : ServiceFramework("IStorage"), buffer(std::move(buffer)) {
628 // clang-format off 640 // clang-format off
@@ -651,13 +663,11 @@ void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
651} 663}
652 664
653void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) { 665void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
654 const bool use_docked_mode{Settings::values.use_docked_mode}; 666 LOG_DEBUG(Service_AM, "called");
655 LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);
656 667
657 IPC::ResponseBuilder rb{ctx, 3}; 668 IPC::ResponseBuilder rb{ctx, 3};
658 rb.Push(RESULT_SUCCESS); 669 rb.Push(RESULT_SUCCESS);
659 rb.Push(static_cast<u32>(use_docked_mode ? APM::PerformanceMode::Docked 670 rb.PushEnum(system.GetAPMController().GetCurrentPerformanceMode());
660 : APM::PerformanceMode::Handheld));
661} 671}
662 672
663class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> { 673class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 4ea609d23..88d1ba27c 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -145,7 +145,8 @@ private:
145 145
146class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { 146class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
147public: 147public:
148 explicit ICommonStateGetter(std::shared_ptr<AppletMessageQueue> msg_queue); 148 explicit ICommonStateGetter(Core::System& system,
149 std::shared_ptr<AppletMessageQueue> msg_queue);
149 ~ICommonStateGetter() override; 150 ~ICommonStateGetter() override;
150 151
151private: 152private:
@@ -167,7 +168,9 @@ private:
167 void GetPerformanceMode(Kernel::HLERequestContext& ctx); 168 void GetPerformanceMode(Kernel::HLERequestContext& ctx);
168 void GetBootMode(Kernel::HLERequestContext& ctx); 169 void GetBootMode(Kernel::HLERequestContext& ctx);
169 void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); 170 void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx);
171 void SetCpuBoostMode(Kernel::HLERequestContext& ctx);
170 172
173 Core::System& system;
171 std::shared_ptr<AppletMessageQueue> msg_queue; 174 std::shared_ptr<AppletMessageQueue> msg_queue;
172}; 175};
173 176
diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cpp
index fe5beb8f9..a34368c8b 100644
--- a/src/core/hle/service/am/applet_ae.cpp
+++ b/src/core/hle/service/am/applet_ae.cpp
@@ -42,7 +42,7 @@ private:
42 42
43 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 43 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
44 rb.Push(RESULT_SUCCESS); 44 rb.Push(RESULT_SUCCESS);
45 rb.PushIpcInterface<ICommonStateGetter>(msg_queue); 45 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
46 } 46 }
47 47
48 void GetSelfController(Kernel::HLERequestContext& ctx) { 48 void GetSelfController(Kernel::HLERequestContext& ctx) {
@@ -146,7 +146,7 @@ private:
146 146
147 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 147 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
148 rb.Push(RESULT_SUCCESS); 148 rb.Push(RESULT_SUCCESS);
149 rb.PushIpcInterface<ICommonStateGetter>(msg_queue); 149 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
150 } 150 }
151 151
152 void GetSelfController(Kernel::HLERequestContext& ctx) { 152 void GetSelfController(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index 6e255fe95..5d53ef113 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -80,7 +80,7 @@ private:
80 80
81 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 81 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
82 rb.Push(RESULT_SUCCESS); 82 rb.Push(RESULT_SUCCESS);
83 rb.PushIpcInterface<ICommonStateGetter>(msg_queue); 83 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
84 } 84 }
85 85
86 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { 86 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index ec9d755b7..e441b3730 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -206,7 +206,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system,
206 Account::InstallInterfaces(system); 206 Account::InstallInterfaces(system);
207 AM::InstallInterfaces(*sm, nv_flinger, system); 207 AM::InstallInterfaces(*sm, nv_flinger, system);
208 AOC::InstallInterfaces(*sm); 208 AOC::InstallInterfaces(*sm);
209 APM::InstallInterfaces(*sm); 209 APM::InstallInterfaces(system);
210 Audio::InstallInterfaces(*sm); 210 Audio::InstallInterfaces(*sm);
211 BCAT::InstallInterfaces(*sm); 211 BCAT::InstallInterfaces(*sm);
212 BPC::InstallInterfaces(*sm); 212 BPC::InstallInterfaces(*sm);