summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-24 21:03:01 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-24 21:31:06 +0000
commitb117f65520919f4ba36010cfe913a8c53166bf23 (patch)
tree47440e1ffcd81affab9168f3b24bd7bcb589a57a
parent72217790ee2c080d618274456360b481d015e898 (diff)
sna: Jump straight to the fallback copy routines if the dst is not attached
Marginally simplify the convoluted logic for choosing the most appropriate path and help prevent further errors. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 0815bc9e..284c4891 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2431,11 +2431,14 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
src_priv ? src_priv->cpu_bo : NULL,
replaces));
- if (dst_priv && replaces)
+ if (dst_priv == NULL)
+ goto fallback;
+
+ if (replaces)
sna_damage_destroy(&dst_priv->cpu_damage);
/* Try to maintain the data on the GPU */
- if (dst_priv && dst_priv->gpu_bo == NULL &&
+ if (dst_priv->gpu_bo == NULL &&
((dst_priv->cpu_damage == NULL && copy_use_gpu_bo(sna, dst_priv, &region)) ||
(src_priv && (src_priv->gpu_bo != NULL || (src_priv->cpu_bo && kgem_bo_is_busy(src_priv->cpu_bo)))))) {
uint32_t tiling = sna_pixmap_choose_tiling(dst_pixmap);
@@ -2455,7 +2458,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
tiling, 0);
}
- if (dst_priv && dst_priv->gpu_bo) {
+ if (dst_priv->gpu_bo) {
if (!src_priv && !copy_use_gpu_bo(sna, dst_priv, &region)) {
DBG(("%s: fallback - src_priv=%p and not use dst gpu bo\n",
__FUNCTION__, src_priv));