summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/nouveau/nouveau_push.h
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-02-03 12:08:31 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-02-03 12:08:49 +1100
commitf87a8cace2ce946d969eb6d93def2d65cb541bda (patch)
tree732d3271d86cddc510bef8b5c181fce1a5f0b8a3 /src/mesa/pipe/nouveau/nouveau_push.h
parentedbeec2b9177fef27b5a04b7b9b975b8abf84367 (diff)
nouveau: avoid relocations where possible.
Potential relocations are emitted as NOPs where they're needed. In the event a buffer moves, the pushbuf code will emit the relevant state changes into the NOPs. Just a start, more work is needed to get this looking how I want it to.
Diffstat (limited to 'src/mesa/pipe/nouveau/nouveau_push.h')
-rw-r--r--src/mesa/pipe/nouveau/nouveau_push.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/pipe/nouveau/nouveau_push.h b/src/mesa/pipe/nouveau/nouveau_push.h
index 117e3535cf..679472669b 100644
--- a/src/mesa/pipe/nouveau/nouveau_push.h
+++ b/src/mesa/pipe/nouveau/nouveau_push.h
@@ -44,9 +44,8 @@
#define OUT_RELOC(bo,data,flags,vor,tor) do { \
NOUVEAU_PUSH_CONTEXT(pc); \
pc->nvws->push_reloc(pc->nvws->channel, \
- pc->nvws->channel->pushbuf->cur, \
+ pc->nvws->channel->pushbuf->cur++, \
(bo), (data), (flags), (vor), (tor)); \
- OUT_RING(0); \
} while(0)
/* Raw data + flags depending on FB/TT buffer */
@@ -71,4 +70,14 @@
OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_HIGH, 0, 0); \
} while(0)
+/* A reloc which'll recombine into a NV_DMA_METHOD packet header */
+#define OUT_RELOCm(bo, flags, obj, mthd, size) do { \
+ NOUVEAU_PUSH_CONTEXT(pc); \
+ if (pc->nvws->channel->pushbuf->remaining < ((size) + 1)) \
+ pc->nvws->push_flush(pc->nvws->channel, ((size) + 1)); \
+ OUT_RELOCd((bo), (pc->obj->subc << 13) | ((size) << 18) | (mthd), \
+ (flags), 0, 0); \
+ pc->nvws->channel->pushbuf->remaining -= ((size) + 1); \
+} while(0)
+
#endif