summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-18 14:19:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-19 14:04:38 +0100
commit494f4bdcb00dc54f84e503b49fd85c8965f7f9ed (patch)
tree772817c246b96cee1be037311112e804ba5c5eab
parentfb058de4e617d7e5058674859993ec635a8d779e (diff)
sna: Allow operation inplace when wedged
There are times, such as rendering into the scanout, where continuing to use the GTT is preferrable even when wedged. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index dbbc54ec..8a0f5e0c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1471,10 +1471,10 @@ sna_pixmap_create_mappable_gpu(PixmapPtr pixmap,
unsigned create;
if (wedged(sna))
- return false;
+ goto done;
if ((priv->create & KGEM_CAN_CREATE_GTT) == 0)
- return false;
+ goto done;
assert_pixmap_damage(pixmap);
@@ -1482,7 +1482,7 @@ sna_pixmap_create_mappable_gpu(PixmapPtr pixmap,
(!kgem_bo_is_mappable(&sna->kgem, priv->gpu_bo) ||
__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) {
if (priv->pinned)
- return false;
+ goto done;
DBG(("%s: discard busy GPU bo\n", __FUNCTION__));
sna_pixmap_free_gpu(sna, priv);
@@ -1508,6 +1508,7 @@ sna_pixmap_create_mappable_gpu(PixmapPtr pixmap,
sna_pixmap_choose_tiling(pixmap, DEFAULT_TILING),
create);
+done:
return priv->gpu_bo && kgem_bo_is_mappable(&sna->kgem, priv->gpu_bo);
}
@@ -1909,7 +1910,7 @@ skip_inplace_map:
if (USE_INPLACE &&
operate_inplace(priv, flags) &&
pixmap_inplace(sna, pixmap, priv, flags) &&
- sna_pixmap_create_mappable_gpu(pixmap, (flags & MOVE_READ) == 0)) {
+ sna_pixmap_create_mappable_gpu(pixmap, (flags & MOVE_READ) == 0)) {
DBG(("%s: try to operate inplace (GTT)\n", __FUNCTION__));
assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
assert((flags & MOVE_READ) == 0 || priv->cpu_damage == NULL);
@@ -2305,7 +2306,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (USE_INPLACE &&
operate_inplace(priv, flags) &&
region_inplace(sna, pixmap, region, priv, flags) &&
- sna_pixmap_create_mappable_gpu(pixmap, false)) {
+ sna_pixmap_create_mappable_gpu(pixmap, false)) {
DBG(("%s: try to operate inplace\n", __FUNCTION__));
assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
/* XXX only sync for writes? */