summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-06-10 15:33:11 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 16:01:37 +1000
commit03ce8d9e63199fd5983129941a6694123b885753 (patch)
tree32f90d1b3b9b3ede6df01196ecd93750de924eb8
parentda1dc4cfecdf314241cc5e0c5df1f66b4cc80cc7 (diff)
drm/nouveau/pm: some fermi chipsets still use volt 0x30
Fun, fun. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h1
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_perf.c8
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_volt.c3
3 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 84a19a5fc55..491158d7304 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -420,6 +420,7 @@ struct nouveau_pm_voltage_level {
struct nouveau_pm_voltage {
bool supported;
+ u8 version;
u8 vid_mask;
struct nouveau_pm_voltage_level *level;
diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c
index 18d1d995b53..b0e995fdcba 100644
--- a/drivers/gpu/drm/nouveau/nouveau_perf.c
+++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
@@ -146,16 +146,16 @@ nouveau_perf_voltage(struct drm_device *dev, struct bit_entry *P,
id = perflvl->volt_min;
perflvl->volt_min = 0;
- /* pre-fermi vbios stores the voltage level directly in the
- * perflvl entry as a multiple of 10mV
+ /* boards using voltage table version <0x40 store the voltage
+ * 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_max = perflvl->volt_min;
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
*/
if (P->version != 2 || P->length < 34) {
diff --git a/drivers/gpu/drm/nouveau/nouveau_volt.c b/drivers/gpu/drm/nouveau/nouveau_volt.c
index 5389aba46d6..86d03e15735 100644
--- a/drivers/gpu/drm/nouveau/nouveau_volt.c
+++ b/drivers/gpu/drm/nouveau/nouveau_volt.c
@@ -204,7 +204,8 @@ nouveau_volt_init(struct drm_device *dev)
}
/* parse vbios entries into common format */
- if (volt[0] < 0x40) {
+ voltage->version = volt[0];
+ if (voltage->version < 0x40) {
voltage->nr_level = entries;
voltage->level =
kcalloc(entries, sizeof(*voltage->level), GFP_KERNEL);