aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_fifo.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-07-07 21:29:10 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-12 20:13:40 -0400
commitf56cb86f9abd229418f894a8ffedfb9ff465c181 (patch)
treeb29420af53d096e49ff573790c6161ed71599858 /drivers/gpu/drm/nouveau/nv50_fifo.c
parent2107cce3056dccf37ae5cbfc95df348959b2c717 (diff)
drm/nouveau: add instmem flush() hook
This removes the previous prepare_access() and finish_access() hooks, and replaces it with a much simpler flush() hook. All the chipset-specific code before nv50 has its use removed completely, as it's not required there at all. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_fifo.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_fifo.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_fifo.c b/drivers/gpu/drm/nouveau/nv50_fifo.c
index e20c0e2474f3..d2d4fd0044f8 100644
--- a/drivers/gpu/drm/nouveau/nv50_fifo.c
+++ b/drivers/gpu/drm/nouveau/nv50_fifo.c
@@ -49,12 +49,11 @@ nv50_fifo_init_thingo(struct drm_device *dev)
49 priv->cur_thingo = !priv->cur_thingo; 49 priv->cur_thingo = !priv->cur_thingo;
50 50
51 /* We never schedule channel 0 or 127 */ 51 /* We never schedule channel 0 or 127 */
52 dev_priv->engine.instmem.prepare_access(dev, true);
53 for (i = 1, nr = 0; i < 127; i++) { 52 for (i = 1, nr = 0; i < 127; i++) {
54 if (dev_priv->fifos[i] && dev_priv->fifos[i]->ramfc) 53 if (dev_priv->fifos[i] && dev_priv->fifos[i]->ramfc)
55 nv_wo32(dev, cur->gpuobj, nr++, i); 54 nv_wo32(dev, cur->gpuobj, nr++, i);
56 } 55 }
57 dev_priv->engine.instmem.finish_access(dev); 56 dev_priv->engine.instmem.flush(dev);
58 57
59 nv_wr32(dev, 0x32f4, cur->instance >> 12); 58 nv_wr32(dev, 0x32f4, cur->instance >> 12);
60 nv_wr32(dev, 0x32ec, nr); 59 nv_wr32(dev, 0x32ec, nr);
@@ -281,8 +280,6 @@ nv50_fifo_create_context(struct nouveau_channel *chan)
281 280
282 spin_lock_irqsave(&dev_priv->context_switch_lock, flags); 281 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
283 282
284 dev_priv->engine.instmem.prepare_access(dev, true);
285
286 nv_wo32(dev, ramfc, 0x48/4, chan->pushbuf->instance >> 4); 283 nv_wo32(dev, ramfc, 0x48/4, chan->pushbuf->instance >> 4);
287 nv_wo32(dev, ramfc, 0x80/4, (0xc << 24) | (chan->ramht->instance >> 4)); 284 nv_wo32(dev, ramfc, 0x80/4, (0xc << 24) | (chan->ramht->instance >> 4));
288 nv_wo32(dev, ramfc, 0x44/4, 0x2101ffff); 285 nv_wo32(dev, ramfc, 0x44/4, 0x2101ffff);
@@ -304,7 +301,7 @@ nv50_fifo_create_context(struct nouveau_channel *chan)
304 nv_wo32(dev, ramfc, 0x98/4, chan->ramin->instance >> 12); 301 nv_wo32(dev, ramfc, 0x98/4, chan->ramin->instance >> 12);
305 } 302 }
306 303
307 dev_priv->engine.instmem.finish_access(dev); 304 dev_priv->engine.instmem.flush(dev);
308 305
309 ret = nv50_fifo_channel_enable(dev, chan->id, false); 306 ret = nv50_fifo_channel_enable(dev, chan->id, false);
310 if (ret) { 307 if (ret) {
@@ -349,8 +346,6 @@ nv50_fifo_load_context(struct nouveau_channel *chan)
349 346
350 NV_DEBUG(dev, "ch%d\n", chan->id); 347 NV_DEBUG(dev, "ch%d\n", chan->id);
351 348
352 dev_priv->engine.instmem.prepare_access(dev, false);
353
354 nv_wr32(dev, 0x3330, nv_ro32(dev, ramfc, 0x00/4)); 349 nv_wr32(dev, 0x3330, nv_ro32(dev, ramfc, 0x00/4));
355 nv_wr32(dev, 0x3334, nv_ro32(dev, ramfc, 0x04/4)); 350 nv_wr32(dev, 0x3334, nv_ro32(dev, ramfc, 0x04/4));
356 nv_wr32(dev, 0x3240, nv_ro32(dev, ramfc, 0x08/4)); 351 nv_wr32(dev, 0x3240, nv_ro32(dev, ramfc, 0x08/4));
@@ -404,8 +399,6 @@ nv50_fifo_load_context(struct nouveau_channel *chan)
404 nv_wr32(dev, 0x3410, nv_ro32(dev, ramfc, 0x98/4)); 399 nv_wr32(dev, 0x3410, nv_ro32(dev, ramfc, 0x98/4));
405 } 400 }
406 401
407 dev_priv->engine.instmem.finish_access(dev);
408
409 nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, chan->id | (1<<16)); 402 nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, chan->id | (1<<16));
410 return 0; 403 return 0;
411} 404}
@@ -434,8 +427,6 @@ nv50_fifo_unload_context(struct drm_device *dev)
434 ramfc = chan->ramfc->gpuobj; 427 ramfc = chan->ramfc->gpuobj;
435 cache = chan->cache->gpuobj; 428 cache = chan->cache->gpuobj;
436 429
437 dev_priv->engine.instmem.prepare_access(dev, true);
438
439 nv_wo32(dev, ramfc, 0x00/4, nv_rd32(dev, 0x3330)); 430 nv_wo32(dev, ramfc, 0x00/4, nv_rd32(dev, 0x3330));
440 nv_wo32(dev, ramfc, 0x04/4, nv_rd32(dev, 0x3334)); 431 nv_wo32(dev, ramfc, 0x04/4, nv_rd32(dev, 0x3334));
441 nv_wo32(dev, ramfc, 0x08/4, nv_rd32(dev, 0x3240)); 432 nv_wo32(dev, ramfc, 0x08/4, nv_rd32(dev, 0x3240));
@@ -491,7 +482,7 @@ nv50_fifo_unload_context(struct drm_device *dev)
491 nv_wo32(dev, ramfc, 0x98/4, nv_rd32(dev, 0x3410)); 482 nv_wo32(dev, ramfc, 0x98/4, nv_rd32(dev, 0x3410));
492 } 483 }
493 484
494 dev_priv->engine.instmem.finish_access(dev); 485 dev_priv->engine.instmem.flush(dev);
495 486
496 /*XXX: probably reload ch127 (NULL) state back too */ 487 /*XXX: probably reload ch127 (NULL) state back too */
497 nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, 127); 488 nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, 127);