summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_tex.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-03-03 11:45:08 +1000
committerBen Skeggs <bskeggs@redhat.com>2010-03-10 16:29:58 +1000
commitac2b35fd2d5008a39fa394b7b04fd29b899d3e55 (patch)
tree1c14c8b47753f34bba529f359ef560c88db3b8fa /src/gallium/drivers/nv50/nv50_tex.c
parent007f25b3bde88de550d6ddba6a96769e4f3d5ce7 (diff)
nv50: use relocs rather than re-uploading TIC all the time
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_tex.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_tex.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c
index de0560e20c..ed3440fcc1 100644
--- a/src/gallium/drivers/nv50/nv50_tex.c
+++ b/src/gallium/drivers/nv50/nv50_tex.c
@@ -24,6 +24,7 @@
#include "nv50_texture.h"
#include "nouveau/nouveau_stateobj.h"
+#include "nouveau/nouveau_reloc.h"
#include "util/u_format.h"
@@ -195,6 +196,35 @@ nv50_validate_textures(struct nv50_context *nv50, struct nouveau_stateobj *so,
}
void
+nv50_tex_relocs(struct nv50_context *nv50)
+{
+ struct nouveau_channel *chan = nv50->screen->tesla->channel;
+ int p, unit;
+
+ p = PIPE_SHADER_FRAGMENT;
+ for (unit = 0; unit < nv50->miptree_nr[p]; unit++) {
+ if (!nv50->miptree[p][unit])
+ continue;
+ nouveau_reloc_emit(chan, nv50->screen->tic,
+ ((p * 32) + unit) * 32, NULL,
+ nv50->miptree[p][unit]->base.bo, 0, 0,
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW |
+ NOUVEAU_BO_RD, 0, 0);
+ }
+
+ p = PIPE_SHADER_VERTEX;
+ for (unit = 0; unit < nv50->miptree_nr[p]; unit++) {
+ if (!nv50->miptree[p][unit])
+ continue;
+ nouveau_reloc_emit(chan, nv50->screen->tic,
+ ((p * 32) + unit) * 32, NULL,
+ nv50->miptree[p][unit]->base.bo, 0, 0,
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW |
+ NOUVEAU_BO_RD, 0, 0);
+ }
+}
+
+void
nv50_tex_validate(struct nv50_context *nv50)
{
struct nouveau_stateobj *so;