nouveau: use AVAIL_RING()
authorBen Skeggs <bskeggs@redhat.com>
Fri, 12 Feb 2010 05:34:33 +0000 (15:34 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 12 Feb 2010 06:03:20 +0000 (16:03 +1000)
src/gallium/drivers/nv30/nv30_vbo.c
src/gallium/drivers/nv40/nv40_draw.c
src/gallium/drivers/nv40/nv40_vbo.c
src/gallium/drivers/nv50/nv50_transfer.c

index a83ddf11546dabf0554bfecb3ce50beae07116d6..f406fa0c1d616aaa81d4d60d098bbb898768456c 100644 (file)
@@ -185,7 +185,7 @@ nv30_draw_arrays(struct pipe_context *pipe,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
@@ -239,7 +239,7 @@ nv30_draw_elements_u08(struct nv30_context *nv30, void *ib,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -290,7 +290,7 @@ nv30_draw_elements_u16(struct nv30_context *nv30, void *ib,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -341,7 +341,7 @@ nv30_draw_elements_u32(struct nv30_context *nv30, void *ib,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 5, 1,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 5, 1,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -417,7 +417,7 @@ nv30_draw_elements_vbo(struct pipe_context *pipe,
 
                nv30_state_emit(nv30);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
index 60ab49fad1ceab569b71dbce48b3461e28dd7a1c..48bd84d16c5fbd416e7b4e4a5abe0d4ec75785b7 100644 (file)
@@ -88,12 +88,11 @@ nv40_render_prim(struct draw_stage *stage, struct prim_header *prim,
 
        struct nv40_screen *screen = nv40->screen;
        struct nouveau_channel *chan = screen->base.channel;
-       struct nouveau_pushbuf *pb = chan->pushbuf;
        struct nouveau_grobj *curie = screen->curie;
        unsigned i;
 
        /* Ensure there's room for 4xfloat32 + potentially 3 begin/end */
-       if (pb->remaining < ((count * 20) + 6)) {
+       if (AVAIL_RING(chan) < ((count * 20) + 6)) {
                if (rs->prim != NV40TCL_BEGIN_END_STOP) {
                        NOUVEAU_ERR("AIII, missed flush\n");
                        assert(0);
@@ -121,7 +120,7 @@ nv40_render_prim(struct draw_stage *stage, struct prim_header *prim,
        /* If it's likely we'll need to empty the push buffer soon, finish
         * off the primitive now.
         */
-       if (pb->remaining < ((count * 20) + 6)) {
+       if (AVAIL_RING(chan) < ((count * 20) + 6)) {
                BEGIN_RING(chan, curie, NV40TCL_BEGIN_END, 1);
                OUT_RING  (chan, NV40TCL_BEGIN_END_STOP);
                rs->prim = NV40TCL_BEGIN_END_STOP;
index 1e14edc56a7f96dcbd1a61032f7e2644b44c89c2..f2048eb8693b576f6bd1f756510395ac9f2da18d 100644 (file)
@@ -186,7 +186,7 @@ nv40_draw_arrays(struct pipe_context *pipe,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
@@ -240,7 +240,7 @@ nv40_draw_elements_u08(struct nv40_context *nv40, void *ib,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -291,7 +291,7 @@ nv40_draw_elements_u16(struct nv40_context *nv40, void *ib,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 2,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 2,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -342,7 +342,7 @@ nv40_draw_elements_u32(struct nv40_context *nv40, void *ib,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 5, 1,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 5, 1,
                                        mode, start, count, &restart);
                if (vc == 0) {
                        FIRE_RING(chan);
@@ -418,7 +418,7 @@ nv40_draw_elements_vbo(struct pipe_context *pipe,
 
                nv40_state_emit(nv40);
 
-               vc = nouveau_vbuf_split(chan->pushbuf->remaining, 6, 256,
+               vc = nouveau_vbuf_split(AVAIL_RING(chan), 6, 256,
                                        mode, start, count, &restart);
                if (!vc) {
                        FIRE_RING(chan);
index d08b4d7354ca219cff034f86aeabea047a8debb8..7c360e9e73a15a977b72e0951148102bca2de526 100644 (file)
@@ -313,7 +313,7 @@ nv50_upload_sifc(struct nv50_context *nv50,
                while (count) {
                        unsigned nr = MIN2(count, 1792);
 
-                       if (chan->pushbuf->remaining <= nr) {
+                       if (AVAIL_RING(chan) <= nr) {
                                FIRE_RING (chan);
 
                                BEGIN_RING(chan, eng2d,
@@ -321,7 +321,7 @@ nv50_upload_sifc(struct nv50_context *nv50,
                                OUT_RELOCh(chan, bo, dst_offset, reloc);
                                OUT_RELOCl(chan, bo, dst_offset, reloc);
                        }
-                       assert(chan->pushbuf->remaining > nr);
+                       assert(AVAIL_RING(chan) > nr);
 
                        BEGIN_RING(chan, eng2d,
                                   NV50_2D_SIFC_DATA | (2 << 29), nr);