diff options
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv10_render.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_render.c | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_render.c b/src/mesa/drivers/dri/nouveau/nv10_render.c index 6134650346d..701ba9a87a8 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_render.c +++ b/src/mesa/drivers/dri/nouveau/nv10_render.c @@ -109,8 +109,7 @@ static void nv10_render_set_format(struct gl_context *ctx) { struct nouveau_render_state *render = to_render_state(ctx); - struct nouveau_channel *chan = context_chan(ctx); - struct nouveau_grobj *celsius = context_eng3d(ctx); + struct nouveau_pushbuf *push = context_push(ctx); int i, attr, hw_format; FOR_EACH_ATTR(render, i, attr) { @@ -128,8 +127,8 @@ nv10_render_set_format(struct gl_context *ctx) hw_format = NV10_3D_VTXBUF_FMT_TYPE_V32_FLOAT; } - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_FMT(i), 1); - OUT_RING(chan, hw_format); + BEGIN_NV04(push, NV10_3D(VTXBUF_FMT(i)), 1); + PUSH_DATA (push, hw_format); } } @@ -137,59 +136,63 @@ static void nv10_render_bind_vertices(struct gl_context *ctx) { struct nouveau_render_state *render = to_render_state(ctx); - struct nouveau_bo_context *bctx = context_bctx(ctx, VERTEX); - struct nouveau_grobj *celsius = context_eng3d(ctx); + struct nouveau_pushbuf *push = context_push(ctx); int i, attr; FOR_EACH_BOUND_ATTR(render, i, attr) { struct nouveau_array *a = &render->attrs[attr]; - nouveau_bo_markl(bctx, celsius, - NV10_3D_VTXBUF_OFFSET(i), - a->bo, a->offset, - NOUVEAU_BO_GART | NOUVEAU_BO_RD); + BEGIN_NV04(push, NV10_3D(VTXBUF_OFFSET(i)), 1); + PUSH_MTHDl(push, NV10_3D(VTXBUF_OFFSET(i)), BUFCTX_VTX, + a->bo, a->offset, NOUVEAU_BO_GART | + NOUVEAU_BO_RD); } } +static void +nv10_render_release_vertices(struct gl_context *ctx) +{ + PUSH_RESET(context_push(ctx), BUFCTX_VTX); +} + /* Vertex array rendering defs. */ -#define RENDER_LOCALS(ctx) \ - struct nouveau_grobj *celsius = context_eng3d(ctx) +#define RENDER_LOCALS(ctx) #define BATCH_VALIDATE() \ - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_VALIDATE, 1); \ - OUT_RING(chan, 0) + BEGIN_NV04(push, NV10_3D(VTXBUF_VALIDATE), 1); \ + PUSH_DATA (push, 0) #define BATCH_BEGIN(prim) \ - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_BEGIN_END, 1); \ - OUT_RING(chan, prim) + BEGIN_NV04(push, NV10_3D(VTXBUF_BEGIN_END), 1); \ + PUSH_DATA (push, prim) #define BATCH_END() \ - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_BEGIN_END, 1); \ - OUT_RING(chan, 0) + BEGIN_NV04(push, NV10_3D(VTXBUF_BEGIN_END), 1); \ + PUSH_DATA (push, 0) #define MAX_PACKET 0x400 #define MAX_OUT_L 0x100 #define BATCH_PACKET_L(n) \ - BEGIN_RING_NI(chan, celsius, NV10_3D_VTXBUF_BATCH, n) + BEGIN_NI04(push, NV10_3D(VTXBUF_BATCH), n) #define BATCH_OUT_L(i, n) \ - OUT_RING(chan, ((n) - 1) << 24 | (i)) + PUSH_DATA (push, ((n) - 1) << 24 | (i)) #define MAX_OUT_I16 0x2 #define BATCH_PACKET_I16(n) \ - BEGIN_RING_NI(chan, celsius, NV10_3D_VTXBUF_ELEMENT_U16, n) + BEGIN_NI04(push, NV10_3D(VTXBUF_ELEMENT_U16), n) #define BATCH_OUT_I16(i0, i1) \ - OUT_RING(chan, (i1) << 16 | (i0)) + PUSH_DATA (push, (i1) << 16 | (i0)) #define MAX_OUT_I32 0x1 #define BATCH_PACKET_I32(n) \ - BEGIN_RING_NI(chan, celsius, NV10_3D_VTXBUF_ELEMENT_U32, n) + BEGIN_NI04(push, NV10_3D(VTXBUF_ELEMENT_U32), n) #define BATCH_OUT_I32(i) \ - OUT_RING(chan, i) + PUSH_DATA (push, i) #define IMM_PACKET(m, n) \ - BEGIN_RING(chan, celsius, m, n) + BEGIN_NV04(push, SUBC_3D(m), n) #define IMM_OUT(x) \ - OUT_RINGf(chan, x) + PUSH_DATAf(push, x) #define TAG(x) nv10_##x #include "nouveau_render_t.c" |