mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-03 12:21:07 +00:00
Add ADL_Overdrive6_TargetTemperatureData_Get() which for some reason does not work
This commit is contained in:
parent
3e4badd9b4
commit
3e6ae89297
@ -312,6 +312,7 @@ typedef int (*ADL_OVERDRIVE6_CAPABILITIES_GET) (int, ADLOD6Capabilities *);
|
|||||||
typedef int (*ADL_OVERDRIVE6_STATE_SET) (int, int, ADLOD6StateInfo *);
|
typedef int (*ADL_OVERDRIVE6_STATE_SET) (int, int, ADLOD6StateInfo *);
|
||||||
typedef int (*ADL_OVERDRIVE6_POWERCONTROL_CAPS) (int, int *);
|
typedef int (*ADL_OVERDRIVE6_POWERCONTROL_CAPS) (int, int *);
|
||||||
typedef int (*ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET) (int, int *, int *);
|
typedef int (*ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET) (int, int *, int *);
|
||||||
|
typedef int (*ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET) (int, ADLOD6ParameterRange *);
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -349,6 +350,7 @@ typedef struct
|
|||||||
ADL_OVERDRIVE6_CURRENTSTATUS_GET ADL_Overdrive6_CurrentStatus_Get;
|
ADL_OVERDRIVE6_CURRENTSTATUS_GET ADL_Overdrive6_CurrentStatus_Get;
|
||||||
ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set;
|
ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set;
|
||||||
ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get;
|
ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get;
|
||||||
|
ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET ADL_Overdrive6_TargetTemperatureRangeInfo_Get;
|
||||||
|
|
||||||
} hm_adl_lib_t;
|
} hm_adl_lib_t;
|
||||||
|
|
||||||
@ -389,6 +391,7 @@ int hm_ADL_Overdrive_Capabilities_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6Ca
|
|||||||
int hm_ADL_Overdrive_State_Set (ADL_PTR *adl, int iAdapterIndex, int type, ADLOD6StateInfo *state);
|
int hm_ADL_Overdrive_State_Set (ADL_PTR *adl, int iAdapterIndex, int type, ADLOD6StateInfo *state);
|
||||||
int hm_ADL_Overdrive6_PowerControl_Caps (ADL_PTR *adl, int iAdapterIndex, int *lpSupported);
|
int hm_ADL_Overdrive6_PowerControl_Caps (ADL_PTR *adl, int iAdapterIndex, int *lpSupported);
|
||||||
int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex, int *cur_temp, int *default_temp);
|
int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex, int *cur_temp, int *default_temp);
|
||||||
|
int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6ParameterRange *lpTargetTemperatureInfo);
|
||||||
|
|
||||||
#endif // HAVE_HWMON && HAVE_ADL
|
#endif // HAVE_HWMON && HAVE_ADL
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ int adl_init (ADL_PTR *adl)
|
|||||||
HC_LOAD_FUNC(adl, ADL_Overdrive6_CurrentStatus_Get, ADL_OVERDRIVE6_CURRENTSTATUS_GET, ADL, 0)
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_CurrentStatus_Get, ADL_OVERDRIVE6_CURRENTSTATUS_GET, ADL, 0)
|
||||||
HC_LOAD_FUNC(adl, ADL_Overdrive6_State_Set, ADL_OVERDRIVE6_STATE_SET, ADL, 0)
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_State_Set, ADL_OVERDRIVE6_STATE_SET, ADL, 0)
|
||||||
HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureData_Get, ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET, ADL, 0)
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureData_Get, ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET, ADL, 0)
|
||||||
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureRangeInfo_Get, ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET, ADL, 0)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -582,3 +583,12 @@ int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex
|
|||||||
|
|
||||||
return (ADL_rc);
|
return (ADL_rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6ParameterRange *lpTargetTemperatureInfo)
|
||||||
|
{
|
||||||
|
if (!adl) return (-1);
|
||||||
|
|
||||||
|
int ADL_rc = adl->ADL_Overdrive6_TargetTemperatureRangeInfo_Get (iAdapterIndex, lpTargetTemperatureInfo);
|
||||||
|
|
||||||
|
return (ADL_rc);
|
||||||
|
}
|
||||||
|
20
src/shared.c
20
src/shared.c
@ -3062,7 +3062,27 @@ int hm_get_threshold_slowdown_with_device_id (const uint device_id)
|
|||||||
if ((data.devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) return -1;
|
if ((data.devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) return -1;
|
||||||
|
|
||||||
#ifdef HAVE_ADL
|
#ifdef HAVE_ADL
|
||||||
|
if (data.devices_param[device_id].device_vendor_id == VENDOR_ID_AMD)
|
||||||
|
{
|
||||||
|
if (data.hm_amd)
|
||||||
|
{
|
||||||
|
if (data.hm_device[device_id].od_version == 5)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (data.hm_device[device_id].od_version == 6)
|
||||||
|
{
|
||||||
|
int CurrentValue = 0;
|
||||||
|
int DefaultValue = 0;
|
||||||
|
|
||||||
|
if (hm_ADL_Overdrive6_TargetTemperatureData_Get (data.hm_amd, data.hm_device[device_id].adapter_index.amd, &CurrentValue, &DefaultValue) != ADL_OK) return -1;
|
||||||
|
|
||||||
|
// the return value has never been tested since hm_ADL_Overdrive6_TargetTemperatureData_Get() never worked on any system. expect problems.
|
||||||
|
|
||||||
|
return DefaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NVML) || defined(HAVE_NVAPI)
|
#if defined(HAVE_NVML) || defined(HAVE_NVAPI)
|
||||||
|
Loading…
Reference in New Issue
Block a user