From f87a8cace2ce946d969eb6d93def2d65cb541bda Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sun, 3 Feb 2008 12:08:31 +1100 Subject: 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. --- src/mesa/pipe/nouveau/nouveau_push.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/mesa/pipe/nouveau/nouveau_push.h') 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 -- cgit v1.2.3