diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-09-03 01:46:58 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-09-24 02:24:38 -0400 |
commit | d96773e7b61d9976b8227e018a1c94fb7374e641 (patch) | |
tree | d0cbc60e4ebd8722b0f77d6e8008925dd20b027e /drivers/gpu/drm/nouveau/nv50_fb.c | |
parent | e69b4418825c2e4c6563ae1d69bd75377826e263 (diff) |
drm/nv50: move vm trap to nv50_fb.c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_fb.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_fb.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_fb.c b/drivers/gpu/drm/nouveau/nv50_fb.c index 32611bd30e6d..594720bd5191 100644 --- a/drivers/gpu/drm/nouveau/nv50_fb.c +++ b/drivers/gpu/drm/nouveau/nv50_fb.c | |||
@@ -36,3 +36,42 @@ void | |||
36 | nv50_fb_takedown(struct drm_device *dev) | 36 | nv50_fb_takedown(struct drm_device *dev) |
37 | { | 37 | { |
38 | } | 38 | } |
39 | |||
40 | void | ||
41 | nv50_fb_vm_trap(struct drm_device *dev, int display, const char *name) | ||
42 | { | ||
43 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
44 | u32 trap[6], idx, chinst; | ||
45 | int i, ch; | ||
46 | |||
47 | idx = nv_rd32(dev, 0x100c90); | ||
48 | if (!(idx & 0x80000000)) | ||
49 | return; | ||
50 | idx &= 0x00ffffff; | ||
51 | |||
52 | for (i = 0; i < 6; i++) { | ||
53 | nv_wr32(dev, 0x100c90, idx | i << 24); | ||
54 | trap[i] = nv_rd32(dev, 0x100c94); | ||
55 | } | ||
56 | nv_wr32(dev, 0x100c90, idx | 0x80000000); | ||
57 | |||
58 | if (!display) | ||
59 | return; | ||
60 | |||
61 | chinst = (trap[2] << 16) | trap[1]; | ||
62 | for (ch = 0; ch < dev_priv->engine.fifo.channels; ch++) { | ||
63 | struct nouveau_channel *chan = dev_priv->fifos[ch]; | ||
64 | |||
65 | if (!chan || !chan->ramin) | ||
66 | continue; | ||
67 | |||
68 | if (chinst == chan->ramin->vinst >> 12) | ||
69 | break; | ||
70 | } | ||
71 | |||
72 | NV_INFO(dev, "%s - VM: Trapped %s at %02x%04x%04x status %08x " | ||
73 | "channel %d (0x%08x)\n", | ||
74 | name, (trap[5] & 0x100 ? "read" : "write"), | ||
75 | trap[5] & 0xff, trap[4] & 0xffff, trap[3] & 0xffff, | ||
76 | trap[0], ch, chinst); | ||
77 | } | ||