Commit 03ce8d9e authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/pm: some fermi chipsets still use volt 0x30

Fun, fun.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent da1dc4cf
...@@ -420,6 +420,7 @@ struct nouveau_pm_voltage_level { ...@@ -420,6 +420,7 @@ struct nouveau_pm_voltage_level {
struct nouveau_pm_voltage { struct nouveau_pm_voltage {
bool supported; bool supported;
u8 version;
u8 vid_mask; u8 vid_mask;
struct nouveau_pm_voltage_level *level; struct nouveau_pm_voltage_level *level;
......
...@@ -146,16 +146,16 @@ nouveau_perf_voltage(struct drm_device *dev, struct bit_entry *P, ...@@ -146,16 +146,16 @@ nouveau_perf_voltage(struct drm_device *dev, struct bit_entry *P,
id = perflvl->volt_min; id = perflvl->volt_min;
perflvl->volt_min = 0; perflvl->volt_min = 0;
/* pre-fermi vbios stores the voltage level directly in the /* boards using voltage table version <0x40 store the voltage
* perflvl entry as a multiple of 10mV * level directly in the perflvl entry as a multiple of 10mV
*/ */
if (dev_priv->card_type < NV_C0) { if (dev_priv->engine.pm.voltage.version < 0x40) {
perflvl->volt_min = id * 10000; perflvl->volt_min = id * 10000;
perflvl->volt_max = perflvl->volt_min; perflvl->volt_max = perflvl->volt_min;
return; return;
} }
/* from fermi onwards, the perflvl stores an index into yet another /* on newer ones, the perflvl stores an index into yet another
* vbios table containing a min/max voltage value for the perflvl * vbios table containing a min/max voltage value for the perflvl
*/ */
if (P->version != 2 || P->length < 34) { if (P->version != 2 || P->length < 34) {
......
...@@ -204,7 +204,8 @@ nouveau_volt_init(struct drm_device *dev) ...@@ -204,7 +204,8 @@ nouveau_volt_init(struct drm_device *dev)
} }
/* parse vbios entries into common format */ /* parse vbios entries into common format */
if (volt[0] < 0x40) { voltage->version = volt[0];
if (voltage->version < 0x40) {
voltage->nr_level = entries; voltage->nr_level = entries;
voltage->level = voltage->level =
kcalloc(entries, sizeof(*voltage->level), GFP_KERNEL); kcalloc(entries, sizeof(*voltage->level), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment