drm/nouveau/pm: allow voltage-only perflvl set, enable nvc0
authorBen Skeggs <bskeggs@redhat.com>
Fri, 10 Jun 2011 02:07:09 +0000 (12:07 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 20 Sep 2011 06:01:30 +0000 (16:01 +1000)
Okay, my card didn't blow up.  Lets turn it on!

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_pm.c
drivers/gpu/drm/nouveau/nouveau_state.c

index 53d2ad8..179067a 100644 (file)
@@ -72,10 +72,12 @@ nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl)
                }
        }
 
-       nouveau_pm_clock_set(dev, perflvl, PLL_CORE, perflvl->core);
-       nouveau_pm_clock_set(dev, perflvl, PLL_SHADER, perflvl->shader);
-       nouveau_pm_clock_set(dev, perflvl, PLL_MEMORY, perflvl->memory);
-       nouveau_pm_clock_set(dev, perflvl, PLL_UNK05, perflvl->unk05);
+       if (pm->clock_set) {
+               nouveau_pm_clock_set(dev, perflvl, PLL_CORE, perflvl->core);
+               nouveau_pm_clock_set(dev, perflvl, PLL_SHADER, perflvl->shader);
+               nouveau_pm_clock_set(dev, perflvl, PLL_MEMORY, perflvl->memory);
+               nouveau_pm_clock_set(dev, perflvl, PLL_UNK05, perflvl->unk05);
+       }
 
        pm->cur = perflvl;
        return 0;
@@ -92,9 +94,6 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile)
        if (nouveau_perflvl_wr != 7777)
                return -EPERM;
 
-       if (!pm->clock_set)
-               return -EINVAL;
-
        if (!strncmp(profile, "boot", 4))
                perflvl = &pm->boot;
        else {
index 48bddd5..bd4c8f5 100644 (file)
@@ -423,6 +423,7 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
                engine->vram.flags_valid        = nvc0_vram_flags_valid;
                engine->pm.temp_get             = nv84_temp_get;
                engine->pm.voltage_get          = nouveau_voltage_gpio_get;
+               engine->pm.voltage_set          = nouveau_voltage_gpio_set;
                break;
        default:
                NV_ERROR(dev, "NV%02x unsupported\n", dev_priv->chipset);