diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-23 09:47:34 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-23 10:01:19 +0100 |
commit | 978790dc52fa9551b3bccbd91988b93988e937df (patch) | |
tree | 058334068ac501f5032451477a5b9ada0c7ea069 /src/sna | |
parent | b2206eca00e497aff0d79a6e9feae3d9c5070dcc (diff) |
sna: Allow the CPU bo to be created if GPU rendering is forced
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna_accel.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index e4520d14..f362a9cd 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3765,21 +3765,27 @@ use_gpu_bo: use_cpu_bo: if (!USE_CPU_BO || priv->cpu_bo == NULL) { + if ((flags & FORCE_GPU) == 0) + return NULL; + + if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, ®ion, + (flags & IGNORE_DAMAGE ? 0 : MOVE_READ) | MOVE_WRITE | MOVE_ASYNC_HINT)) { cpu_fail: - if ((flags & FORCE_GPU) && priv->gpu_bo) { - region.extents = *box; - if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { - region.extents.x1 += dx; - region.extents.x2 += dx; - region.extents.y1 += dy; - region.extents.y2 += dy; + if (priv->gpu_bo) { + region.extents = *box; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } + region.data = NULL; + + goto move_to_gpu; } - region.data = NULL; - goto move_to_gpu; + return NULL; } - - return NULL; } assert(priv->cpu_bo->refcnt); |