summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv10_state_fb.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state_fb.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
index 0fda9faf49..0505547421 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
@@ -27,8 +27,9 @@
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_fbo.h"
-#include "nouveau_class.h"
#include "nouveau_util.h"
+#include "nv_object.xml.h"
+#include "nv10_3d.xml.h"
#include "nv10_driver.h"
static inline unsigned
@@ -36,15 +37,15 @@ get_rt_format(gl_format format)
{
switch (format) {
case MESA_FORMAT_XRGB8888:
- return 0x05;
+ return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8;
case MESA_FORMAT_ARGB8888:
- return 0x08;
+ return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
- return 0x03;
+ return NV10_3D_RT_FORMAT_COLOR_R5G6B5;
case MESA_FORMAT_Z16:
- return 0x10;
+ return NV10_3D_RT_FORMAT_DEPTH_Z16;
case MESA_FORMAT_Z24_S8:
- return 0x0;
+ return NV10_3D_RT_FORMAT_DEPTH_Z24S8;
default:
assert(0);
}
@@ -68,20 +69,20 @@ setup_hierz_buffer(struct gl_context *ctx)
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);
}
@@ -93,7 +94,7 @@ nv10_emit_framebuffer(struct gl_context *ctx, int emit)
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(struct gl_context *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(struct gl_context *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,7 +132,7 @@ nv10_emit_framebuffer(struct gl_context *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) {
@@ -140,7 +141,7 @@ nv10_emit_framebuffer(struct gl_context *ctx, int emit)
}
}
- 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);
@@ -162,7 +163,7 @@ nv10_emit_scissor(struct gl_context *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);
}
@@ -182,12 +183,12 @@ nv10_emit_viewport(struct gl_context *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);
@@ -203,12 +204,12 @@ nv10_emit_zclear(struct gl_context *ctx, int emit)
to_nouveau_framebuffer(ctx->DrawBuffer);
if (nfb->hierz.bo) {
- BEGIN_RING(chan, celsius, NV17TCL_ZCLEAR_ENABLE, 2);
- OUT_RING(chan, nctx->hierz.clear_blocked ? 0 : 1);
+ BEGIN_RING(chan, celsius, NV17_3D_ZCLEAR_ENABLE, 2);
+ OUT_RINGb(chan, !nctx->hierz.clear_blocked);
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);