drm/nv40/pm: parse fan pwm divisor from vbios tables
authorBen Skeggs <bskeggs@redhat.com>
Thu, 28 Jul 2011 00:17:40 +0000 (10:17 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 21 Dec 2011 09:01:09 +0000 (19:01 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_perf.c

index dfddb7e078a1e84aa7f7c06479811a5599b02f74..999bcb6a20b8b3933fbfee411ed612c418df68e6 100644 (file)
@@ -525,6 +525,7 @@ struct nouveau_pm_engine {
        struct nouveau_pm_memtimings memtimings;
        struct nouveau_pm_temp_sensor_constants sensor_constants;
        struct nouveau_pm_threshold_temp threshold_temp;
+       u32 pwm_divisor;
 
        struct nouveau_pm_level boot;
        struct nouveau_pm_level *cur;
index 33d03fbf00df56c7523bf8909168d267f0a1d197..3d20dca08fe80c25a8cc375a0a5f033409fb3382 100644 (file)
@@ -210,6 +210,9 @@ nouveau_perf_init(struct drm_device *dev)
                        recordlen = perf[2] + (perf[3] * perf[4]);
                        entries   = perf[5];
                }
+
+               if (version < 0x30)
+                       pm->pwm_divisor = ROM16(perf[6]);
        } else {
                if (bios->data[bios->offset + 6] < 0x25) {
                        legacy_perf_init(dev);
@@ -283,7 +286,6 @@ nouveau_perf_init(struct drm_device *dev)
                                perflvl->memory = ROM16(entry[11]) * 1000;
                        else
                                perflvl->memory = ROM16(entry[11]) * 2000;
-
                        break;
                case 0x25:
                        perflvl->fanspeed = entry[4];