mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Convert fanspeed management to default on exit.
This commit is contained in:
parent
833e020dfd
commit
87ec3f4789
5
adl.c
5
adl.c
@ -70,6 +70,7 @@ static ADL_OVERDRIVE5_POWERCONTROL_GET ADL_Overdrive5_PowerControl_Get;
|
||||
static ADL_OVERDRIVE5_POWERCONTROL_SET ADL_Overdrive5_PowerControl_Set;
|
||||
static ADL_ADAPTER_SPEED_GET ADL_Adapter_Speed_Get;
|
||||
static ADL_ADAPTER_SPEED_SET ADL_Adapter_Speed_Set;
|
||||
static ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET ADL_Overdrive5_FanSpeedToDefault_Set;
|
||||
|
||||
#if defined (LINUX)
|
||||
static void *hDLL; // Handle to .so library
|
||||
@ -132,6 +133,7 @@ void init_adl(int nDevs)
|
||||
ADL_Overdrive5_PowerControl_Set = (ADL_OVERDRIVE5_POWERCONTROL_SET) GetProcAddress(hDLL, "ADL_Overdrive5_PowerControl_Set");
|
||||
ADL_Adapter_Speed_Get = (ADL_ADAPTER_SPEED_GET) GetProcAddress(hDLL, "ADL_Adapter_Speed_Get");
|
||||
ADL_Adapter_Speed_Set = (ADL_ADAPTER_SPEED_SET) GetProcAddress(hDLL, "ADL_Adapter_Speed_Set");
|
||||
ADL_Overdrive5_FanSpeedToDefault_Set = (ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET) GetProcAddress(hDLL, "ADL_Overdrive5_FanSpeedToDefault_Set");
|
||||
|
||||
if (!ADL_Main_Control_Create || !ADL_Main_Control_Destroy ||
|
||||
!ADL_Adapter_NumberOfAdapters_Get || !ADL_Adapter_AdapterInfo_Get ||
|
||||
@ -142,7 +144,7 @@ void init_adl(int nDevs)
|
||||
!ADL_Overdrive5_ODPerformanceLevels_Get || !ADL_Overdrive5_ODPerformanceLevels_Set ||
|
||||
!ADL_Main_Control_Refresh || !ADL_Overdrive5_PowerControl_Get ||
|
||||
!ADL_Overdrive5_PowerControl_Set || !ADL_Adapter_Speed_Get ||
|
||||
!ADL_Adapter_Speed_Set) {
|
||||
!ADL_Adapter_Speed_Set || !ADL_Overdrive5_FanSpeedToDefault_Set) {
|
||||
applog(LOG_WARNING, "ATI ADL's API is missing");
|
||||
return;
|
||||
}
|
||||
@ -1087,6 +1089,7 @@ void clear_adl(nDevs)
|
||||
ADL_Overdrive5_ODPerformanceLevels_Set(ga->iAdapterIndex, ga->DefPerfLev);
|
||||
free(ga->DefPerfLev);
|
||||
ADL_Overdrive5_FanSpeed_Set(ga->iAdapterIndex, 0, &ga->DefFanSpeedValue);
|
||||
ADL_Overdrive5_FanSpeedToDefault_Set(ga->iAdapterIndex, 0);
|
||||
}
|
||||
|
||||
ADL_Main_Memory_Free ( (void **)&lpInfo );
|
||||
|
Loading…
x
Reference in New Issue
Block a user