nouveau: pass nouveau_bo instead of pipe_buffer to so_ calls
[mesa.git] / src / gallium / drivers / nv40 / nv40_fragprog.c
index 428348c33888f896bd8830c833cf21a13de1fca5..b45dfaa913d26613636464a1b7a0d1d2c49397a3 100644 (file)
@@ -3,8 +3,8 @@
 #include "pipe/p_state.h"
 
 #include "pipe/p_shader_tokens.h"
-#include "tgsi/util/tgsi_parse.h"
-#include "tgsi/util/tgsi_util.h"
+#include "tgsi/tgsi_parse.h"
+#include "tgsi/tgsi_util.h"
 
 #include "nv40_context.h"
 
@@ -533,10 +533,10 @@ nv40_fragprog_parse_instruction(struct nv40_fpc *fpc,
        case TGSI_OPCODE_FRC:
                arith(fpc, sat, FRC, dst, mask, src[0], none, none);
                break;
-       case TGSI_OPCODE_KIL:
+       case TGSI_OPCODE_KILP:
                arith(fpc, 0, KIL, none, 0, none, none, none);
                break;
-       case TGSI_OPCODE_KILP:
+       case TGSI_OPCODE_KIL:
                dst = nv40_sr(NV40SR_NONE, 0);
                dst.cc_update = 1;
                arith(fpc, 0, MOV, dst, MASK_ALL, src[0], none, none);
@@ -917,6 +917,7 @@ nv40_fragprog_validate(struct nv40_context *nv40)
        struct nv40_fragment_program *fp = nv40->fragprog;
        struct pipe_buffer *constbuf =
                nv40->constbuf[PIPE_SHADER_FRAGMENT];
+       struct pipe_screen *screen = nv40->pipe.screen;
        struct pipe_winsys *ws = nv40->pipe.winsys;
        struct nouveau_stateobj *so;
        boolean new_consts = FALSE;
@@ -932,17 +933,19 @@ nv40_fragprog_validate(struct nv40_context *nv40)
                return FALSE;
        }
 
-       fp->buffer = ws->buffer_create(ws, 0x100, 0, fp->insn_len * 4);
+       fp->buffer = screen->buffer_create(screen, 0x100, 0, fp->insn_len * 4);
        nv40_fragprog_upload(nv40, fp);
 
        so = so_new(4, 1);
        so_method(so, nv40->screen->curie, NV40TCL_FP_ADDRESS, 1);
-       so_reloc (so, fp->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART |
-                 NOUVEAU_BO_RD | NOUVEAU_BO_LOW | NOUVEAU_BO_OR,
-                 NV40TCL_FP_ADDRESS_DMA0, NV40TCL_FP_ADDRESS_DMA1);
+       so_reloc (so, nouveau_bo(fp->buffer), 0, NOUVEAU_BO_VRAM |
+                     NOUVEAU_BO_GART | NOUVEAU_BO_RD | NOUVEAU_BO_LOW |
+                     NOUVEAU_BO_OR, NV40TCL_FP_ADDRESS_DMA0,
+                     NV40TCL_FP_ADDRESS_DMA1);
        so_method(so, nv40->screen->curie, NV40TCL_FP_CONTROL, 1);
        so_data  (so, fp->fp_control);
        so_ref(so, &fp->so);
+       so_ref(NULL, &so);
 
 update_constants:
        if (fp->nr_consts) {