summaryrefslogtreecommitdiff
path: root/src/sna/sna_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-26 10:49:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-26 10:50:52 +0000
commit76d46201d7b7abc7c0b6bced9c6fadaf47ad9134 (patch)
tree98c276d9fe60bfdadd4b436c0c22d440e1ec2875 /src/sna/sna_render.c
parent1068bf7024d8a6650de020e95efdedcbfd7d3c5e (diff)
sna: Only use the GPU bo after migrating
If we choose not to migrate the damage to the GPU bo, then it will be incoherent. This just flattens the logic out as priv->gpu_bo should be NULL here anyway. 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.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 512be950..1073abb0 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -463,7 +463,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box, bool blt)
w = box->x2 - box->x1;
h = box->y2 - box->y1;
- if (priv->cpu_bo && !priv->cpu_bo->flush) {
+ if (priv->cpu_bo) {
migrate = true;
} else if (w == pixmap->drawable.width && h == pixmap->drawable.height) {
migrate = priv->source_count++ > SOURCE_BIAS;
@@ -490,14 +490,15 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box, bool blt)
migrate = count*w*h > pixmap->drawable.width * pixmap->drawable.height;
}
- if (migrate) {
- if (blt) {
- if (!sna_pixmap_move_area_to_gpu(pixmap, box, MOVE_READ))
- return NULL;
- } else {
- if (!sna_pixmap_force_to_gpu(pixmap, MOVE_SOURCE_HINT | MOVE_READ))
- return NULL;
- }
+ if (!migrate)
+ return NULL;
+
+ if (blt) {
+ if (!sna_pixmap_move_area_to_gpu(pixmap, box, MOVE_READ))
+ return NULL;
+ } else {
+ if (!sna_pixmap_force_to_gpu(pixmap, MOVE_SOURCE_HINT | MOVE_READ))
+ return NULL;
}
return priv->gpu_bo;