summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-02-22 13:58:11 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-02-22 14:35:10 +0000
commit900499bff962a63e1d9b5f808d1deb65d55754a2 (patch)
treea402f0b12274ccaab2f1c30b390415a9c3aec838 /src
parentaae3bfeb28ca86b416a6a4de71eb23cdb46cf9de (diff)
sna: Move sigtrap wrapping closer to threaded sw composite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_composite.c17
-rw-r--r--src/sna/sna_render.c13
-rw-r--r--src/sna/sna_threads.c51
3 files changed, 40 insertions, 41 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 5b61f952..d5c229c5 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -592,17 +592,12 @@ sna_composite_fb(CARD8 op,
mask_image = image_from_pict(mask, FALSE, &msk_xoff, &msk_yoff);
dest_image = image_from_pict(dst, TRUE, &dst_xoff, &dst_yoff);
- if (src_image && dest_image && !(mask && !mask_image)) {
- if (sigtrap_get() == 0) {
- sigtrap_assert_active();
- sna_image_composite(op, src_image, mask_image, dest_image,
- src_x + src_xoff, src_y + src_yoff,
- msk_x + msk_xoff, msk_y + msk_yoff,
- dst_x + dst_xoff, dst_y + dst_yoff,
- width, height);
- sigtrap_put();
- }
- }
+ if (src_image && dest_image && !(mask && !mask_image))
+ sna_image_composite(op, src_image, mask_image, dest_image,
+ src_x + src_xoff, src_y + src_yoff,
+ msk_x + msk_xoff, msk_y + msk_yoff,
+ dst_x + dst_xoff, dst_y + dst_yoff,
+ width, height);
free_pixman_pict(src, src_image);
free_pixman_pict(mask, mask_image);
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 7acca365..73dcf45b 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1674,14 +1674,11 @@ do_fixup:
DBG(("%s: compositing tmp=(%d+%d, %d+%d)x(%d, %d)\n",
__FUNCTION__, x, dx, y, dy, w, h));
- if (sigtrap_get() == 0) {
- sna_image_composite(PictOpSrc, src, NULL, dst,
- x + dx, y + dy,
- 0, 0,
- 0, 0,
- w, h);
- sigtrap_put();
- }
+ sna_image_composite(PictOpSrc, src, NULL, dst,
+ x + dx, y + dy,
+ 0, 0,
+ 0, 0,
+ w, h);
free_pixman_pict(picture, src);
/* Then convert to card format */
diff --git a/src/sna/sna_threads.c b/src/sna/sna_threads.c
index 8f554965..a15e66a8 100644
--- a/src/sna/sna_threads.c
+++ b/src/sna/sna_threads.c
@@ -276,11 +276,14 @@ void sna_image_composite(pixman_op_t op,
num_threads = sna_use_threads(width, height, 32);
if (num_threads <= 1) {
- pixman_image_composite(op, src, mask, dst,
- src_x, src_y,
- mask_x, mask_y,
- dst_x, dst_y,
- width, height);
+ if (sigtrap_get() == 0) {
+ pixman_image_composite(op, src, mask, dst,
+ src_x, src_y,
+ mask_x, mask_y,
+ dst_x, dst_y,
+ width, height);
+ sigtrap_put();
+ }
} else {
struct thread_composite data[num_threads];
int y, dy, n;
@@ -305,27 +308,31 @@ void sna_image_composite(pixman_op_t op,
data[0].width = width;
data[0].height = dy;
- for (n = 1; n < num_threads; n++) {
- data[n] = data[0];
- data[n].src_y += y - dst_y;
- data[n].mask_y += y - dst_y;
- data[n].dst_y = y;
- y += dy;
+ if (sigtrap_get() == 0) {
+ for (n = 1; n < num_threads; n++) {
+ data[n] = data[0];
+ data[n].src_y += y - dst_y;
+ data[n].mask_y += y - dst_y;
+ data[n].dst_y = y;
+ y += dy;
- sna_threads_run(thread_composite, &data[n]);
- }
+ sna_threads_run(thread_composite, &data[n]);
+ }
- assert(y < dst_y + height);
- if (y + dy > dst_y + height)
- dy = dst_y + height - y;
+ assert(y < dst_y + height);
+ if (y + dy > dst_y + height)
+ dy = dst_y + height - y;
- data[0].src_y += y - dst_y;
- data[0].mask_y += y - dst_y;
- data[0].dst_y = y;
- data[0].height = dy;
+ data[0].src_y += y - dst_y;
+ data[0].mask_y += y - dst_y;
+ data[0].dst_y = y;
+ data[0].height = dy;
- thread_composite(&data[0]);
+ thread_composite(&data[0]);
- sna_threads_wait();
+ sna_threads_wait();
+ sigtrap_put();
+ } else
+ sna_threads_kill();
}
}