summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2013-06-17 18:47:21 +0200
committerChristoph Bumiller <[email protected]>2013-09-01 20:53:11 +0200
commit1048d89907b3a11e695b2c44d1966fb4e61b1b77 (patch)
tree2867f9f9ce65765ecd875814b5d202de0be70ed8 /src/gallium/drivers
parent528a48ee8da91d79614a877edf8583d063db6c36 (diff)
nvc0: don't use bufctx in nvc0_cb_push
Too many calls into libdrm when a single one is enough.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_transfer.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_transfer.c b/src/gallium/drivers/nvc0/nvc0_transfer.c
index 3f876622353..a0333a394a0 100644
--- a/src/gallium/drivers/nvc0/nvc0_transfer.c
+++ b/src/gallium/drivers/nvc0/nvc0_transfer.c
@@ -505,13 +505,13 @@ nvc0_miptree_transfer_unmap(struct pipe_context *pctx,
FREE(tx);
}
+/* This happens rather often with DTD9/st. */
void
nvc0_cb_push(struct nouveau_context *nv,
struct nouveau_bo *bo, unsigned domain,
unsigned base, unsigned size,
unsigned offset, unsigned words, const uint32_t *data)
{
- struct nouveau_bufctx *bctx = nvc0_context(&nv->pipe)->bufctx;
struct nouveau_pushbuf *push = nv->pushbuf;
NOUVEAU_DRV_STAT(nv->screen, constbuf_upload_count, 1);
@@ -520,10 +520,6 @@ nvc0_cb_push(struct nouveau_context *nv,
assert(!(offset & 3));
size = align(size, 0x100);
- nouveau_bufctx_refn(bctx, 0, bo, NOUVEAU_BO_WR | domain);
- nouveau_pushbuf_bufctx(push, bctx);
- nouveau_pushbuf_validate(push);
-
BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
PUSH_DATA (push, size);
PUSH_DATAh(push, bo->offset + base);
@@ -534,6 +530,8 @@ nvc0_cb_push(struct nouveau_context *nv,
nr = MIN2(nr, words);
nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN - 1);
+ PUSH_SPACE(push, nr + 2);
+ PUSH_REFN (push, bo, NOUVEAU_BO_WR | domain);
BEGIN_1IC0(push, NVC0_3D(CB_POS), nr + 1);
PUSH_DATA (push, offset);
PUSH_DATAp(push, data, nr);
@@ -542,8 +540,6 @@ nvc0_cb_push(struct nouveau_context *nv,
data += nr;
offset += nr * 4;
}
-
- nouveau_bufctx_reset(bctx, 0);
}
void