summaryrefslogtreecommitdiff
path: root/src/sna/sna_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-05-26 07:06:18 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-05-26 07:56:55 +0100
commit9f4f855ba37966fb91d31e9081d03cf72affb154 (patch)
treece1e57426883df26fed4dc922cd0b662036898d4 /src/sna/sna_render.c
parentb508d8f3318c42a2a87b7731789b1d03610e9b46 (diff)
sna: Implicit release of upload buffers considered bad
Currently upload buffers are automatically decoupled when the buffer is retired. As retiring can happen during command setup after we have selected which bo to render with, this can free the bo we plan to use. Which is bad. Instead of making the release of upload buffers automatic, we manually check whether the buffer is idle before use as a source to consider scrapping it and replacing it with a real GPU bo. This is likely to keep upload buffers alive for longer (limiting reuse between Pixmaps but making reuse of the buffer within a Pixmap more likely) which is both good and bad. (Good - may improve the content cache, bad - may increase the amount of memory used by upload buffers for arbitrary long periods.) Reported-by: Matti Hämäläinen <ccr@tnsp.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79238 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_render.c')
-rw-r--r--src/sna/sna_render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index b67bd26c..d3cb6a0f 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -565,7 +565,7 @@ static struct kgem_bo *upload(struct sna *sna,
assert(priv->gpu_damage == NULL);
assert(priv->gpu_bo == NULL);
assert(bo->proxy != NULL);
- kgem_proxy_bo_attach(bo, &priv->gpu_bo);
+ priv->gpu_bo = kgem_bo_reference(bo);
}
}
@@ -1266,7 +1266,7 @@ sna_render_picture_extract(struct sna *sna,
assert(priv->gpu_damage == NULL);
assert(priv->gpu_bo == NULL);
assert(bo->proxy != NULL);
- kgem_proxy_bo_attach(bo, &priv->gpu_bo);
+ priv->gpu_bo = kgem_bo_reference(bo);
}
}