summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-12 21:07:15 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-12 21:15:58 +0000
commit48ab72754d0069a3247c5fee8c353a6b593eaed9 (patch)
tree510b7db960a7af5486995c18d466bbce736fe8db
parent20a4d7181983c7fed289844be49ccaf3f56965c6 (diff)
sna: Use the GPU bo if it is all damaged
By marking the scratch upload pixmap as damaged in both domains, we confused the texture upload path and made it upload the pixmap a second time. If either bo is all-damaged, use it! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_render.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 9052d687..142c1aa9 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -477,13 +477,14 @@ sna_render_pixmap_bo(struct sna *sna,
priv = sna_pixmap(pixmap);
if (priv) {
- if (priv->gpu_bo && priv->cpu_damage == NULL) {
+ if (priv->gpu_bo &&
+ (DAMAGE_IS_ALL(priv->gpu_damage) || !priv->cpu_damage)) {
channel->bo = kgem_bo_reference(priv->gpu_bo);
return 1;
}
if (priv->cpu_bo &&
- DAMAGE_IS_ALL(priv->cpu_damage) &&
+ (DAMAGE_IS_ALL(priv->cpu_damage) || !priv->gpu_damage) &&
priv->cpu_bo->pitch < 4096) {
channel->bo = kgem_bo_reference(priv->cpu_bo);
return 1;