diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-22 17:35:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-22 17:57:59 +0100 |
commit | 4eb736d61a3b45edb921799b74b3b164b94c174a (patch) | |
tree | 43498d48548bc3b0385ae329f3144dbbe88ccbf4 | |
parent | c9e304a7194c1fd6038c59524d3c03756ea0d09e (diff) |
sna: Handle pending move-to-gpu for userptr uploads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 1977d459..f58092e2 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4158,11 +4158,19 @@ try_upload_blt(PixmapPtr pixmap, RegionRec *region, assert(priv->gpu_bo); assert(priv->gpu_bo->proxy == NULL); - if (priv->cow || !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) { + if (!__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) { DBG(("%s: no, target is idle\n", __FUNCTION__)); return false; } + if (priv->cow || priv->move_to_gpu) { + if (!region_subsumes_drawable(region, &pixmap->drawable) || + !sna_pixmap_move_to_gpu(pixmap, MOVE_WRITE)) { + DBG(("%s: no, target is a partial COW\n", __FUNCTION__)); + return false; + } + } + if (priv->cpu_damage && sna_damage_contains_box__no_reduce(priv->cpu_damage, ®ion->extents) && |