mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-01 04:47:53 +00:00
am: Implement SetCpuBoostMode in terms of APM
This commit is contained in:
parent
e2ad3e1fb0
commit
7e5d7773cc
5 changed files with 26 additions and 13 deletions
|
@ -29,7 +29,8 @@
|
||||||
#include "core/hle/service/am/omm.h"
|
#include "core/hle/service/am/omm.h"
|
||||||
#include "core/hle/service/am/spsm.h"
|
#include "core/hle/service/am/spsm.h"
|
||||||
#include "core/hle/service/am/tcap.h"
|
#include "core/hle/service/am/tcap.h"
|
||||||
#include "core/hle/service/apm/apm.h"
|
#include "core/hle/service/apm/controller.h"
|
||||||
|
#include "core/hle/service/apm/interface.h"
|
||||||
#include "core/hle/service/filesystem/filesystem.h"
|
#include "core/hle/service/filesystem/filesystem.h"
|
||||||
#include "core/hle/service/ns/ns.h"
|
#include "core/hle/service/ns/ns.h"
|
||||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||||
|
@ -508,8 +509,9 @@ void AppletMessageQueue::OperationModeChanged() {
|
||||||
on_operation_mode_changed.writable->Signal();
|
on_operation_mode_changed.writable->Signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ICommonStateGetter::ICommonStateGetter(std::shared_ptr<AppletMessageQueue> msg_queue)
|
ICommonStateGetter::ICommonStateGetter(Core::System& system,
|
||||||
: ServiceFramework("ICommonStateGetter"), msg_queue(std::move(msg_queue)) {
|
std::shared_ptr<AppletMessageQueue> msg_queue)
|
||||||
|
: ServiceFramework("ICommonStateGetter"), system(system), msg_queue(std::move(msg_queue)) {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"},
|
{0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"},
|
||||||
|
@ -542,7 +544,7 @@ ICommonStateGetter::ICommonStateGetter(std::shared_ptr<AppletMessageQueue> msg_q
|
||||||
{63, nullptr, "GetHdcpAuthenticationStateChangeEvent"},
|
{63, nullptr, "GetHdcpAuthenticationStateChangeEvent"},
|
||||||
{64, nullptr, "SetTvPowerStateMatchingMode"},
|
{64, nullptr, "SetTvPowerStateMatchingMode"},
|
||||||
{65, nullptr, "GetApplicationIdByContentActionName"},
|
{65, nullptr, "GetApplicationIdByContentActionName"},
|
||||||
{66, nullptr, "SetCpuBoostMode"},
|
{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
|
||||||
{80, nullptr, "PerformSystemButtonPressingIfInFocus"},
|
{80, nullptr, "PerformSystemButtonPressingIfInFocus"},
|
||||||
{90, nullptr, "SetPerformanceConfigurationChangedNotification"},
|
{90, nullptr, "SetPerformanceConfigurationChangedNotification"},
|
||||||
{91, nullptr, "GetCurrentPerformanceConfiguration"},
|
{91, nullptr, "GetCurrentPerformanceConfiguration"},
|
||||||
|
@ -623,6 +625,16 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ICommonStateGetter::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
|
||||||
|
LOG_DEBUG(Service_AM, "called, forwarding to APM:SYS");
|
||||||
|
|
||||||
|
const auto& sm = system.ServiceManager();
|
||||||
|
const auto apm_sys = sm.GetService<APM::APM_Sys>("apm:sys");
|
||||||
|
ASSERT(apm_sys != nullptr);
|
||||||
|
|
||||||
|
apm_sys->SetCpuBoostMode(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
IStorage::IStorage(std::vector<u8> buffer)
|
IStorage::IStorage(std::vector<u8> buffer)
|
||||||
: ServiceFramework("IStorage"), buffer(std::move(buffer)) {
|
: ServiceFramework("IStorage"), buffer(std::move(buffer)) {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@ -651,13 +663,11 @@ void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
||||||
const bool use_docked_mode{Settings::values.use_docked_mode};
|
LOG_DEBUG(Service_AM, "called");
|
||||||
LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);
|
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.Push(static_cast<u32>(use_docked_mode ? APM::PerformanceMode::Docked
|
rb.PushEnum(system.GetAPMController().GetCurrentPerformanceMode());
|
||||||
: APM::PerformanceMode::Handheld));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
||||||
|
|
|
@ -145,7 +145,8 @@ private:
|
||||||
|
|
||||||
class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
|
class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
|
||||||
public:
|
public:
|
||||||
explicit ICommonStateGetter(std::shared_ptr<AppletMessageQueue> msg_queue);
|
explicit ICommonStateGetter(Core::System& system,
|
||||||
|
std::shared_ptr<AppletMessageQueue> msg_queue);
|
||||||
~ICommonStateGetter() override;
|
~ICommonStateGetter() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -167,7 +168,9 @@ private:
|
||||||
void GetPerformanceMode(Kernel::HLERequestContext& ctx);
|
void GetPerformanceMode(Kernel::HLERequestContext& ctx);
|
||||||
void GetBootMode(Kernel::HLERequestContext& ctx);
|
void GetBootMode(Kernel::HLERequestContext& ctx);
|
||||||
void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx);
|
void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx);
|
||||||
|
void SetCpuBoostMode(Kernel::HLERequestContext& ctx);
|
||||||
|
|
||||||
|
Core::System& system;
|
||||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ private:
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushIpcInterface<ICommonStateGetter>(msg_queue);
|
rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetSelfController(Kernel::HLERequestContext& ctx) {
|
void GetSelfController(Kernel::HLERequestContext& ctx) {
|
||||||
|
@ -146,7 +146,7 @@ private:
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushIpcInterface<ICommonStateGetter>(msg_queue);
|
rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetSelfController(Kernel::HLERequestContext& ctx) {
|
void GetSelfController(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ private:
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushIpcInterface<ICommonStateGetter>(msg_queue);
|
rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
|
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
|
@ -206,7 +206,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system,
|
||||||
Account::InstallInterfaces(system);
|
Account::InstallInterfaces(system);
|
||||||
AM::InstallInterfaces(*sm, nv_flinger, system);
|
AM::InstallInterfaces(*sm, nv_flinger, system);
|
||||||
AOC::InstallInterfaces(*sm);
|
AOC::InstallInterfaces(*sm);
|
||||||
APM::InstallInterfaces(*sm);
|
APM::InstallInterfaces(system);
|
||||||
Audio::InstallInterfaces(*sm);
|
Audio::InstallInterfaces(*sm);
|
||||||
BCAT::InstallInterfaces(*sm);
|
BCAT::InstallInterfaces(*sm);
|
||||||
BPC::InstallInterfaces(*sm);
|
BPC::InstallInterfaces(*sm);
|
||||||
|
|
Loading…
Reference in a new issue