aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2010-02-12 15:34:33 +1000
committerBen Skeggs <[email protected]>2010-02-12 16:03:20 +1000
commitba3c874f08b6388a12e2f659d87cf0fb72f41e92 (patch)
treed5303f4aa10b02923319bca3c164105d3f398e98 /src
parent6af75a0ff47acfe1e51c93637045affb770f00ab (diff)
nouveau: use AVAIL_RING()
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nv30/nv30_vbo.c10
-rw-r--r--src/gallium/drivers/nv40/nv40_draw.c5
-rw-r--r--src/gallium/drivers/nv40/nv40_vbo.c10
-rw-r--r--src/gallium/drivers/nv50/nv50_transfer.c4
4 files changed, 14 insertions, 15 deletions
diff --git a/src/gallium/drivers/nv30/nv30_vbo.c b/src/gallium/drivers/nv30/nv30_vbo.c
index a83ddf11546..f406fa0c1d6 100644
--- a/src/gallium/drivers/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nv30/nv30_vbo.c
@@ -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);
diff --git a/src/gallium/drivers/nv40/nv40_draw.c b/src/gallium/drivers/nv40/nv40_draw.c
index 60ab49fad1c..48bd84d16c5 100644
--- a/src/gallium/drivers/nv40/nv40_draw.c
+++ b/src/gallium/drivers/nv40/nv40_draw.c
@@ -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;
diff --git a/src/gallium/drivers/nv40/nv40_vbo.c b/src/gallium/drivers/nv40/nv40_vbo.c
index 1e14edc56a7..f2048eb8693 100644
--- a/src/gallium/drivers/nv40/nv40_vbo.c
+++ b/src/gallium/drivers/nv40/nv40_vbo.c
@@ -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);
diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c
index d08b4d7354c..7c360e9e73a 100644
--- a/src/gallium/drivers/nv50/nv50_transfer.c
+++ b/src/gallium/drivers/nv50/nv50_transfer.c
@@ -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);