]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/gpu/drm/nouveau/nv04_pm.c
Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ickle...
[linux-beck.git] / drivers / gpu / drm / nouveau / nv04_pm.c
index 15e4b9029df8569705f0046c33e6ca5546f2dc83..eb1c70dd82ed41540629792dc7264452f511e6f3 100644 (file)
@@ -25,6 +25,7 @@
 #include "drmP.h"
 #include "nouveau_drv.h"
 #include "nouveau_hw.h"
+#include "nouveau_pm.h"
 
 struct nv04_pm_state {
        struct pll_lims pll;
@@ -38,7 +39,8 @@ nv04_pm_clock_get(struct drm_device *dev, u32 id)
 }
 
 void *
-nv04_pm_clock_pre(struct drm_device *dev, u32 id, int khz)
+nv04_pm_clock_pre(struct drm_device *dev, struct nouveau_pm_level *perflvl,
+                 u32 id, int khz)
 {
        struct nv04_pm_state *state;
        int ret;
@@ -74,6 +76,15 @@ nv04_pm_clock_set(struct drm_device *dev, void *pre_state)
                reg += 4;
 
        nouveau_hw_setpll(dev, reg, &state->calc);
+
+       if (dev_priv->card_type < NV_30 && reg == NV_PRAMDAC_MPLL_COEFF) {
+               if (dev_priv->card_type == NV_20)
+                       nv_mask(dev, 0x1002c4, 0, 1 << 20);
+
+               /* Reset the DLLs */
+               nv_mask(dev, 0x1002c0, 0, 1 << 8);
+       }
+
        kfree(state);
 }