aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_fb.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_fb.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_fb.c b/drivers/gpu/drm/nouveau/nv50_fb.c
index 32611bd30e6d..cd1988b15d2c 100644
--- a/drivers/gpu/drm/nouveau/nv50_fb.c
+++ b/drivers/gpu/drm/nouveau/nv50_fb.c
@@ -20,6 +20,7 @@ nv50_fb_init(struct drm_device *dev)
20 case 0x50: 20 case 0x50:
21 nv_wr32(dev, 0x100c90, 0x0707ff); 21 nv_wr32(dev, 0x100c90, 0x0707ff);
22 break; 22 break;
23 case 0xa3:
23 case 0xa5: 24 case 0xa5:
24 case 0xa8: 25 case 0xa8:
25 nv_wr32(dev, 0x100c90, 0x0d0fff); 26 nv_wr32(dev, 0x100c90, 0x0d0fff);
@@ -36,3 +37,42 @@ void
36nv50_fb_takedown(struct drm_device *dev) 37nv50_fb_takedown(struct drm_device *dev)
37{ 38{
38} 39}
40
41void
42nv50_fb_vm_trap(struct drm_device *dev, int display, const char *name)
43{
44 struct drm_nouveau_private *dev_priv = dev->dev_private;
45 u32 trap[6], idx, chinst;
46 int i, ch;
47
48 idx = nv_rd32(dev, 0x100c90);
49 if (!(idx & 0x80000000))
50 return;
51 idx &= 0x00ffffff;
52
53 for (i = 0; i < 6; i++) {
54 nv_wr32(dev, 0x100c90, idx | i << 24);
55 trap[i] = nv_rd32(dev, 0x100c94);
56 }
57 nv_wr32(dev, 0x100c90, idx | 0x80000000);
58
59 if (!display)
60 return;
61
62 chinst = (trap[2] << 16) | trap[1];
63 for (ch = 0; ch < dev_priv->engine.fifo.channels; ch++) {
64 struct nouveau_channel *chan = dev_priv->fifos[ch];
65
66 if (!chan || !chan->ramin)
67 continue;
68
69 if (chinst == chan->ramin->vinst >> 12)
70 break;
71 }
72
73 NV_INFO(dev, "%s - VM: Trapped %s at %02x%04x%04x status %08x "
74 "channel %d (0x%08x)\n",
75 name, (trap[5] & 0x100 ? "read" : "write"),
76 trap[5] & 0xff, trap[4] & 0xffff, trap[3] & 0xffff,
77 trap[0], ch, chinst);
78}