From 8ed3a69fc8f811c2010615af94a6bb8003c8a296 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 27 Dec 2007 09:01:08 +1100 Subject: nouveau: remove legacy stuff --- .../drivers/dri/nouveau_winsys/nouveau_context.h | 1 - .../drivers/dri/nouveau_winsys/nouveau_local.h | 31 ++++++++++++---------- .../drivers/dri/nouveau_winsys/nouveau_winsys.c | 29 ++------------------ 3 files changed, 19 insertions(+), 42 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h b/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h index f201001bd9..2fd3336065 100644 --- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_context.h @@ -31,7 +31,6 @@ struct nouveau_context { struct pipe_surface *frontbuffer; /* Hardware context */ - uint32_t *pushbuf; struct nouveau_channel *channel; struct nouveau_notifier *sync_notifier; struct nouveau_grobj *NvNull; diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_local.h b/src/mesa/drivers/dri/nouveau_winsys/nouveau_local.h index e7111de4dc..a53b699202 100644 --- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_local.h +++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_local.h @@ -24,21 +24,13 @@ #define NOUVEAU_DMA_TIMEOUT 2000 /* Push buffer access macros */ -#define BEGIN_RING(obj,mthd,size) do { \ - nv->pushbuf = nouveau_pipe_dma_beginp(nv->obj, (mthd), (size)); \ -} while(0) - -#define BEGIN_RING_GR(obj,mthd,size) do { \ - nv->pushbuf = nouveau_pipe_dma_beginp(obj, (mthd), (size)); \ -} while(0) - #define OUT_RING(data) do { \ - (*nv->pushbuf++) = (data); \ + (*nv->channel->pushbuf->cur++) = (data); \ } while(0) #define OUT_RINGp(src,size) do { \ - memcpy(nv->pushbuf, (src), (size)<<2); \ - nv->pushbuf += (size); \ + memcpy(nv->channel->pushbuf->cur, (src), (size)<<2); \ + nv->channel->pushbuf->cur += (size); \ } while(0) #define OUT_RINGf(data) do { \ @@ -48,7 +40,18 @@ } while(0) #define FIRE_RING() do { \ - nouveau_pipe_dma_kickoff(nv->channel); \ + nouveau_pushbuf_flush(nv->channel, 0); \ +} while(0) + +#define BEGIN_RING_GR(obj,mthd,size) do { \ + if (nv->channel->pushbuf->remaining < ((size) + 1)) \ + nouveau_pushbuf_flush(nv->channel, ((size) + 1)); \ + OUT_RING(((obj)->subc << 13) | ((size) << 18) | (mthd)); \ + nv->channel->pushbuf->remaining -= ((size) + 1); \ +} while(0) + +#define BEGIN_RING(obj,mthd,size) do { \ + BEGIN_RING_GR(nv->obj, (mthd), (size)); \ } while(0) #define BIND_RING(o,s) do { \ @@ -58,8 +61,8 @@ } while(0) #define OUT_RELOC(bo,data,flags,vor,tor) do { \ - nouveau_pushbuf_emit_reloc(nv->channel, nv->pushbuf, (void*)(bo), \ - (data), (flags), (vor), (tor)); \ + nouveau_pushbuf_emit_reloc(nv->channel, nv->channel->pushbuf->cur, \ + (void*)(bo), (data), (flags), (vor), (tor));\ OUT_RING(0); \ } while(0) diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c index 403647ab17..f5e4546100 100644 --- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c +++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c @@ -34,30 +34,6 @@ nouveau_pipe_grobj_alloc(struct nouveau_winsys *nvws, int grclass, return 0; } -uint32_t * -nouveau_pipe_dma_beginp(struct nouveau_grobj *grobj, int mthd, int size) -{ - struct nouveau_channel *chan = grobj->channel; - uint32_t *pushbuf; - - if (chan->pushbuf->remaining < (size + 1)) { - nouveau_pushbuf_flush(chan, size + 1); - } - - pushbuf = chan->pushbuf->cur; - chan->pushbuf->cur += (size + 1); - chan->pushbuf->remaining -= (size + 1); - - (*pushbuf++) = ((grobj->subc << 13) | (size << 18) | mthd); - return pushbuf; -} - -void -nouveau_pipe_dma_kickoff(struct nouveau_channel *chan) -{ - nouveau_pushbuf_flush(chan, 0); -} - static int nouveau_pipe_surface_copy(struct nouveau_winsys *nvws, struct pipe_surface *dst, unsigned dx, unsigned dy, struct pipe_surface *src, @@ -126,9 +102,8 @@ nouveau_pipe_create(struct nouveau_context *nv) nvws->res_alloc = nouveau_resource_alloc; nvws->res_free = nouveau_resource_free; - nvws->begin_ring = nouveau_pipe_dma_beginp; - nvws->out_reloc = nouveau_pushbuf_emit_reloc; - nvws->fire_ring = nouveau_pipe_dma_kickoff; + nvws->push_reloc = nouveau_pushbuf_emit_reloc; + nvws->push_flush = nouveau_pushbuf_flush; nvws->grobj_alloc = nouveau_pipe_grobj_alloc; nvws->grobj_free = nouveau_grobj_free; -- cgit v1.2.3