Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int
- nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl)
- {
- struct drm_nouveau_private *dev_priv = dev->dev_private;
- struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
- uint32_t status;
- int ret;
- if (perflvl == pm->cur)
- return 0;
- if (pm->voltage.supported && pm->voltage_set && perflvl->voltage) {
- ret = pm->voltage_set(dev, perflvl->voltage);
- if (ret) {
- NV_ERROR(dev, "voltage_set %d failed: %d\n",
- perflvl->voltage, ret);
- }
- }
- /* TODO: Wait for vblank */
- /* Pause the engines, if possible */
- if (dev_priv->engine.fifo.pause(dev)) {
- ret = -EIO;
- goto out;
- }
- if (dev_priv->engine.graph.pause(dev)) {
- ret = -EIO;
- goto out;
- }
- /* Change the clocks */
- 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);
- pm->cur = perflvl;
- ret = 0;
- out:
- /* Un-pause the engines */
- dev_priv->engine.fifo.unpause(dev);
- dev_priv->engine.graph.unpause(dev);
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement