[PATCH] drm/radeon/kms/pm: add support for SetVoltage cmd table (V2)

Alex Deucher alexdeucher at gmail.com
Thu Jun 3 19:35:13 PDT 2010


2010/6/3 Alex Deucher <alexdeucher at gmail.com>:
> 2010/6/3 Rafał Miłecki <zajec5 at gmail.com>:
>> 2010/5/28 Alex Deucher <alexdeucher at gmail.com>:
>>> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
>>> index dac2534..d84d7cf 100644
>>> --- a/drivers/gpu/drm/radeon/r600.c
>>> +++ b/drivers/gpu/drm/radeon/r600.c
>>> @@ -475,6 +475,12 @@ void r600_pm_init_profile(struct radeon_device *rdev)
>>>
>>>  void r600_pm_misc(struct radeon_device *rdev)
>>>  {
>>> +       int requested_index = rdev->pm.requested_power_state_index;
>>> +       struct radeon_power_state *ps = &rdev->pm.power_state[requested_index];
>>> +       struct radeon_voltage *voltage = &ps->clock_info[0].voltage;
>>> +
>>> +       if ((voltage->type == VOLTAGE_SW) && voltage->voltage)
>>> +               radeon_atom_set_voltage(rdev, voltage->voltage);
>>>
>>>  }
>>>
>>
>> In case of my RV620 I can see (using AtomDis):
>>    0004:  UCHAR ucVoltageType                                 = 0x01       (1)
>> so it looks that my GPU uses VOLTAGE_GPIO (it's 0x01).
>>
>> You seem to do not use SetVoltage AtomBIOS command for VOLTAGE_GPIO.
>> However in case of my BIOS there is SetVoltage command table.
>>
>> Could you comment on this, please?
>
> The VOLTAGE_GPIO, VOLTAGE_SW, etc. enums in the driver are a little
> confusing I guess.  They refer to the interface used to program the

Just to clarify, they refer to the interface used to *store* the
voltage in the power tables.

Alex

> voltage.  We could have called them VOLTAGE_TYPE1, VOLTAGE_TYPE2,
> etc., but I wanted to provide a bit more info about the type.
>
> VOLTAGE_GPIO refers to the cases where the power table specifies the
> GPIO reg and a mask for voltage control.
> VOLTAGE_VDDC refers to the cases where the power table specifies an
> index into the VDDC voltage table.
> VOLTAGE_SW refers to the cases where the power table specifies the
> actual voltage value which SW (software) has to program.
>
> Your system (actually all r6xx+ vbioses) specifies a voltage value, so
> they are the VOLTAGE_SW type.  The actual implementation on the board
> may be gpio or i2c, etc.; depends on the board.   The SetVoltage
> command table uses the VoltageObject data table to look up the the
> relevant info based on the voltage value specified.
>
> I hope that clarifies things.
>
> Alex
>


More information about the dri-devel mailing list