From 04cef8a03799aa88ebfa1c391e29f8d2ea020d95 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 4 Jun 2009 15:26:07 +1000 Subject: nouveau: call nouveau_pushbuf directly rather than going through nvws --- src/gallium/drivers/nouveau/nouveau_push.h | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/gallium/drivers/nouveau/nouveau_push.h') diff --git a/src/gallium/drivers/nouveau/nouveau_push.h b/src/gallium/drivers/nouveau/nouveau_push.h index 54ef1c1291..afe4668fcd 100644 --- a/src/gallium/drivers/nouveau/nouveau_push.h +++ b/src/gallium/drivers/nouveau/nouveau_push.h @@ -26,25 +26,36 @@ #define BEGIN_RING(obj,mthd,size) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - if (pc->nvws->channel->pushbuf->remaining < ((size) + 1)) \ - pc->nvws->push_flush(pc->nvws, ((size) + 1), NULL); \ + struct nouveau_channel *chan = pc->nvws->channel; \ + if (chan->pushbuf->remaining < ((size) + 1)) \ + nouveau_pushbuf_flush(chan, ((size) + 1)); \ OUT_RING((pc->obj->subc << 13) | ((size) << 18) | (mthd)); \ - pc->nvws->channel->pushbuf->remaining -= ((size) + 1); \ + chan->pushbuf->remaining -= ((size) + 1); \ } while(0) #define BEGIN_RING_NI(obj,mthd,size) do { \ BEGIN_RING(obj, (mthd) | 0x40000000, (size)); \ } while(0) +static inline void +DO_FIRE_RING(struct nouveau_channel *chan, struct pipe_fence_handle **fence) +{ + nouveau_pushbuf_flush(chan, 0); + if (fence) + *fence = NULL; +} + #define FIRE_RING(fence) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - pc->nvws->push_flush(pc->nvws, 0, fence); \ + DO_FIRE_RING(pc->nvws->channel, fence); \ } while(0) #define OUT_RELOC(bo,data,flags,vor,tor) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - pc->nvws->push_reloc(pc->nvws, pc->nvws->channel->pushbuf->cur++, \ - (bo), (data), (flags), (vor), (tor)); \ + struct nouveau_channel *chan = pc->nvws->channel; \ + nouveau_pushbuf_emit_reloc(chan, chan->pushbuf->cur++, \ + pc->nvws->get_bo(bo), \ + (data), (flags), (vor), (tor)); \ } while(0) /* Raw data + flags depending on FB/TT buffer */ @@ -72,11 +83,12 @@ /* 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), NULL); \ + struct nouveau_channel *chan = pc->nvws->channel; \ + if (chan->pushbuf->remaining < ((size) + 1)) \ + nouveau_pushbuf_flush(chan, ((size) + 1)); \ OUT_RELOCd((bo), (pc->obj->subc << 13) | ((size) << 18) | (mthd), \ (flags), 0, 0); \ - pc->nvws->channel->pushbuf->remaining -= ((size) + 1); \ + chan->pushbuf->remaining -= ((size) + 1); \ } while(0) #endif -- cgit v1.2.3 From 80e9e1ee8172d1e5a81d702681897dddd9d815f1 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 5 Jun 2009 10:28:13 +1000 Subject: nouveau: move channel creation into pipe drivers --- src/gallium/drivers/nouveau/nouveau_push.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/gallium/drivers/nouveau/nouveau_push.h') diff --git a/src/gallium/drivers/nouveau/nouveau_push.h b/src/gallium/drivers/nouveau/nouveau_push.h index afe4668fcd..0f2c42915b 100644 --- a/src/gallium/drivers/nouveau/nouveau_push.h +++ b/src/gallium/drivers/nouveau/nouveau_push.h @@ -9,13 +9,13 @@ #define OUT_RING(data) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - (*pc->nvws->channel->pushbuf->cur++) = (data); \ + (*pc->base.channel->pushbuf->cur++) = (data); \ } while(0) #define OUT_RINGp(src,size) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - memcpy(pc->nvws->channel->pushbuf->cur, (src), (size) * 4); \ - pc->nvws->channel->pushbuf->cur += (size); \ + memcpy(pc->base.channel->pushbuf->cur, (src), (size) * 4); \ + pc->base.channel->pushbuf->cur += (size); \ } while(0) #define OUT_RINGf(data) do { \ @@ -26,7 +26,7 @@ #define BEGIN_RING(obj,mthd,size) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - struct nouveau_channel *chan = pc->nvws->channel; \ + struct nouveau_channel *chan = pc->base.channel; \ if (chan->pushbuf->remaining < ((size) + 1)) \ nouveau_pushbuf_flush(chan, ((size) + 1)); \ OUT_RING((pc->obj->subc << 13) | ((size) << 18) | (mthd)); \ @@ -47,14 +47,13 @@ DO_FIRE_RING(struct nouveau_channel *chan, struct pipe_fence_handle **fence) #define FIRE_RING(fence) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - DO_FIRE_RING(pc->nvws->channel, fence); \ + DO_FIRE_RING(pc->base.channel, fence); \ } while(0) #define OUT_RELOC(bo,data,flags,vor,tor) do { \ NOUVEAU_PUSH_CONTEXT(pc); \ - struct nouveau_channel *chan = pc->nvws->channel; \ - nouveau_pushbuf_emit_reloc(chan, chan->pushbuf->cur++, \ - pc->nvws->get_bo(bo), \ + struct nouveau_channel *chan = pc->base.channel; \ + nouveau_pushbuf_emit_reloc(chan, chan->pushbuf->cur++, nouveau_bo(bo), \ (data), (flags), (vor), (tor)); \ } while(0) @@ -66,8 +65,8 @@ DO_FIRE_RING(struct nouveau_channel *chan, struct pipe_fence_handle **fence) /* FB/TT object handle */ #define OUT_RELOCo(bo,flags) do { \ OUT_RELOC((bo), 0, (flags) | NOUVEAU_BO_OR, \ - pc->nvws->channel->vram->handle, \ - pc->nvws->channel->gart->handle); \ + pc->base.channel->vram->handle, \ + pc->base.channel->gart->handle); \ } while(0) /* Low 32-bits of offset */ @@ -83,7 +82,7 @@ DO_FIRE_RING(struct nouveau_channel *chan, struct pipe_fence_handle **fence) /* 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); \ - struct nouveau_channel *chan = pc->nvws->channel; \ + struct nouveau_channel *chan = pc->base.channel; \ if (chan->pushbuf->remaining < ((size) + 1)) \ nouveau_pushbuf_flush(chan, ((size) + 1)); \ OUT_RELOCd((bo), (pc->obj->subc << 13) | ((size) << 18) | (mthd), \ -- cgit v1.2.3 From 40ed44991851a526f0e2cafd5dab6149cb7a3342 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 5 Jun 2009 12:27:42 +1000 Subject: nouveau: fix build with libdrm_nouveau 0.6 --- src/gallium/drivers/nouveau/nouveau_push.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers/nouveau/nouveau_push.h') diff --git a/src/gallium/drivers/nouveau/nouveau_push.h b/src/gallium/drivers/nouveau/nouveau_push.h index 0f2c42915b..9c235080a5 100644 --- a/src/gallium/drivers/nouveau/nouveau_push.h +++ b/src/gallium/drivers/nouveau/nouveau_push.h @@ -54,7 +54,7 @@ DO_FIRE_RING(struct nouveau_channel *chan, struct pipe_fence_handle **fence) NOUVEAU_PUSH_CONTEXT(pc); \ struct nouveau_channel *chan = pc->base.channel; \ nouveau_pushbuf_emit_reloc(chan, chan->pushbuf->cur++, nouveau_bo(bo), \ - (data), (flags), (vor), (tor)); \ + (data), 0, (flags), (vor), (tor)); \ } while(0) /* Raw data + flags depending on FB/TT buffer */ -- cgit v1.2.3