summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-02-03 12:08:31 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-02-15 13:50:29 +1100
commit705022f98c32c44b94411ea13dfe4cbc899f5a77 (patch)
treede1031e64b702e63faf0099c03bb520b3c5b00e0 /src/mesa/pipe/nouveau
parent8bbedc3f4b7b281a60286ba573077a6e3e659f63 (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')
-rw-r--r--src/mesa/pipe/nouveau/nouveau_bo.h1
-rw-r--r--src/mesa/pipe/nouveau/nouveau_push.h13
2 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/pipe/nouveau/nouveau_bo.h b/src/mesa/pipe/nouveau/nouveau_bo.h
index 2b57ee9263..18020e9c65 100644
--- a/src/mesa/pipe/nouveau/nouveau_bo.h
+++ b/src/mesa/pipe/nouveau/nouveau_bo.h
@@ -35,6 +35,7 @@
#define NOUVEAU_BO_HIGH (1 << 7)
#define NOUVEAU_BO_OR (1 << 8)
#define NOUVEAU_BO_LOCAL (1 << 9)
+#define NOUVEAU_BO_DUMMY (1 << 31)
struct nouveau_bo {
struct nouveau_device *device;
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