Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-mesa: Commit

external/mesa


Commit MetaInfo

Revisiona0a48b641dd15607bed7b0c735a280067dca0e93 (tree)
Time2017-04-12 19:32:28
AuthorIlia Mirkin <imirkin@alum...>
CommiterEmil Velikov

Log Message

nouveau: when mapping a persistent buffer, synchronize on former xfers

If the buffer is being used, we should wait for those uses to be
complete before returning the map.

Fixes: GL45-CTS.direct_state_access.buffers_functional
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit d9cc58d6ec56e676b1285508a4118a83f5325833)

Change Summary

Incremental Difference

--- a/src/gallium/drivers/nouveau/nouveau_buffer.c
+++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
@@ -406,9 +406,6 @@ nouveau_buffer_transfer_map(struct pipe_context *pipe,
406406 !util_ranges_intersect(&buf->valid_buffer_range, box->x, box->x + box->width))
407407 usage |= PIPE_TRANSFER_DISCARD_RANGE | PIPE_TRANSFER_UNSYNCHRONIZED;
408408
409- if (usage & PIPE_TRANSFER_PERSISTENT)
410- usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
411-
412409 if (buf->domain == NOUVEAU_BO_VRAM) {
413410 if (usage & NOUVEAU_TRANSFER_DISCARD) {
414411 /* Set up a staging area for the user to write to. It will be copied
@@ -476,7 +473,8 @@ nouveau_buffer_transfer_map(struct pipe_context *pipe,
476473 * complete its operation, or set up a staging area to perform our work in.
477474 */
478475 if (nouveau_buffer_busy(buf, usage & PIPE_TRANSFER_READ_WRITE)) {
479- if (unlikely(usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE)) {
476+ if (unlikely(usage & (PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE |
477+ PIPE_TRANSFER_PERSISTENT))) {
480478 /* Discarding was not possible, must sync because
481479 * subsequent transfers might use UNSYNCHRONIZED. */
482480 nouveau_buffer_sync(nv, buf, usage & PIPE_TRANSFER_READ_WRITE);
Show on old repository browser