vc4: Don't allocate new BOs to avoid synchronization when they're shared.
authorEric Anholt <eric@anholt.net>
Wed, 17 May 2017 20:22:39 +0000 (13:22 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 17 May 2017 21:18:29 +0000 (14:18 -0700)
If X11 did a software fallback to the entire screen, we would throw out
the BO the screen is scanning out from and allocate a new one.

Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/vc4/vc4_resource.c

index c0bfc8ff2ea5c6f311a7eda7ec79719892071118..8a5398d9f78397b1daccc160aa54de16ab83c2cc 100644 (file)
@@ -165,7 +165,8 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
             prsc->width0 == box->width &&
             prsc->height0 == box->height &&
             prsc->depth0 == box->depth &&
-            prsc->array_size == 1) {
+            prsc->array_size == 1 &&
+            rsc->bo->private) {
                 usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
         }