Merge pull request #17783 from pstef/switch-performance-profiles
This commit is contained in:
commit
b5424e7448
|
@ -76,6 +76,37 @@ static enum frontend_fork switch_fork_mode = FRONTEND_FORK_NONE;
|
||||||
bool platform_switch_has_focus = true;
|
bool platform_switch_has_focus = true;
|
||||||
|
|
||||||
#ifdef HAVE_LIBNX
|
#ifdef HAVE_LIBNX
|
||||||
|
char *SWITCH_CPU_PROFILES[] = {
|
||||||
|
"Maximum Performance",
|
||||||
|
"High Performance",
|
||||||
|
"Boost Performance",
|
||||||
|
"Stock Performance",
|
||||||
|
"Powersaving Mode 1",
|
||||||
|
"Powersaving Mode 2",
|
||||||
|
"Powersaving Mode 3",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
char *SWITCH_CPU_SPEEDS[] = {
|
||||||
|
"1785 MHz",
|
||||||
|
"1581 MHz",
|
||||||
|
"1224 MHz",
|
||||||
|
"1020 MHz",
|
||||||
|
"918 MHz",
|
||||||
|
"816 MHz",
|
||||||
|
"714 MHz",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
|
||||||
|
1785000000,
|
||||||
|
1581000000,
|
||||||
|
1224000000,
|
||||||
|
1020000000,
|
||||||
|
918000000,
|
||||||
|
816000000,
|
||||||
|
714000000,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
static bool psmInitialized = false;
|
static bool psmInitialized = false;
|
||||||
|
|
||||||
static AppletHookCookie applet_hook_cookie;
|
static AppletHookCookie applet_hook_cookie;
|
||||||
|
@ -87,7 +118,7 @@ extern bool nxlink_connected;
|
||||||
void libnx_apply_overclock(void)
|
void libnx_apply_overclock(void)
|
||||||
{
|
{
|
||||||
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)
|
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)
|
||||||
/ sizeof(SWITCH_CPU_PROFILES[1]);
|
/ sizeof(SWITCH_CPU_PROFILES[1]) - 1;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
unsigned libnx_overclock = settings->uints.libnx_overclock;
|
unsigned libnx_overclock = settings->uints.libnx_overclock;
|
||||||
|
|
||||||
|
|
|
@ -12855,7 +12855,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
|
||||||
size_t _len;
|
size_t _len;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char text[128];
|
char text[128];
|
||||||
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)/sizeof(SWITCH_CPU_PROFILES[1]);
|
|
||||||
/* TODO/FIXME - localize */
|
/* TODO/FIXME - localize */
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
"Warning : extended overclocking can damage the Switch",
|
"Warning : extended overclocking can damage the Switch",
|
||||||
|
@ -12882,7 +12881,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
|
||||||
0, 0, NULL))
|
0, 0, NULL))
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
for (i = 0; i < profiles_count; i++)
|
for (i = 0; SWITCH_CPU_PROFILES[i]; i++)
|
||||||
{
|
{
|
||||||
char title[NAME_MAX_LENGTH];
|
char title[NAME_MAX_LENGTH];
|
||||||
size_t _len = strlcpy(title, SWITCH_CPU_PROFILES[i],
|
size_t _len = strlcpy(title, SWITCH_CPU_PROFILES[i],
|
||||||
|
|
|
@ -19,38 +19,10 @@
|
||||||
|
|
||||||
#if defined(HAVE_LIBNX)
|
#if defined(HAVE_LIBNX)
|
||||||
|
|
||||||
static char *SWITCH_CPU_PROFILES[] = {
|
extern char *SWITCH_CPU_PROFILES[];
|
||||||
"Maximum Performance",
|
extern char *SWITCH_CPU_SPEEDS[];
|
||||||
"High Performance",
|
extern unsigned SWITCH_CPU_SPEEDS_VALUES[];
|
||||||
"Boost Performance",
|
|
||||||
"Stock Performance",
|
|
||||||
"Powersaving Mode 1",
|
|
||||||
"Powersaving Mode 2",
|
|
||||||
"Powersaving Mode 3",
|
|
||||||
};
|
|
||||||
|
|
||||||
#define SWITCH_DEFAULT_CPU_PROFILE 3 /* Stock Performance */
|
#define SWITCH_DEFAULT_CPU_PROFILE 3 /* Stock Performance */
|
||||||
#define LIBNX_MAX_CPU_PROFILE 0 /* Max Performance */
|
|
||||||
|
|
||||||
static char *SWITCH_CPU_SPEEDS[] = {
|
|
||||||
"1785 MHz",
|
|
||||||
"1581 MHz",
|
|
||||||
"1224 MHz",
|
|
||||||
"1020 MHz",
|
|
||||||
"918 MHz",
|
|
||||||
"816 MHz",
|
|
||||||
"714 MHz"
|
|
||||||
};
|
|
||||||
|
|
||||||
static unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
|
|
||||||
1785000000,
|
|
||||||
1581000000,
|
|
||||||
1224000000,
|
|
||||||
1020000000,
|
|
||||||
918000000,
|
|
||||||
816000000,
|
|
||||||
714000000
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue