summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-06-04 16:13:56 +1000
committerBen Skeggs <bskeggs@redhat.com>2009-06-05 14:37:00 +1000
commit072fdc1fd325256d87b182d4f55c8a5838119cf0 (patch)
treeef37ba017f2b825c234bb706db7f245892c82b3c /src/gallium/drivers/nv30
parent04cef8a03799aa88ebfa1c391e29f8d2ea020d95 (diff)
nouveau: pass nouveau_bo instead of pipe_buffer to so_ calls
Diffstat (limited to 'src/gallium/drivers/nv30')
-rw-r--r--src/gallium/drivers/nv30/nv30_context.h2
-rw-r--r--src/gallium/drivers/nv30/nv30_fragprog.c7
-rw-r--r--src/gallium/drivers/nv30/nv30_fragtex.c7
-rw-r--r--src/gallium/drivers/nv30/nv30_state_fb.c30
-rw-r--r--src/gallium/drivers/nv30/nv30_vbo.c14
5 files changed, 33 insertions, 27 deletions
diff --git a/src/gallium/drivers/nv30/nv30_context.h b/src/gallium/drivers/nv30/nv30_context.h
index 4229c0a0e1..5ba474cc33 100644
--- a/src/gallium/drivers/nv30/nv30_context.h
+++ b/src/gallium/drivers/nv30/nv30_context.h
@@ -19,6 +19,8 @@
#include "nouveau/nouveau_push.h"
#include "nouveau/nouveau_stateobj.h"
+#define nouveau_bo(pb) nv30->screen->nvws->get_bo(pb)
+
#include "nv30_state.h"
#define NOUVEAU_ERR(fmt, args...) \
diff --git a/src/gallium/drivers/nv30/nv30_fragprog.c b/src/gallium/drivers/nv30/nv30_fragprog.c
index bdfe1425d2..956b450726 100644
--- a/src/gallium/drivers/nv30/nv30_fragprog.c
+++ b/src/gallium/drivers/nv30/nv30_fragprog.c
@@ -855,9 +855,10 @@ nv30_fragprog_validate(struct nv30_context *nv30)
so = so_new(8, 1);
so_method(so, nv30->screen->rankine, NV34TCL_FP_ACTIVE_PROGRAM, 1);
- so_reloc (so, fp->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART |
- NOUVEAU_BO_RD | NOUVEAU_BO_LOW | NOUVEAU_BO_OR,
- NV34TCL_FP_ACTIVE_PROGRAM_DMA0, NV34TCL_FP_ACTIVE_PROGRAM_DMA1);
+ so_reloc (so, nouveau_bo(fp->buffer), 0, NOUVEAU_BO_VRAM |
+ NOUVEAU_BO_GART | NOUVEAU_BO_RD | NOUVEAU_BO_LOW |
+ NOUVEAU_BO_OR, NV34TCL_FP_ACTIVE_PROGRAM_DMA0,
+ NV34TCL_FP_ACTIVE_PROGRAM_DMA1);
so_method(so, nv30->screen->rankine, NV34TCL_FP_CONTROL, 1);
so_data (so, fp->fp_control);
so_method(so, nv30->screen->rankine, NV34TCL_FP_REG_CONTROL, 1);
diff --git a/src/gallium/drivers/nv30/nv30_fragtex.c b/src/gallium/drivers/nv30/nv30_fragtex.c
index 8b6ab992d1..822e1d8def 100644
--- a/src/gallium/drivers/nv30/nv30_fragtex.c
+++ b/src/gallium/drivers/nv30/nv30_fragtex.c
@@ -61,6 +61,7 @@ nv30_fragtex_build(struct nv30_context *nv30, int unit)
struct nv30_sampler_state *ps = nv30->tex_sampler[unit];
struct nv30_miptree *nv30mt = nv30->tex_miptree[unit];
struct pipe_texture *pt = &nv30mt->base;
+ struct nouveau_bo *bo = nouveau_bo(nv30mt->buffer);
struct nv30_texture_format *tf;
struct nouveau_stateobj *so;
uint32_t txf, txs , txp;
@@ -106,9 +107,9 @@ nv30_fragtex_build(struct nv30_context *nv30, int unit)
so = so_new(16, 2);
so_method(so, nv30->screen->rankine, NV34TCL_TX_OFFSET(unit), 8);
- so_reloc (so, nv30mt->buffer, 0, tex_flags | NOUVEAU_BO_LOW, 0, 0);
- so_reloc (so, nv30mt->buffer, txf, tex_flags | NOUVEAU_BO_OR,
- NV34TCL_TX_FORMAT_DMA0, NV34TCL_TX_FORMAT_DMA1);
+ so_reloc (so, bo, 0, tex_flags | NOUVEAU_BO_LOW, 0, 0);
+ so_reloc (so, bo, txf, tex_flags | NOUVEAU_BO_OR,
+ NV34TCL_TX_FORMAT_DMA0, NV34TCL_TX_FORMAT_DMA1);
so_data (so, ps->wrap);
so_data (so, NV34TCL_TX_ENABLE_ENABLE | ps->en);
so_data (so, txs);
diff --git a/src/gallium/drivers/nv30/nv30_state_fb.c b/src/gallium/drivers/nv30/nv30_state_fb.c
index fdc1cade90..1be916872f 100644
--- a/src/gallium/drivers/nv30/nv30_state_fb.c
+++ b/src/gallium/drivers/nv30/nv30_state_fb.c
@@ -80,36 +80,36 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
nv30mt = (struct nv30_miptree *)rt[0]->base.texture;
so_method(so, nv30->screen->rankine, NV34TCL_DMA_COLOR0, 1);
- so_reloc (so, nv30mt->buffer, 0, rt_flags | NOUVEAU_BO_OR,
- nv30->nvws->channel->vram->handle,
- nv30->nvws->channel->gart->handle);
+ so_reloc (so, nouveau_bo(nv30mt->buffer), 0, rt_flags | NOUVEAU_BO_OR,
+ nv30->nvws->channel->vram->handle,
+ nv30->nvws->channel->gart->handle);
so_method(so, nv30->screen->rankine, NV34TCL_COLOR0_PITCH, 2);
so_data (so, pitch);
- so_reloc (so, nv30mt->buffer, rt[0]->base.offset, rt_flags |
- NOUVEAU_BO_LOW, 0, 0);
+ so_reloc (so, nouveau_bo(nv30mt->buffer), rt[0]->base.offset,
+ rt_flags | NOUVEAU_BO_LOW, 0, 0);
}
if (rt_enable & NV34TCL_RT_ENABLE_COLOR1) {
nv30mt = (struct nv30_miptree *)rt[1]->base.texture;
so_method(so, nv30->screen->rankine, NV34TCL_DMA_COLOR1, 1);
- so_reloc (so, nv30mt->buffer, 0, rt_flags | NOUVEAU_BO_OR,
- nv30->nvws->channel->vram->handle,
- nv30->nvws->channel->gart->handle);
+ so_reloc (so, nouveau_bo(nv30mt->buffer), 0, rt_flags | NOUVEAU_BO_OR,
+ nv30->nvws->channel->vram->handle,
+ nv30->nvws->channel->gart->handle);
so_method(so, nv30->screen->rankine, NV34TCL_COLOR1_OFFSET, 2);
- so_reloc (so, nv30mt->buffer, rt[1]->base.offset, rt_flags |
- NOUVEAU_BO_LOW, 0, 0);
+ so_reloc (so, nouveau_bo(nv30mt->buffer), rt[1]->base.offset,
+ rt_flags | NOUVEAU_BO_LOW, 0, 0);
so_data (so, rt[1]->pitch);
}
if (zeta_format) {
nv30mt = (struct nv30_miptree *)zeta->base.texture;
so_method(so, nv30->screen->rankine, NV34TCL_DMA_ZETA, 1);
- so_reloc (so, nv30mt->buffer, 0, rt_flags | NOUVEAU_BO_OR,
- nv30->nvws->channel->vram->handle,
- nv30->nvws->channel->gart->handle);
+ so_reloc (so, nouveau_bo(nv30mt->buffer), 0, rt_flags | NOUVEAU_BO_OR,
+ nv30->nvws->channel->vram->handle,
+ nv30->nvws->channel->gart->handle);
so_method(so, nv30->screen->rankine, NV34TCL_ZETA_OFFSET, 1);
- so_reloc (so, nv30mt->buffer, zeta->base.offset, rt_flags |
- NOUVEAU_BO_LOW, 0, 0);
+ so_reloc (so, nouveau_bo(nv30mt->buffer), zeta->base.offset,
+ rt_flags | NOUVEAU_BO_LOW, 0, 0);
/* TODO: allocate LMA depth buffer */
}
diff --git a/src/gallium/drivers/nv30/nv30_vbo.c b/src/gallium/drivers/nv30/nv30_vbo.c
index 990a876382..b7d8c2e008 100644
--- a/src/gallium/drivers/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nv30/nv30_vbo.c
@@ -521,18 +521,20 @@ nv30_vbo_validate(struct nv30_context *nv30)
return FALSE;
}
- so_reloc(vtxbuf, vb->buffer, vb->buffer_offset + ve->src_offset,
- vb_flags | NOUVEAU_BO_LOW | NOUVEAU_BO_OR,
- 0, NV34TCL_VTXBUF_ADDRESS_DMA1);
+ so_reloc(vtxbuf, nouveau_bo(vb->buffer), vb->buffer_offset +
+ ve->src_offset, vb_flags | NOUVEAU_BO_LOW |
+ NOUVEAU_BO_OR, 0, NV34TCL_VTXBUF_ADDRESS_DMA1);
so_data (vtxfmt, ((vb->stride << NV34TCL_VTXFMT_STRIDE_SHIFT) |
(ncomp << NV34TCL_VTXFMT_SIZE_SHIFT) | type));
}
if (ib) {
+ struct nouveau_bo *bo = nouveau_bo(ib);
+
so_method(vtxbuf, rankine, NV34TCL_IDXBUF_ADDRESS, 2);
- so_reloc (vtxbuf, ib, 0, vb_flags | NOUVEAU_BO_LOW, 0, 0);
- so_reloc (vtxbuf, ib, ib_format, vb_flags | NOUVEAU_BO_OR,
- 0, NV34TCL_IDXBUF_FORMAT_DMA1);
+ so_reloc (vtxbuf, bo, 0, vb_flags | NOUVEAU_BO_LOW, 0, 0);
+ so_reloc (vtxbuf, bo, ib_format, vb_flags | NOUVEAU_BO_OR,
+ 0, NV34TCL_IDXBUF_FORMAT_DMA1);
}
so_method(vtxbuf, rankine, 0x1710, 1);