aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-07-04 21:01:13 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 02:06:01 -0400
commit4600522a8f93dda05e5fa8bd5261e6c6e888dafa (patch)
treeead383f51d148795fa1facb323f750897f4baeb7 /drivers/gpu
parent51beb428e4e0a158a47863cb68069ba57ed6ec7d (diff)
drm/nvd0/disp: start on interrupt handling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvd0_display.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c
index cd827cda64e4..10a44a1d44fc 100644
--- a/drivers/gpu/drm/nouveau/nvd0_display.c
+++ b/drivers/gpu/drm/nouveau/nvd0_display.c
@@ -100,6 +100,44 @@ evo_kick(u32 *push, struct drm_device *dev, int id)
100/****************************************************************************** 100/******************************************************************************
101 * IRQ 101 * IRQ
102 *****************************************************************************/ 102 *****************************************************************************/
103static void
104nvd0_display_intr(struct drm_device *dev)
105{
106 u32 intr = nv_rd32(dev, 0x610088);
107
108 if (intr & 0x00000002) {
109 u32 stat = nv_rd32(dev, 0x61009c);
110 int chid = ffs(stat) - 1;
111 if (chid >= 0) {
112 u32 mthd = nv_rd32(dev, 0x6101f0 + (chid * 12));
113 u32 data = nv_rd32(dev, 0x6101f4 + (chid * 12));
114 u32 unkn = nv_rd32(dev, 0x6101f8 + (chid * 12));
115
116 NV_INFO(dev, "EvoCh: chid %d mthd 0x%04x data 0x%08x "
117 "0x%08x 0x%08x\n",
118 chid, (mthd & 0x0000ffc), data, mthd, unkn);
119 nv_wr32(dev, 0x61009c, (1 << chid));
120 nv_wr32(dev, 0x6101f0 + (chid * 12), 0x90000000);
121 }
122
123 intr &= ~0x00000002;
124 }
125
126 if (intr & 0x01000000) {
127 u32 stat = nv_rd32(dev, 0x6100bc);
128 nv_wr32(dev, 0x6100bc, stat);
129 intr &= ~0x01000000;
130 }
131
132 if (intr & 0x02000000) {
133 u32 stat = nv_rd32(dev, 0x6108bc);
134 nv_wr32(dev, 0x6108bc, stat);
135 intr &= ~0x02000000;
136 }
137
138 if (intr)
139 NV_INFO(dev, "PDISP: unknown intr 0x%08x\n", intr);
140}
103 141
104/****************************************************************************** 142/******************************************************************************
105 * Init 143 * Init
@@ -190,6 +228,7 @@ nvd0_display_destroy(struct drm_device *dev)
190 228
191 pci_free_consistent(pdev, PAGE_SIZE, disp->evo[0].ptr, disp->evo[0].handle); 229 pci_free_consistent(pdev, PAGE_SIZE, disp->evo[0].ptr, disp->evo[0].handle);
192 nouveau_gpuobj_ref(NULL, &disp->mem); 230 nouveau_gpuobj_ref(NULL, &disp->mem);
231 nouveau_irq_unregister(dev, 26);
193 232
194 dev_priv->engine.display.priv = NULL; 233 dev_priv->engine.display.priv = NULL;
195 kfree(disp); 234 kfree(disp);
@@ -208,6 +247,9 @@ nvd0_display_create(struct drm_device *dev)
208 return -ENOMEM; 247 return -ENOMEM;
209 dev_priv->engine.display.priv = disp; 248 dev_priv->engine.display.priv = disp;
210 249
250 /* setup interrupt handling */
251 nouveau_irq_register(dev, 26, nvd0_display_intr);
252
211 /* hash table and dma objects for the memory areas we care about */ 253 /* hash table and dma objects for the memory areas we care about */
212 ret = nouveau_gpuobj_new(dev, NULL, 4 * 1024, 0x1000, 0, &disp->mem); 254 ret = nouveau_gpuobj_new(dev, NULL, 4 * 1024, 0x1000, 0, &disp->mem);
213 if (ret) 255 if (ret)