diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2007-12-27 09:01:08 +1100 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2007-12-27 09:09:11 +1100 |
commit | 8ed3a69fc8f811c2010615af94a6bb8003c8a296 (patch) | |
tree | 71475a054347a8f38a4def4186cff60c84801488 /src/mesa/pipe | |
parent | dc6d73e1a47cfd7f4cb615e75d9f7f944efabf03 (diff) |
nouveau: remove legacy stuff
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r-- | src/mesa/pipe/nouveau/nouveau_winsys.h | 12 | ||||
-rw-r--r-- | src/mesa/pipe/nv40/nv40_context.h | 1 | ||||
-rw-r--r-- | src/mesa/pipe/nv40/nv40_dma.h | 34 | ||||
-rw-r--r-- | src/mesa/pipe/nv50/nv50_context.h | 1 | ||||
-rw-r--r-- | src/mesa/pipe/nv50/nv50_dma.h | 34 |
5 files changed, 43 insertions, 39 deletions
diff --git a/src/mesa/pipe/nouveau/nouveau_winsys.h b/src/mesa/pipe/nouveau/nouveau_winsys.h index 7b80027c3a..27c991077e 100644 --- a/src/mesa/pipe/nouveau/nouveau_winsys.h +++ b/src/mesa/pipe/nouveau/nouveau_winsys.h @@ -11,6 +11,7 @@ #include "pipe/nouveau/nouveau_grobj.h" #include "pipe/nouveau/nouveau_notifier.h" #include "pipe/nouveau/nouveau_resource.h" +#include "pipe/nouveau/nouveau_pushbuf.h" struct nouveau_winsys { struct nouveau_context *nv; @@ -23,13 +24,10 @@ struct nouveau_winsys { struct nouveau_resource **); void (*res_free)(struct nouveau_resource **); - /*XXX: this is crappy, and bound to be slow.. however, it's nice and - * simple, it'll do for the moment*/ - uint32_t *(*begin_ring)(struct nouveau_grobj *, int mthd, int size); - int (*out_reloc)(struct nouveau_channel *, void *ptr, - struct nouveau_bo *, uint32_t data, - uint32_t flags, uint32_t vor, uint32_t tor); - void (*fire_ring)(struct nouveau_channel *); + int (*push_reloc)(struct nouveau_channel *, void *ptr, + struct nouveau_bo *, uint32_t data, + uint32_t flags, uint32_t vor, uint32_t tor); + int (*push_flush)(struct nouveau_channel *, unsigned size); int (*grobj_alloc)(struct nouveau_winsys *, int grclass, struct nouveau_grobj **); diff --git a/src/mesa/pipe/nv40/nv40_context.h b/src/mesa/pipe/nv40/nv40_context.h index 5d0bf89680..934f68ef1a 100644 --- a/src/mesa/pipe/nv40/nv40_context.h +++ b/src/mesa/pipe/nv40/nv40_context.h @@ -31,7 +31,6 @@ struct nv40_context { int chipset; struct nouveau_grobj *curie; struct nouveau_notifier *sync; - uint32_t *pushbuf; /* query objects */ struct nouveau_notifier *query; diff --git a/src/mesa/pipe/nv40/nv40_dma.h b/src/mesa/pipe/nv40/nv40_dma.h index 3775ce6e72..1fb8267768 100644 --- a/src/mesa/pipe/nv40/nv40_dma.h +++ b/src/mesa/pipe/nv40/nv40_dma.h @@ -3,21 +3,13 @@ #include "pipe/nouveau/nouveau_winsys.h" -#define BEGIN_RING(obj,mthd,size) do { \ - nv40->pushbuf = nv40->nvws->begin_ring(nv40->obj, (mthd), (size)); \ -} while(0) - -#define BEGIN_RING_NI(obj,mthd,size) do { \ - BEGIN_RING(obj, (mthd) | 0x40000000, (size)); \ -} while(0) - #define OUT_RING(data) do { \ - (*nv40->pushbuf++) = (data); \ + (*nv40->nvws->channel->pushbuf->cur++) = (data); \ } while(0) #define OUT_RINGp(src,size) do { \ - memcpy(nv40->pushbuf, (src), (size) * 4); \ - nv40->pushbuf += (size); \ + memcpy(nv40->nvws->channel->pushbuf->cur, (src), (size) * 4); \ + nv40->nvws->channel->pushbuf->cur += (size); \ } while(0) #define OUT_RINGf(data) do { \ @@ -26,14 +18,26 @@ OUT_RING(c.u); \ } while(0) +#define BEGIN_RING(obj,mthd,size) do { \ + if (nv40->nvws->channel->pushbuf->remaining < ((size) + 1)) \ + nv40->nvws->push_flush(nv40->nvws->channel, ((size) + 1)); \ + OUT_RING((nv40->obj->subc << 13) | ((size) << 18) | (mthd)); \ + nv40->nvws->channel->pushbuf->remaining -= ((size) + 1); \ +} while(0) + +#define BEGIN_RING_NI(obj,mthd,size) do { \ + BEGIN_RING(obj, (mthd) | 0x40000000, (size)); \ +} while(0) + #define FIRE_RING() do { \ - nv40->nvws->fire_ring(nv40->nvws->channel); \ + nv40->nvws->push_flush(nv40->nvws->channel, 0); \ } while(0) #define OUT_RELOC(bo,data,flags,vor,tor) do { \ - nv40->nvws->out_reloc(nv40->nvws->channel, nv40->pushbuf, \ - (struct nouveau_bo *)(bo), \ - (data), (flags), (vor), (tor)); \ + nv40->nvws->push_reloc(nv40->nvws->channel, \ + nv40->nvws->channel->pushbuf->cur, \ + (struct nouveau_bo *)(bo), \ + (data), (flags), (vor), (tor)); \ OUT_RING(0); \ } while(0) diff --git a/src/mesa/pipe/nv50/nv50_context.h b/src/mesa/pipe/nv50/nv50_context.h index 5be4e5cb1b..b1c4d5b894 100644 --- a/src/mesa/pipe/nv50/nv50_context.h +++ b/src/mesa/pipe/nv50/nv50_context.h @@ -26,7 +26,6 @@ struct nv50_context { int chipset; struct nouveau_grobj *tesla; struct nouveau_notifier *sync; - uint32_t *pushbuf; }; diff --git a/src/mesa/pipe/nv50/nv50_dma.h b/src/mesa/pipe/nv50/nv50_dma.h index f8121b61cc..366316df75 100644 --- a/src/mesa/pipe/nv50/nv50_dma.h +++ b/src/mesa/pipe/nv50/nv50_dma.h @@ -3,21 +3,13 @@ #include "pipe/nouveau/nouveau_winsys.h" -#define BEGIN_RING(obj,mthd,size) do { \ - nv50->pushbuf = nv50->nvws->begin_ring(nv50->obj, (mthd), (size)); \ -} while(0) - -#define BEGIN_RING_NI(obj,mthd,size) do { \ - BEGIN_RING(obj, (mthd) | 0x40000000, (size)); \ -} while(0) - #define OUT_RING(data) do { \ - (*nv50->pushbuf++) = (data); \ + (*nv50->nvws->channel->pushbuf->cur++) = (data); \ } while(0) #define OUT_RINGp(src,size) do { \ - memcpy(nv50->pushbuf, (src), (size) * 4); \ - nv50->pushbuf += (size); \ + memcpy(nv50->nvws->channel->pushbuf->cur, (src), (size) * 4); \ + nv50->nvws->channel->pushbuf->cur += (size); \ } while(0) #define OUT_RINGf(data) do { \ @@ -26,14 +18,26 @@ OUT_RING(c.u); \ } while(0) +#define BEGIN_RING(obj,mthd,size) do { \ + if (nv50->nvws->channel->pushbuf->remaining < ((size) + 1)) \ + nv50->nvws->push_flush(nv50->nvws->channel, ((size) + 1)); \ + OUT_RING((nv50->obj->subc << 13) | ((size) << 18) | (mthd)); \ + nv50->nvws->channel->pushbuf->remaining -= ((size) + 1); \ +} while(0) + +#define BEGIN_RING_NI(obj,mthd,size) do { \ + BEGIN_RING(obj, (mthd) | 0x40000000, (size)); \ +} while(0) + #define FIRE_RING() do { \ - nv50->nvws->fire_ring(nv50->nvws->channel); \ + nv50->nvws->push_flush(nv50->nvws->channel, 0); \ } while(0) #define OUT_RELOC(bo,data,flags,vor,tor) do { \ - nv50->nvws->out_reloc(nv50->nvws->channel, nv50->pushbuf, \ - (struct nouveau_bo *)(bo), \ - (data), (flags), (vor), (tor)); \ + nv50->nvws->push_reloc(nv50->nvws->channel, \ + nv50->nvws->channel->pushbuf->cur, \ + (struct nouveau_bo *)(bo), \ + (data), (flags), (vor), (tor)); \ OUT_RING(0); \ } while(0) |