X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fnouveau%2Fnv10_state_fb.c;h=63f5f74ff5a956ebe248a404000e56d3304a435b;hb=8c94c7138ec11daa2d9459b77cedc64ddd93eb02;hp=f9f3ebaa8d0a1c42e15259ee24bbc0e394855884;hpb=e2acc7be2683fd3c295480724b02f5a497309cfd;p=mesa.git diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c index f9f3ebaa8d0..63f5f74ff5a 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c @@ -27,7 +27,8 @@ #include "nouveau_driver.h" #include "nouveau_context.h" #include "nouveau_fbo.h" -#include "nouveau_class.h" +#include "nv_object.xml.h" +#include "nv10_3d.xml.h" #include "nouveau_util.h" #include "nv10_driver.h" @@ -51,11 +52,11 @@ get_rt_format(gl_format format) } static void -setup_lma_buffer(GLcontext *ctx) +setup_hierz_buffer(struct gl_context *ctx) { struct nouveau_channel *chan = context_chan(ctx); struct nouveau_grobj *celsius = context_eng3d(ctx); - struct nouveau_bo_context *bctx = context_bctx(ctx, LMA_DEPTH); + struct nouveau_bo_context *bctx = context_bctx(ctx, HIERZ); struct gl_framebuffer *fb = ctx->DrawBuffer; struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(fb); unsigned pitch = align(fb->Width, 128), @@ -64,36 +65,36 @@ setup_lma_buffer(GLcontext *ctx) if (!nfb->hierz.bo || nfb->hierz.bo->size != size) { nouveau_bo_ref(NULL, &nfb->hierz.bo); - nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_VRAM, 0, size, - &nfb->hierz.bo); + nouveau_bo_new_tile(context_dev(ctx), NOUVEAU_BO_VRAM, 0, size, + 0, NOUVEAU_BO_TILE_ZETA, &nfb->hierz.bo); } - nouveau_bo_markl(bctx, celsius, NV17TCL_LMA_DEPTH_BUFFER_OFFSET, + nouveau_bo_markl(bctx, celsius, NV17_3D_HIERZ_OFFSET, nfb->hierz.bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR); WAIT_RING(chan, 9); - BEGIN_RING(chan, celsius, NV17TCL_LMA_DEPTH_WINDOW_X, 4); + BEGIN_RING(chan, celsius, NV17_3D_HIERZ_WINDOW_X, 4); OUT_RINGf(chan, - 1792); OUT_RINGf(chan, - 2304 + fb->Height); OUT_RINGf(chan, fb->_DepthMaxF / 2); OUT_RINGf(chan, 0); - BEGIN_RING(chan, celsius, NV17TCL_LMA_DEPTH_BUFFER_PITCH, 1); + BEGIN_RING(chan, celsius, NV17_3D_HIERZ_PITCH, 1); OUT_RING(chan, pitch); - BEGIN_RING(chan, celsius, NV17TCL_LMA_DEPTH_ENABLE, 1); + BEGIN_RING(chan, celsius, NV17_3D_HIERZ_ENABLE, 1); OUT_RING(chan, 1); } void -nv10_emit_framebuffer(GLcontext *ctx, int emit) +nv10_emit_framebuffer(struct gl_context *ctx, int emit) { struct nouveau_channel *chan = context_chan(ctx); struct nouveau_grobj *celsius = context_eng3d(ctx); struct nouveau_bo_context *bctx = context_bctx(ctx, FRAMEBUFFER); struct gl_framebuffer *fb = ctx->DrawBuffer; struct nouveau_surface *s; - unsigned rt_format = NV10TCL_RT_FORMAT_TYPE_LINEAR; + unsigned rt_format = NV10_3D_RT_FORMAT_TYPE_LINEAR; unsigned rt_pitch = 0, zeta_pitch = 0; unsigned bo_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR; @@ -106,7 +107,7 @@ nv10_emit_framebuffer(GLcontext *ctx, int emit) int i; for (i = 0; i < 6; i++) { - BEGIN_RING(chan, celsius, NV10TCL_NOP, 1); + BEGIN_RING(chan, celsius, NV04_GRAPH_NOP, 1); OUT_RING(chan, 0); } } @@ -119,7 +120,7 @@ nv10_emit_framebuffer(GLcontext *ctx, int emit) rt_format |= get_rt_format(s->format); zeta_pitch = rt_pitch = s->pitch; - nouveau_bo_markl(bctx, celsius, NV10TCL_COLOR_OFFSET, + nouveau_bo_markl(bctx, celsius, NV10_3D_COLOR_OFFSET, s->bo, 0, bo_flags); } @@ -131,16 +132,16 @@ nv10_emit_framebuffer(GLcontext *ctx, int emit) rt_format |= get_rt_format(s->format); zeta_pitch = s->pitch; - nouveau_bo_markl(bctx, celsius, NV10TCL_ZETA_OFFSET, + nouveau_bo_markl(bctx, celsius, NV10_3D_ZETA_OFFSET, s->bo, 0, bo_flags); if (context_chipset(ctx) >= 0x17) { - setup_lma_buffer(ctx); + setup_hierz_buffer(ctx); context_dirty(ctx, ZCLEAR); } } - BEGIN_RING(chan, celsius, NV10TCL_RT_FORMAT, 2); + BEGIN_RING(chan, celsius, NV10_3D_RT_FORMAT, 2); OUT_RING(chan, rt_format); OUT_RING(chan, zeta_pitch << 16 | rt_pitch); @@ -149,12 +150,12 @@ nv10_emit_framebuffer(GLcontext *ctx, int emit) } void -nv10_emit_render_mode(GLcontext *ctx, int emit) +nv10_emit_render_mode(struct gl_context *ctx, int emit) { } void -nv10_emit_scissor(GLcontext *ctx, int emit) +nv10_emit_scissor(struct gl_context *ctx, int emit) { struct nouveau_channel *chan = context_chan(ctx); struct nouveau_grobj *celsius = context_eng3d(ctx); @@ -162,13 +163,13 @@ nv10_emit_scissor(GLcontext *ctx, int emit) get_scissors(ctx->DrawBuffer, &x, &y, &w, &h); - BEGIN_RING(chan, celsius, NV10TCL_RT_HORIZ, 2); + BEGIN_RING(chan, celsius, NV10_3D_RT_HORIZ, 2); OUT_RING(chan, w << 16 | x); OUT_RING(chan, h << 16 | y); } void -nv10_emit_viewport(GLcontext *ctx, int emit) +nv10_emit_viewport(struct gl_context *ctx, int emit) { struct nouveau_channel *chan = context_chan(ctx); struct nouveau_grobj *celsius = context_eng3d(ctx); @@ -182,19 +183,19 @@ nv10_emit_viewport(GLcontext *ctx, int emit) if (nv10_use_viewport_zclear(ctx)) a[2] = nv10_transform_depth(ctx, (vp->Far + vp->Near) / 2); - BEGIN_RING(chan, celsius, NV10TCL_VIEWPORT_TRANSLATE_X, 4); + BEGIN_RING(chan, celsius, NV10_3D_VIEWPORT_TRANSLATE_X, 4); OUT_RINGp(chan, a, 4); - BEGIN_RING(chan, celsius, NV10TCL_VIEWPORT_CLIP_HORIZ(0), 1); + BEGIN_RING(chan, celsius, NV10_3D_VIEWPORT_CLIP_HORIZ(0), 1); OUT_RING(chan, (fb->Width - 1) << 16 | 0x08000800); - BEGIN_RING(chan, celsius, NV10TCL_VIEWPORT_CLIP_VERT(0), 1); + BEGIN_RING(chan, celsius, NV10_3D_VIEWPORT_CLIP_VERT(0), 1); OUT_RING(chan, (fb->Height - 1) << 16 | 0x08000800); context_dirty(ctx, PROJECTION); } void -nv10_emit_zclear(GLcontext *ctx, int emit) +nv10_emit_zclear(struct gl_context *ctx, int emit) { struct nouveau_context *nctx = to_nouveau_context(ctx); struct nouveau_channel *chan = context_chan(ctx); @@ -203,12 +204,12 @@ nv10_emit_zclear(GLcontext *ctx, int emit) to_nouveau_framebuffer(ctx->DrawBuffer); if (nfb->hierz.bo) { - BEGIN_RING(chan, celsius, NV17TCL_ZCLEAR_ENABLE, 2); + BEGIN_RING(chan, celsius, NV17_3D_ZCLEAR_ENABLE, 2); OUT_RING(chan, nctx->hierz.clear_blocked ? 0 : 1); OUT_RING(chan, nfb->hierz.clear_value | (nctx->hierz.clear_seq & 0xff)); } else { - BEGIN_RING(chan, celsius, NV10TCL_DEPTH_RANGE_NEAR, 2); + BEGIN_RING(chan, celsius, NV10_3D_DEPTH_RANGE_NEAR, 2); OUT_RINGf(chan, nv10_transform_depth(ctx, 0)); OUT_RINGf(chan, nv10_transform_depth(ctx, 1)); context_dirty(ctx, VIEWPORT);