summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-10-10 04:29:39 -0400
committerIlia Mirkin <[email protected]>2015-10-11 17:57:04 -0400
commit9fe458335ffd35366ef0f4b741aad0cdb3503783 (patch)
tree978bcbeafd13c3f84eef0bc7695c48ecb7a43bc3 /src/gallium/drivers/nouveau/nvc0
parent8053c9208f30964d89dc4e262fdf2148f0664696 (diff)
nv50,nvc0: don't base decisions on available pushbuf space
We still have to push everything out, might as well kick earlier and flip pushbufs when we know we'll need it. This resolves some issues with the new policy of making sure that we always leave a bit of room at the end for fences. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Fixes: 47d11990b (nouveau: make sure there's always room to emit a fence) Cc: [email protected]
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c b/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
index aaec60a5ac2..d459dd61c19 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
@@ -188,14 +188,10 @@ nvc0_m2mf_push_linear(struct nouveau_context *nv,
nouveau_pushbuf_validate(push);
while (count) {
- unsigned nr;
+ unsigned nr = MIN2(count, NV04_PFIFO_MAX_PACKET_LEN);
- if (!PUSH_SPACE(push, 16))
+ if (!PUSH_SPACE(push, nr + 9))
break;
- nr = PUSH_AVAIL(push);
- assert(nr >= 16);
- nr = MIN2(count, nr - 9);
- nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN);
BEGIN_NVC0(push, NVC0_M2MF(OFFSET_OUT_HIGH), 2);
PUSH_DATAh(push, dst->offset + offset);
@@ -234,14 +230,10 @@ nve4_p2mf_push_linear(struct nouveau_context *nv,
nouveau_pushbuf_validate(push);
while (count) {
- unsigned nr;
+ unsigned nr = MIN2(count, (NV04_PFIFO_MAX_PACKET_LEN - 1));
- if (!PUSH_SPACE(push, 16))
+ if (!PUSH_SPACE(push, nr + 10))
break;
- nr = PUSH_AVAIL(push);
- assert(nr >= 16);
- nr = MIN2(count, nr - 8);
- nr = MIN2(nr, (NV04_PFIFO_MAX_PACKET_LEN - 1));
BEGIN_NVC0(push, NVE4_P2MF(UPLOAD_DST_ADDRESS_HIGH), 2);
PUSH_DATAh(push, dst->offset + offset);
@@ -571,9 +563,7 @@ nvc0_cb_bo_push(struct nouveau_context *nv,
PUSH_DATA (push, bo->offset + base);
while (words) {
- unsigned nr = PUSH_AVAIL(push);
- nr = MIN2(nr, words);
- nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN - 1);
+ unsigned nr = MIN2(words, NV04_PFIFO_MAX_PACKET_LEN - 1);
PUSH_SPACE(push, nr + 2);
PUSH_REFN (push, bo, NOUVEAU_BO_WR | domain);