mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-06 13:18:31 +02:00
Change AMD overclocking to simply be setting the power_dpm_force_performance_level file for now
This covers the MVP for now, and simply allows pinning the power level to "high" Full overclocking set up is somewhat more complicated, and it'll be better to implement that at the same time as the same for Nvidia, where we're currently only really setting the top end power level
This commit is contained in:

committed by
Alex Smith

parent
20efaaa33f
commit
9ade4481c3
@@ -64,7 +64,8 @@ struct GameModeContext {
|
||||
|
||||
char initial_cpu_mode[64]; /**<Only updates when we can */
|
||||
|
||||
struct GameModeGPUInfo *gpu_info; /**<Stored GPU info for the current GPU */
|
||||
struct GameModeGPUInfo *stored_gpu; /**<Stored GPU info for the current GPU */
|
||||
struct GameModeGPUInfo *target_gpu; /**<Target GPU info for the current GPU */
|
||||
|
||||
/* Reaper control */
|
||||
struct {
|
||||
@@ -112,7 +113,8 @@ void game_mode_context_init(GameModeContext *self)
|
||||
config_init(self->config);
|
||||
|
||||
/* Initialise the current GPU info */
|
||||
game_mode_initialise_gpu(self->config, &self->gpu_info);
|
||||
game_mode_initialise_gpu(self->config, &self->stored_gpu);
|
||||
game_mode_initialise_gpu(self->config, &self->target_gpu);
|
||||
|
||||
pthread_rwlock_init(&self->rwlock, NULL);
|
||||
pthread_mutex_init(&self->reaper.mutex, NULL);
|
||||
@@ -152,7 +154,8 @@ void game_mode_context_destroy(GameModeContext *self)
|
||||
pthread_mutex_destroy(&self->reaper.mutex);
|
||||
|
||||
/* Destroy the gpu object */
|
||||
game_mode_free_gpu(&self->gpu_info);
|
||||
game_mode_free_gpu(&self->stored_gpu);
|
||||
game_mode_free_gpu(&self->target_gpu);
|
||||
|
||||
/* Destroy the config object */
|
||||
config_destroy(self->config);
|
||||
@@ -201,8 +204,9 @@ static void game_mode_context_enter(GameModeContext *self)
|
||||
if (config_get_inhibit_screensaver(self->config))
|
||||
game_mode_inhibit_screensaver(true);
|
||||
|
||||
/* Apply GPU optimisations */
|
||||
game_mode_apply_gpu(self->gpu_info, true);
|
||||
/* Apply GPU optimisations by first getting the current values, and then setting the target */
|
||||
game_mode_get_gpu(self->stored_gpu);
|
||||
game_mode_apply_gpu(self->target_gpu);
|
||||
|
||||
/* Run custom scripts last - ensures the above are applied first and these scripts can react to
|
||||
* them if needed */
|
||||
@@ -225,7 +229,7 @@ static void game_mode_context_leave(GameModeContext *self)
|
||||
sd_notifyf(0, "STATUS=%sGameMode is currently deactivated.%s\n", "\x1B[1;36m", "\x1B[0m");
|
||||
|
||||
/* Remove GPU optimisations */
|
||||
game_mode_apply_gpu(self->gpu_info, false);
|
||||
game_mode_apply_gpu(self->stored_gpu);
|
||||
|
||||
/* UnInhibit the screensaver */
|
||||
if (config_get_inhibit_screensaver(self->config))
|
||||
|
Reference in New Issue
Block a user