summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-05-17 13:22:39 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2017-05-26 10:21:32 +0100
commitb50e9022bde70b6f381bf2a717ef7ac77138a9bf (patch)
tree34593c5c6991f27d3f9953f1f7f199f701eec896
parent356b0b2ba1e2b6e43604a5a249e39bf881976ee2 (diff)
vc4: Don't allocate new BOs to avoid synchronization when they're shared.
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 (cherry picked from commit e8ea42d245cb6adc7f16ee4e96fd89d905d2163a)
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index e4784ff86e2..596f73dfbf0 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -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;
}