68 context = nv_gpuobj(
object)->addr >> 4;
72 switch (nv_engidx(object->
engine)) {
75 context |= 0x00000000;
78 context |= 0x00010000;
81 context |= 0x00020000;
87 context |= 0x80000000;
88 context |= chid << 24;
124 if (size <
sizeof(*args))
132 *pobject = nv_object(chan);
143 nv_wo32(priv->
ramfc, chan->
ramfc + 0x08, chan->
base.pushgpu->addr >> 4);
163 }
while ((++c)->
bits);
183 spin_unlock_irqrestore(&priv->
base.lock, flags);
204 if (chid == chan->
base.chid) {
214 u32 cv = (nv_ro32(fctx, c->
ctxp + data) & ~cm);
215 nv_wo32(fctx, c->
ctxp + data, cv | (rv << c->
ctxs));
216 }
while ((++c)->
bits);
220 nv_wr32(priv, c->
regp, 0x00000000);
221 }
while ((++c)->
bits);
233 spin_unlock_irqrestore(&priv->
base.lock, flags);
240 .ctor = nv04_fifo_chan_ctor,
249 nv04_fifo_sclass[] = {
269 *pobject = nv_object(base);
317 nv_warn(priv,
"timeout idling puller\n");
331 unsigned long flags = *pflags;
336 spin_unlock_irqrestore(&priv->
base.lock, flags);
342 static const char *
const desc[] = {
343 "NONE",
"CALL_SUBR_ACTIVE",
"INVALID_MTHD",
"RET_SUBR_INACTIVE",
344 "INVALID_CMD",
"IB_EMPTY",
"MEM_FAULT",
"UNK"
346 return desc[(state >> 29) & 0x7];
354 const int subc = (addr >> 13) & 0x7;
355 const int mthd = addr & 0x1ffc;
356 bool handled =
false;
362 chan = (
void *)priv->
base.channel[chid];
373 engine = 0x0000000f << (subc * 4);
384 if (
unlikely(((engine >> (subc * 4)) & 0xf) != 0))
389 if (!nv_call(bind->
object, mthd, data))
397 spin_unlock_irqrestore(&priv->
base.lock, flags);
428 ptr = (
get & 0x7ff) >> 2;
442 if (!nv04_fifo_swmthd(priv, chid, mthd, data)) {
443 nv_info(priv,
"CACHE_ERROR - Ch %d/%d "
444 "Mthd 0x%04x Data 0x%08x\n",
445 chid, (mthd >> 13) & 7, mthd & 0x1ffc,
451 NV_PFIFO_INTR_CACHE_ERROR);
464 status &= ~NV_PFIFO_INTR_CACHE_ERROR;
468 u32 dma_get = nv_rd32(priv, 0x003244);
469 u32 dma_put = nv_rd32(priv, 0x003240);
470 u32 push = nv_rd32(priv, 0x003220);
471 u32 state = nv_rd32(priv, 0x003228);
474 u32 ho_get = nv_rd32(priv, 0x003328);
475 u32 ho_put = nv_rd32(priv, 0x003320);
476 u32 ib_get = nv_rd32(priv, 0x003334);
477 u32 ib_put = nv_rd32(priv, 0x003330);
479 nv_info(priv,
"DMA_PUSHER - Ch %d Get 0x%02x%08x "
480 "Put 0x%02x%08x IbGet 0x%08x IbPut 0x%08x "
481 "State 0x%08x (err: %s) Push 0x%08x\n",
482 chid, ho_get, dma_get, ho_put,
483 dma_put, ib_get, ib_put, state,
484 nv_dma_state_err(state),
488 nv_wr32(priv, 0x003364, 0x00000000);
489 if (dma_get != dma_put || ho_get != ho_put) {
490 nv_wr32(priv, 0x003244, dma_put);
491 nv_wr32(priv, 0x003328, ho_put);
493 if (ib_get != ib_put) {
494 nv_wr32(priv, 0x003334, ib_put);
497 nv_info(priv,
"DMA_PUSHER - Ch %d Get 0x%08x "
498 "Put 0x%08x State 0x%08x (err: %s) Push 0x%08x\n",
499 chid, dma_get, dma_put, state,
500 nv_dma_state_err(state), push);
502 if (dma_get != dma_put)
503 nv_wr32(priv, 0x003244, dma_put);
506 nv_wr32(priv, 0x003228, 0x00000000);
507 nv_wr32(priv, 0x003220, 0x00000001);
508 nv_wr32(priv, 0x002100, NV_PFIFO_INTR_DMA_PUSHER);
509 status &= ~NV_PFIFO_INTR_DMA_PUSHER;
515 status &= ~NV_PFIFO_INTR_SEMAPHORE;
517 NV_PFIFO_INTR_SEMAPHORE);
527 if (status & 0x00000010) {
529 status &= ~0x00000010;
530 nv_wr32(priv, 0x002100, 0x00000010);
535 nv_info(priv,
"unknown intr 0x%08x, ch %d\n",
545 nv_info(priv,
"still angry after %d spins, halt\n", cnt);
546 nv_wr32(priv, 0x002140, 0);
547 nv_wr32(priv, 0x000140, 0);
550 nv_wr32(priv, 0x000100, 0x00000100);
563 *pobject = nv_object(priv);
568 nouveau_gpuobj_ref(imem->
ramro, &priv->
ramro);
569 nouveau_gpuobj_ref(imem->
ramfc, &priv->
ramfc);
571 nv_subdev(priv)->unit = 0x00000100;
573 nv_engine(priv)->cclass = &nv04_fifo_cclass;
574 nv_engine(priv)->sclass = nv04_fifo_sclass;
605 ((priv->
ramht->bits - 9) << 16) |
606 (priv->
ramht->base.addr >> 8));
625 .ctor = nv04_fifo_ctor,