summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-09 12:11:53 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-09 12:41:41 +0000
commit25c0d440dee45c03f5e45b8e0e45071c0c32f507 (patch)
tree98befdd7d5539b2e46ec8ee570b2a80fa0bdc79e /src/sna
parent3e82fcc8d243b7ffe1a3d3249a5cdb5fd068093f (diff)
sna: Move source to CPU prior to referencing for inplace trapezoids
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56825 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_accel.c1
-rw-r--r--src/sna/sna_trapezoids.c35
2 files changed, 34 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index c7edad63..e996cdb2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4736,6 +4736,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
goto fallback;
}
+ assert(dst_priv->clear == false);
dst_priv->cpu = false;
if (damage) {
assert(dst_priv->gpu_bo->proxy == NULL);
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 8f2ea34a..289780bd 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -4855,6 +4855,20 @@ unbounded_pass:
op = 0;
} else {
+ if (src->pDrawable) {
+ if (!sna_drawable_move_to_cpu(src->pDrawable,
+ MOVE_READ)) {
+ mono_fini(&mono);
+ return false;
+ }
+ if (src->alphaMap &&
+ !sna_drawable_move_to_cpu(src->alphaMap->pDrawable,
+ MOVE_READ)) {
+ mono_fini(&mono);
+ return false;
+ }
+ }
+
inplace.composite.dst = image_from_pict(dst, false,
&inplace.composite.dx,
&inplace.composite.dy);
@@ -5091,6 +5105,20 @@ trapezoid_span_inplace__x8r8g8b8(CARD8 op,
} else {
struct pixman_inplace pi;
+ if (src->pDrawable) {
+ if (!sna_drawable_move_to_cpu(src->pDrawable,
+ MOVE_READ)) {
+ tor_fini(&tor);
+ return false;
+ }
+ if (src->alphaMap &&
+ !sna_drawable_move_to_cpu(src->alphaMap->pDrawable,
+ MOVE_READ)) {
+ tor_fini(&tor);
+ return false;
+ }
+ }
+
pi.image = image_from_pict(dst, false, &pi.dx, &pi.dy);
pi.source = image_from_pict(src, false, &pi.sx, &pi.sy);
pi.sx += src_x - pixman_fixed_to_int(traps[0].left.p1.x);
@@ -5519,10 +5547,13 @@ sna_composite_trapezoids(CARD8 op,
force_fallback = FORCE_FALLBACK > 0;
if ((too_small(priv) || DAMAGE_IS_ALL(priv->cpu_damage)) &&
!picture_is_gpu(src)) {
- DBG(("%s: force fallbacks -- dst is too small, %dx%d\n",
+ DBG(("%s: force fallbacks --too small, %dx%d? %d, all-cpu? %d, src-is-cpu? %d\n",
__FUNCTION__,
dst->pDrawable->width,
- dst->pDrawable->height));
+ dst->pDrawable->height,
+ too_small(priv),
+ DAMAGE_IS_ALL(priv->cpu_damage),
+ !picture_is_gpu(src)));
force_fallback = true;
}
if (FORCE_FALLBACK < 0)