Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. static int
  2. nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl)
  3. {
  4. struct drm_nouveau_private *dev_priv = dev->dev_private;
  5. struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
  6. uint32_t status;
  7. int ret;
  8.  
  9. if (perflvl == pm->cur)
  10. return 0;
  11.  
  12. if (pm->voltage.supported && pm->voltage_set && perflvl->voltage) {
  13. ret = pm->voltage_set(dev, perflvl->voltage);
  14. if (ret) {
  15. NV_ERROR(dev, "voltage_set %d failed: %d\n",
  16. perflvl->voltage, ret);
  17. }
  18. }
  19.  
  20. /* TODO: Wait for vblank */
  21. /* Pause the engines, if possible */
  22. if (dev_priv->engine.fifo.pause(dev)) {
  23. ret = -EIO;
  24. goto out;
  25. }
  26. if (dev_priv->engine.graph.pause(dev)) {
  27. ret = -EIO;
  28. goto out;
  29. }
  30. /* Change the clocks */
  31. nouveau_pm_clock_set(dev, perflvl, PLL_CORE, perflvl->core);
  32. nouveau_pm_clock_set(dev, perflvl, PLL_SHADER, perflvl->shader);
  33. nouveau_pm_clock_set(dev, perflvl, PLL_MEMORY, perflvl->memory);
  34. nouveau_pm_clock_set(dev, perflvl, PLL_UNK05, perflvl->unk05);
  35.  
  36. /* Wait for PLLs to stabilize */
  37. udelay(100);
  38.  
  39. pm->cur = perflvl;
  40. ret = 0;
  41.  
  42. out:
  43. /* Un-pause the engines */
  44. dev_priv->engine.fifo.unpause(dev);
  45. dev_priv->engine.graph.unpause(dev);
  46.  
  47. return ret;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement