diff options
author | Ilia Mirkin <[email protected]> | 2017-01-10 22:07:53 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2017-01-12 20:39:19 -0500 |
commit | eb60a89bc3ac2b43faf52d06e05670bbbca7292d (patch) | |
tree | 8a910c40646ee6b3e14bb26d48c341cef38e587c /src/gallium/drivers/nouveau/nv30 | |
parent | 89458366585c34879b70110758bb4fd3acb62ce0 (diff) |
nouveau: take extra push space into account for pushbuf_space calls
Ever since a long time ago when I messed around with fences, I ensure
that after a PUSH_SPACE call there is enough space to write a fence out
into the pushbuf.
However the PUSH_SPACE macro is not all-knowing, and so sometimes we
have to invoke nouveau_pushbuf_space manually with the relocs/pushes
args set. If we don't take the extra allocation from PUSH_SPACE into
account, then we will end up accidentally flushing when the code was not
expecting a flush. This can lead to various runtime and rendering
failures.
The amount of extra allocation isn't that important - it has to be at
least 8 based on the current nouveau_winsys.h setting, but even more
won't hurt. I just rounded up to powers of 2.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99354
Cc: "12.0 13.0" <[email protected]>
Signed-off-by: Ilia Mirkin <[email protected]>
Acked-by: Ben Skeggs <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv30')
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nv30_clear.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nv30_transfer.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_clear.c b/src/gallium/drivers/nouveau/nv30/nv30_clear.c index 4217bca6da0..4e6df1eff60 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_clear.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_clear.c @@ -128,7 +128,7 @@ nv30_clear_render_target(struct pipe_context *pipe, struct pipe_surface *ps, refn.bo = mt->base.bo; refn.flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_WR; - if (nouveau_pushbuf_space(push, 16, 1, 0) || + if (nouveau_pushbuf_space(push, 32, 1, 0) || nouveau_pushbuf_refn (push, &refn, 1)) return; diff --git a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c index e4b9497259f..6f06ee6b1c4 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c @@ -431,7 +431,7 @@ nv30_transfer_rect_sifm(XFER_ARGS) si_arg |= NV03_SIFM_FORMAT_FILTER_BILINEAR; } - if (nouveau_pushbuf_space(push, 32, 6, 0) || + if (nouveau_pushbuf_space(push, 64, 6, 0) || nouveau_pushbuf_refn (push, refs, 2)) return; @@ -516,7 +516,7 @@ nv30_transfer_rect_m2mf(XFER_ARGS) while (h) { unsigned lines = (h > 2047) ? 2047 : h; - if (nouveau_pushbuf_space(push, 13, 2, 0) || + if (nouveau_pushbuf_space(push, 32, 2, 0) || nouveau_pushbuf_refn (push, refs, 2)) return; @@ -708,7 +708,7 @@ nv30_transfer_copy_data(struct nouveau_context *nv, lines = (pages > 2047) ? 2047 : pages; pages -= lines; - if (nouveau_pushbuf_space(push, 13, 2, 0) || + if (nouveau_pushbuf_space(push, 32, 2, 0) || nouveau_pushbuf_refn (push, refs, 2)) return; @@ -732,7 +732,7 @@ nv30_transfer_copy_data(struct nouveau_context *nv, } if (size) { - if (nouveau_pushbuf_space(push, 13, 2, 0) || + if (nouveau_pushbuf_space(push, 32, 2, 0) || nouveau_pushbuf_refn (push, refs, 2)) return; |