mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 23:57:22 +02:00
Remove the vendor config value in prep for it to be auto-detected
This commit is contained in:
parent
d582b580b2
commit
0847d3b452
@ -87,7 +87,6 @@ struct GameModeConfig {
|
|||||||
long reaper_frequency;
|
long reaper_frequency;
|
||||||
|
|
||||||
char apply_gpu_optimisations[CONFIG_VALUE_MAX];
|
char apply_gpu_optimisations[CONFIG_VALUE_MAX];
|
||||||
long gpu_vendor;
|
|
||||||
long gpu_device;
|
long gpu_device;
|
||||||
long nv_core_clock_mhz_offset;
|
long nv_core_clock_mhz_offset;
|
||||||
long nv_mem_clock_mhz_offset;
|
long nv_mem_clock_mhz_offset;
|
||||||
@ -231,8 +230,6 @@ static int inih_handler(void *user, const char *section, const char *name, const
|
|||||||
/* GPU subsection */
|
/* GPU subsection */
|
||||||
if (strcmp(name, "apply_gpu_optimisations") == 0) {
|
if (strcmp(name, "apply_gpu_optimisations") == 0) {
|
||||||
valid = get_string_value(value, self->values.apply_gpu_optimisations);
|
valid = get_string_value(value, self->values.apply_gpu_optimisations);
|
||||||
} else if (strcmp(name, "gpu_vendor") == 0) {
|
|
||||||
valid = get_long_value_hex(name, value, &self->values.gpu_vendor);
|
|
||||||
} else if (strcmp(name, "gpu_device") == 0) {
|
} else if (strcmp(name, "gpu_device") == 0) {
|
||||||
valid = get_long_value(name, value, &self->values.gpu_device);
|
valid = get_long_value(name, value, &self->values.gpu_device);
|
||||||
} else if (strcmp(name, "nv_core_clock_mhz_offset") == 0) {
|
} else if (strcmp(name, "nv_core_clock_mhz_offset") == 0) {
|
||||||
@ -556,7 +553,6 @@ void config_get_apply_gpu_optimisations(GameModeConfig *self, char value[CONFIG_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Define the getters for GPU values */
|
/* Define the getters for GPU values */
|
||||||
DEFINE_CONFIG_GET(gpu_vendor)
|
|
||||||
DEFINE_CONFIG_GET(gpu_device)
|
DEFINE_CONFIG_GET(gpu_device)
|
||||||
DEFINE_CONFIG_GET(nv_core_clock_mhz_offset)
|
DEFINE_CONFIG_GET(nv_core_clock_mhz_offset)
|
||||||
DEFINE_CONFIG_GET(nv_mem_clock_mhz_offset)
|
DEFINE_CONFIG_GET(nv_mem_clock_mhz_offset)
|
||||||
|
@ -134,7 +134,6 @@ long config_get_ioprio_value(GameModeConfig *self);
|
|||||||
* Get various config info for gpu optimisations
|
* Get various config info for gpu optimisations
|
||||||
*/
|
*/
|
||||||
void config_get_apply_gpu_optimisations(GameModeConfig *self, char value[CONFIG_VALUE_MAX]);
|
void config_get_apply_gpu_optimisations(GameModeConfig *self, char value[CONFIG_VALUE_MAX]);
|
||||||
long config_get_gpu_vendor(GameModeConfig *self);
|
|
||||||
long config_get_gpu_device(GameModeConfig *self);
|
long config_get_gpu_device(GameModeConfig *self);
|
||||||
long config_get_nv_core_clock_mhz_offset(GameModeConfig *self);
|
long config_get_nv_core_clock_mhz_offset(GameModeConfig *self);
|
||||||
long config_get_nv_mem_clock_mhz_offset(GameModeConfig *self);
|
long config_get_nv_mem_clock_mhz_offset(GameModeConfig *self);
|
||||||
|
@ -71,9 +71,11 @@ int game_mode_initialise_gpu(GameModeConfig *config, GameModeGPUInfo **info)
|
|||||||
memset(new_info, 0, sizeof(GameModeGPUInfo));
|
memset(new_info, 0, sizeof(GameModeGPUInfo));
|
||||||
|
|
||||||
/* Get the config parameters */
|
/* Get the config parameters */
|
||||||
new_info->vendor = config_get_gpu_vendor(config);
|
|
||||||
new_info->device = config_get_gpu_device(config);
|
new_info->device = config_get_gpu_device(config);
|
||||||
|
|
||||||
|
/* TODO fill in GPU vendor */
|
||||||
|
new_info->vendor = 0;
|
||||||
|
|
||||||
/* verify device ID */
|
/* verify device ID */
|
||||||
if (new_info->device == -1) {
|
if (new_info->device == -1) {
|
||||||
LOG_ERROR(
|
LOG_ERROR(
|
||||||
@ -86,10 +88,9 @@ int game_mode_initialise_gpu(GameModeConfig *config, GameModeGPUInfo **info)
|
|||||||
/* verify GPU vendor */
|
/* verify GPU vendor */
|
||||||
if (!GPUVendorValid(new_info->vendor)) {
|
if (!GPUVendorValid(new_info->vendor)) {
|
||||||
LOG_ERROR(
|
LOG_ERROR(
|
||||||
"Invalid gpu_vendor value (0x%04x) set in configuration, will not apply "
|
"Unknown vendor value (0x%04x) found, cannot apply optimisations!\n",
|
||||||
"optimisations!\n",
|
|
||||||
(unsigned int)new_info->vendor);
|
(unsigned int)new_info->vendor);
|
||||||
LOG_ERROR("Possible values are: 0x%04x (NVIDIA) 0x%04x (AMD) 0x%04x (Intel)\n",
|
LOG_ERROR("Known values are: 0x%04x (NVIDIA) 0x%04x (AMD) 0x%04x (Intel)\n",
|
||||||
Vendor_NVIDIA,
|
Vendor_NVIDIA,
|
||||||
Vendor_AMD,
|
Vendor_AMD,
|
||||||
Vendor_Intel);
|
Vendor_Intel);
|
||||||
|
@ -421,16 +421,15 @@ int run_gpu_optimisation_tests(struct GameModeConfig *config)
|
|||||||
/* Get current GPU values */
|
/* Get current GPU values */
|
||||||
GameModeGPUInfo gpuinfo;
|
GameModeGPUInfo gpuinfo;
|
||||||
gpuinfo.device = config_get_gpu_device(config);
|
gpuinfo.device = config_get_gpu_device(config);
|
||||||
gpuinfo.vendor = config_get_gpu_vendor(config);
|
|
||||||
|
|
||||||
if (gpuinfo.vendor == Vendor_NVIDIA)
|
|
||||||
gpuinfo.nv_perf_level = config_get_nv_perf_level(config);
|
|
||||||
|
|
||||||
if (game_mode_get_gpu(&gpuinfo) != 0) {
|
if (game_mode_get_gpu(&gpuinfo) != 0) {
|
||||||
LOG_ERROR("Could not get current GPU info, see above!\n");
|
LOG_ERROR("Could not get current GPU info, see above!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gpuinfo.vendor == Vendor_NVIDIA)
|
||||||
|
gpuinfo.nv_perf_level = config_get_nv_perf_level(config);
|
||||||
|
|
||||||
/* Store the original values */
|
/* Store the original values */
|
||||||
long original_core = gpuinfo.core;
|
long original_core = gpuinfo.core;
|
||||||
long original_mem = gpuinfo.mem;
|
long original_mem = gpuinfo.mem;
|
||||||
|
@ -43,9 +43,7 @@ inhibit_screensaver=1
|
|||||||
; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
|
; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
|
||||||
;apply_gpu_optimisations=0
|
;apply_gpu_optimisations=0
|
||||||
|
|
||||||
; You must set these to tell gamemode the Vendor of your graphics card, as well it's device number on the system (usually 0)
|
; The device number on the system (usually 0)
|
||||||
; Vendor must be one of 0x10de (NVIDIA), 0x1002 (AMD) or 0x8086 (Intel)
|
|
||||||
;gpu_vendor=0x0000
|
|
||||||
;gpu_device=0
|
;gpu_device=0
|
||||||
|
|
||||||
; Nvidia specific settings (these are Mhz offsets from the baseline, ie. 0 applies no change)
|
; Nvidia specific settings (these are Mhz offsets from the baseline, ie. 0 applies no change)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user