-5

I'm currently analizing AMD ADL sdk and found very intresting function

int FindTController(const int iAdapter)
{
    for (int i = 0; ; i++)
    {
        ADLThermalControllerInfo tcinfo;

        tcinfo.iSize = sizeof(tcinfo);

        if (ADL_OK == ADL_Overdrive5_ThermalDevices_Enum(iAdapter, i, &tcinfo))
        {
            if (tcinfo.iThermalDomain) // if GPU domain
                return i;
            //tcinfo.iDomainIndex;
            //tcinfo.iFlags;
        }
    }
    return 0;
}

I understand that this function is searching for responsive AMD GPU thermal device, but why its needed in functions such

void SetDefaultFanSpeed(const int iAdapter, const int iTController)
{
    if (ADL_OK != ADL_Overdrive5_FanSpeedToDefault_Set(iAdapter, iTController))
    {
        fprintf(stderr, "Error: cannot set Fan Speed to default.\n");
    }
}
int ADL_Overdrive5_FanSpeedToDefault_Set(int iAdapterIndex, int iThermalControllerIndex)
    {
        return Error = ((int (*)(int,int)) (mProcAddress[E_ADL_Overdrive5_FanSpeedToDefault_Set]))
            (iAdapterIndex, iThermalControllerIndex);
    }

Almost all amd ADL functions is using this FindTController function, is it really important or just snake oil?

JonZ
  • 139
  • 2
  • 17
  • 2
    _"Almost all amd ADL functions is using this FindTController"_: do they? Where? – YSC Jun 28 '18 at 11:23
  • ADL_Overdrive5_FanSpeedInfo_Get(iAdapter, iTController, &fan),ADL_Overdrive5_FanSpeedInfo_Get(iAdapter, iTController, &fan) and so on, before calling these methods there is: int iTController = FindTController(iAdapter); – JonZ Jun 28 '18 at 11:26
  • Well I would assume that functions controlling the fans or frequency throttling would need to use a thermal device to know the temperature, as it's kind of important for a GPU to be as cool as possible to avoid damage. – Some programmer dude Jun 28 '18 at 11:32

1 Answers1

0

Without knowing the insides of the hardware it's hard to say. But what makes you think it would be snake oil?

Does the fan speed not change when SetDefaultFanSpeed is called? The interface seems totally reasonable. You have to tell it what GFX card and what Fan to set the speed for. Without the iTController argument how would you set the speed for 2 fans on a card differently?

Goswin von Brederlow
  • 11,875
  • 2
  • 24
  • 42