aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-07-05 00:16:05 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 02:06:24 -0400
commit270a5747802d4cf43b91b9e03cccb1fb5d5e8a34 (patch)
treef37959aa5f1c2965e27fd4557440983c762e6557 /drivers/gpu
parent83fc083cbbe0147519b1a62770171041c19e8752 (diff)
drm/nvd0/disp: skeletal handling of modeset interrupts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvd0_display.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c
index 3a2a4bb1276d..65e48f953d4c 100644
--- a/drivers/gpu/drm/nouveau/nvd0_display.c
+++ b/drivers/gpu/drm/nouveau/nvd0_display.c
@@ -269,6 +269,42 @@ nvd0_sor_create(struct drm_connector *connector, struct dcb_entry *dcbe)
269 * IRQ 269 * IRQ
270 *****************************************************************************/ 270 *****************************************************************************/
271static void 271static void
272nvd0_display_unk1_handler(struct drm_device *dev)
273{
274 u32 unk0 = nv_rd32(dev, 0x6101d0);
275
276 NV_INFO(dev, "PDISP: unk1 0x%08x\n", unk0);
277
278 nv_wr32(dev, 0x6101d4, 0x00000000);
279 nv_wr32(dev, 0x6109d4, 0x00000000);
280 nv_wr32(dev, 0x6101d0, 0x80000000);
281}
282
283static void
284nvd0_display_unk2_handler(struct drm_device *dev)
285{
286 u32 unk0 = nv_rd32(dev, 0x6101d0);
287
288 NV_INFO(dev, "PDISP: unk2 0x%08x\n", unk0);
289
290 nv_wr32(dev, 0x6101d4, 0x00000000);
291 nv_wr32(dev, 0x6109d4, 0x00000000);
292 nv_wr32(dev, 0x6101d0, 0x80000000);
293}
294
295static void
296nvd0_display_unk4_handler(struct drm_device *dev)
297{
298 u32 unk0 = nv_rd32(dev, 0x6101d0);
299
300 NV_INFO(dev, "PDISP: unk4 0x%08x\n", unk0);
301
302 nv_wr32(dev, 0x6101d4, 0x00000000);
303 nv_wr32(dev, 0x6109d4, 0x00000000);
304 nv_wr32(dev, 0x6101d0, 0x80000000);
305}
306
307static void
272nvd0_display_intr(struct drm_device *dev) 308nvd0_display_intr(struct drm_device *dev)
273{ 309{
274 u32 intr = nv_rd32(dev, 0x610088); 310 u32 intr = nv_rd32(dev, 0x610088);
@@ -291,6 +327,29 @@ nvd0_display_intr(struct drm_device *dev)
291 intr &= ~0x00000002; 327 intr &= ~0x00000002;
292 } 328 }
293 329
330 if (intr & 0x00100000) {
331 u32 stat = nv_rd32(dev, 0x6100ac);
332
333 if (stat & 0x00000007) {
334 nv_wr32(dev, 0x6100ac, (stat & 0x00000007));
335
336 if (stat & 0x00000001)
337 nvd0_display_unk1_handler(dev);
338 if (stat & 0x00000002)
339 nvd0_display_unk2_handler(dev);
340 if (stat & 0x00000004)
341 nvd0_display_unk4_handler(dev);
342 stat &= ~0x00000007;
343 }
344
345 if (stat) {
346 NV_INFO(dev, "PDISP: unknown intr24 0x%08x\n", stat);
347 nv_wr32(dev, 0x6100ac, stat);
348 }
349
350 intr &= ~0x00100000;
351 }
352
294 if (intr & 0x01000000) { 353 if (intr & 0x01000000) {
295 u32 stat = nv_rd32(dev, 0x6100bc); 354 u32 stat = nv_rd32(dev, 0x6100bc);
296 nv_wr32(dev, 0x6100bc, stat); 355 nv_wr32(dev, 0x6100bc, stat);
@@ -354,6 +413,7 @@ nvd0_display_init(struct drm_device *dev)
354 } 413 }
355 414
356 nv_wr32(dev, 0x610010, (disp->mem->vinst >> 8) | 9); 415 nv_wr32(dev, 0x610010, (disp->mem->vinst >> 8) | 9);
416 nv_mask(dev, 0x6100b0, 0x00000307, 0x00000307);
357 417
358 /* init master */ 418 /* init master */
359 nv_wr32(dev, 0x610494, (disp->evo[0].handle >> 8) | 3); 419 nv_wr32(dev, 0x610494, (disp->evo[0].handle >> 8) | 3);