int
nvif_chan_gpfifo_wait(struct nvif_chan *chan, u32 gpfifo_nr, u32 push_nr)
{ struct nvif_push *push = &chan->push; int ret = 0, time = 1000000;
if (gpfifo_nr) { /* Account for pushbuf space needed by nvif_chan_gpfifo_post(), * if used after pushing userspace GPFIFO entries.
*/ if (chan->func->gpfifo.post)
push_nr += chan->func->gpfifo.post_size;
}
/* Account for the GPFIFO entry needed to submit pushbuf. */ if (push_nr)
gpfifo_nr++;
/* Wait for space in main push buffer. */ if (push->cur + push_nr > push->end) {
ret = nvif_chan_dma_wait(chan, push_nr); if (ret) return ret;
}
/* Wait for GPFIFO space. */ while (chan->gpfifo.free < gpfifo_nr) {
chan->gpfifo.free = chan->func->gpfifo.read_get(chan) - chan->gpfifo.cur - 1; if (chan->gpfifo.free < 0)
chan->gpfifo.free += chan->gpfifo.max + 1;
if (chan->gpfifo.free < gpfifo_nr) { if (!time--) return -ETIMEDOUT;
udelay(1);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.