summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/nv40/nv40_state_emit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/nv40/nv40_state_emit.c')
-rw-r--r--src/mesa/pipe/nv40/nv40_state_emit.c70
1 files changed, 4 insertions, 66 deletions
diff --git a/src/mesa/pipe/nv40/nv40_state_emit.c b/src/mesa/pipe/nv40/nv40_state_emit.c
index 66b98d5fab..3a22cd4bd5 100644
--- a/src/mesa/pipe/nv40/nv40_state_emit.c
+++ b/src/mesa/pipe/nv40/nv40_state_emit.c
@@ -11,77 +11,15 @@
static void
nv40_state_emit_dummy_relocs(struct nv40_context *nv40)
{
- unsigned rt_flags, tx_flags, fp_flags;
- int i;
+ unsigned i;
- rt_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR | NOUVEAU_BO_DUMMY;
- tx_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD |
- NOUVEAU_BO_DUMMY;
- fp_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD |
- NOUVEAU_BO_DUMMY;
-
- /* Render targets */
- if (nv40->rt_enable & NV40TCL_RT_ENABLE_COLOR0) {
- OUT_RELOCm(nv40->rt[0], rt_flags,
- curie, NV40TCL_DMA_COLOR0, 1);
- OUT_RELOCo(nv40->rt[0], rt_flags);
- OUT_RELOCm(nv40->rt[0], rt_flags,
- curie, NV40TCL_COLOR0_OFFSET, 1);
- OUT_RELOCl(nv40->rt[0], 0, rt_flags);
- }
-
- if (nv40->rt_enable & NV40TCL_RT_ENABLE_COLOR1) {
- OUT_RELOCm(nv40->rt[1], rt_flags,
- curie, NV40TCL_DMA_COLOR1, 1);
- OUT_RELOCo(nv40->rt[1], rt_flags);
- OUT_RELOCm(nv40->rt[1], rt_flags,
- curie, NV40TCL_COLOR1_OFFSET, 1);
- OUT_RELOCl(nv40->rt[1], 0, rt_flags);
- }
-
- if (nv40->rt_enable & NV40TCL_RT_ENABLE_COLOR2) {
- OUT_RELOCm(nv40->rt[2], rt_flags,
- curie, NV40TCL_DMA_COLOR2, 1);
- OUT_RELOCo(nv40->rt[2], rt_flags);
- OUT_RELOCm(nv40->rt[2], rt_flags,
- curie, NV40TCL_COLOR2_OFFSET, 1);
- OUT_RELOCl(nv40->rt[2], 0, rt_flags);
- }
-
- if (nv40->rt_enable & NV40TCL_RT_ENABLE_COLOR3) {
- OUT_RELOCm(nv40->rt[3], rt_flags,
- curie, NV40TCL_DMA_COLOR3, 1);
- OUT_RELOCo(nv40->rt[3], rt_flags);
- OUT_RELOCm(nv40->rt[3], rt_flags,
- curie, NV40TCL_COLOR3_OFFSET, 1);
- OUT_RELOCl(nv40->rt[3], 0, rt_flags);
- }
-
- if (nv40->zeta) {
- OUT_RELOCm(nv40->zeta, rt_flags, curie, NV40TCL_DMA_ZETA, 1);
- OUT_RELOCo(nv40->zeta, rt_flags);
- OUT_RELOCm(nv40->zeta, rt_flags, curie, NV40TCL_ZETA_OFFSET, 1);
- OUT_RELOCl(nv40->zeta, 0, rt_flags);
- }
-
- /* Texture images */
+ so_emit_reloc_markers(nv40->nvws, nv40->so_framebuffer);
for (i = 0; i < 16; i++) {
if (!(nv40->fp_samplers & (1 << i)))
continue;
- OUT_RELOCm(nv40->tex[i].buffer, tx_flags,
- curie, NV40TCL_TEX_OFFSET(i), 2);
- OUT_RELOCl(nv40->tex[i].buffer, 0, tx_flags);
- OUT_RELOCd(nv40->tex[i].buffer, nv40->tex[i].format,
- tx_flags | NOUVEAU_BO_OR, NV40TCL_TEX_FORMAT_DMA0,
- NV40TCL_TEX_FORMAT_DMA1);
+ so_emit_reloc_markers(nv40->nvws, nv40->so_fragtex[i]);
}
-
- /* Fragment program */
- OUT_RELOCm(nv40->fragprog.active->buffer, fp_flags,
- curie, NV40TCL_FP_ADDRESS, 1);
- OUT_RELOC (nv40->fragprog.active->buffer, 0,
- fp_flags | NOUVEAU_BO_OR | NOUVEAU_BO_LOW,
- NV40TCL_FP_ADDRESS_DMA0, NV40TCL_FP_ADDRESS_DMA1);
+ so_emit_reloc_markers(nv40->nvws, nv40->fragprog.active->so);
}
void