Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293742
b: refs/heads/master
c: e495d0d
h: refs/heads/master
v: v3
  • Loading branch information
Ben Skeggs committed Mar 13, 2012
1 parent 6c26028 commit 4c47a23
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6bdf68c9a427220692ad7607858e96caa2cd3147
refs/heads/master: e495d0d7e36298f76336fdc58685ac4cacd454ba
23 changes: 23 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nv50_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,29 @@ nv50_sor_nr(struct drm_device *dev)
return 4;
}

u32
nv50_display_active_crtcs(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
u32 mask = 0;
int i;

if (dev_priv->chipset < 0x90 ||
dev_priv->chipset == 0x92 ||
dev_priv->chipset == 0xa0) {
for (i = 0; i < 2; i++)
mask |= nv_rd32(dev, NV50_PDISPLAY_SOR_MODE_CTRL_C(i));
} else {
for (i = 0; i < 4; i++)
mask |= nv_rd32(dev, NV90_PDISPLAY_SOR_MODE_CTRL_C(i));
}

for (i = 0; i < 3; i++)
mask |= nv_rd32(dev, NV50_PDISPLAY_DAC_MODE_CTRL_C(i));

return mask & 3;
}

static int
evo_icmd(struct drm_device *dev, int ch, u32 mthd, u32 data)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nv50_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ void nv50_display_destroy(struct drm_device *dev);
int nv50_crtc_blank(struct nouveau_crtc *, bool blank);
int nv50_crtc_set_clock(struct drm_device *, int head, int pclk);

u32 nv50_display_active_crtcs(struct drm_device *);

int nv50_display_sync(struct drm_device *);
int nv50_display_flip_next(struct drm_crtc *, struct drm_framebuffer *,
struct nouveau_channel *chan);
Expand Down
11 changes: 3 additions & 8 deletions trunk/drivers/gpu/drm/nouveau/nv50_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "nouveau_hw.h"
#include "nouveau_pm.h"
#include "nouveau_hwsq.h"
#include "nv50_display.h"

enum clk_src {
clk_src_crystal,
Expand Down Expand Up @@ -535,6 +536,7 @@ calc_mclk(struct drm_device *dev, struct nouveau_pm_level *perflvl,
struct nv50_pm_state *info)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
u32 crtc_mask = nv50_display_active_crtcs(dev);
struct nouveau_mem_exec_func exec = {
.dev = dev,
.precharge = mclk_precharge,
Expand All @@ -550,9 +552,8 @@ calc_mclk(struct drm_device *dev, struct nouveau_pm_level *perflvl,
};
struct hwsq_ucode *hwsq = &info->mclk_hwsq;
struct pll_lims pll;
u32 crtc_mask = 0;
int N, M, P;
int ret, i;
int ret;

/* use pcie refclock if possible, otherwise use mpll */
info->mctrl = nv_rd32(dev, 0x004008);
Expand All @@ -569,12 +570,6 @@ calc_mclk(struct drm_device *dev, struct nouveau_pm_level *perflvl,
info->mcoef = (N << 8) | M;
}

/* determine active crtcs */
for (i = 0; i < 2; i++) {
if (nv_rd32(dev, NV50_PDISPLAY_CRTC_C(i, CLOCK)))
crtc_mask |= (1 << i);
}

/* build the ucode which will reclock the memory for us */
hwsq_init(hwsq);
if (crtc_mask) {
Expand Down

0 comments on commit 4c47a23

Please sign in to comment.