[PATCH 3/3] Idle PGRAPH and PFIFO before changing the clocks v2

Martin Peres martin.peres at ensi-bourges.fr
Thu Sep 30 11:57:48 PDT 2010


Signed-off-by: Martin Peres <martin.peres at ensi-bourges.fr>
---
 drivers/gpu/drm/nouveau/nouveau_pm.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 1c99c55..fb3681c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -68,11 +68,30 @@ nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl)
 		}
 	}
 
+	/* Pause the engines, if possible */
+	if (dev_priv->engine.fifo.pause) {
+		if (dev_priv->engine.fifo.pause(dev))
+			return -EIO;
+	}
+	if (dev_priv->engine.graph.pause) {
+		if (dev_priv->engine.graph.pause(dev))
+			return -EIO;
+	}
+
 	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);
 
+	/* Wait for PLLs to stabilize */
+	udelay(100);
+
+	/* Un-pause the engines, if possible */
+	if (dev_priv->engine.fifo.unpause)
+		dev_priv->engine.fifo.unpause(dev);
+	if (dev_priv->engine.graph.unpause)
+		dev_priv->engine.graph.unpause(dev);
+
 	pm->cur = perflvl;
 	return 0;
 }
-- 
1.7.2


--------------060107090404080201010405--


More information about the Nouveau mailing list