diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-01-22 22:22:58 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-03-13 03:08:29 -0400 |
commit | e495d0d7e36298f76336fdc58685ac4cacd454ba (patch) | |
tree | 7c04015fc79f0fffa3e4bf4f62d5740d383c2e5b /drivers/gpu/drm/nouveau/nv50_pm.c | |
parent | 6bdf68c9a427220692ad7607858e96caa2cd3147 (diff) |
drm/nv50/disp: more accurate function to determine active crtcs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_pm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_pm.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_pm.c b/drivers/gpu/drm/nouveau/nv50_pm.c index 17eb3277b1a..109e473fd5f 100644 --- a/drivers/gpu/drm/nouveau/nv50_pm.c +++ b/drivers/gpu/drm/nouveau/nv50_pm.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "nouveau_hw.h" | 28 | #include "nouveau_hw.h" |
29 | #include "nouveau_pm.h" | 29 | #include "nouveau_pm.h" |
30 | #include "nouveau_hwsq.h" | 30 | #include "nouveau_hwsq.h" |
31 | #include "nv50_display.h" | ||
31 | 32 | ||
32 | enum clk_src { | 33 | enum clk_src { |
33 | clk_src_crystal, | 34 | clk_src_crystal, |
@@ -535,6 +536,7 @@ calc_mclk(struct drm_device *dev, struct nouveau_pm_level *perflvl, | |||
535 | struct nv50_pm_state *info) | 536 | struct nv50_pm_state *info) |
536 | { | 537 | { |
537 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 538 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
539 | u32 crtc_mask = nv50_display_active_crtcs(dev); | ||
538 | struct nouveau_mem_exec_func exec = { | 540 | struct nouveau_mem_exec_func exec = { |
539 | .dev = dev, | 541 | .dev = dev, |
540 | .precharge = mclk_precharge, | 542 | .precharge = mclk_precharge, |
@@ -550,9 +552,8 @@ calc_mclk(struct drm_device *dev, struct nouveau_pm_level *perflvl, | |||
550 | }; | 552 | }; |
551 | struct hwsq_ucode *hwsq = &info->mclk_hwsq; | 553 | struct hwsq_ucode *hwsq = &info->mclk_hwsq; |
552 | struct pll_lims pll; | 554 | struct pll_lims pll; |
553 | u32 crtc_mask = 0; | ||
554 | int N, M, P; | 555 | int N, M, P; |
555 | int ret, i; | 556 | int ret; |
556 | 557 | ||
557 | /* use pcie refclock if possible, otherwise use mpll */ | 558 | /* use pcie refclock if possible, otherwise use mpll */ |
558 | info->mctrl = nv_rd32(dev, 0x004008); | 559 | info->mctrl = nv_rd32(dev, 0x004008); |
@@ -569,12 +570,6 @@ calc_mclk(struct drm_device *dev, struct nouveau_pm_level *perflvl, | |||
569 | info->mcoef = (N << 8) | M; | 570 | info->mcoef = (N << 8) | M; |
570 | } | 571 | } |
571 | 572 | ||
572 | /* determine active crtcs */ | ||
573 | for (i = 0; i < 2; i++) { | ||
574 | if (nv_rd32(dev, NV50_PDISPLAY_CRTC_C(i, CLOCK))) | ||
575 | crtc_mask |= (1 << i); | ||
576 | } | ||
577 | |||
578 | /* build the ucode which will reclock the memory for us */ | 573 | /* build the ucode which will reclock the memory for us */ |
579 | hwsq_init(hwsq); | 574 | hwsq_init(hwsq); |
580 | if (crtc_mask) { | 575 | if (crtc_mask) { |