From: Chris Wilson Date: Fri, 25 Oct 2013 10:03:05 +0000 (+0100) Subject: sna/io: Wrap the XOR upload paths with SIGBUS handling X-Git-Tag: 2.99.906~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51590e55c0187862174a7dd5775915216b3137a6;p=platform%2Fupstream%2Fxf86-video-intel.git sna/io: Wrap the XOR upload paths with SIGBUS handling Signed-off-by: Chris Wilson --- diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 0988d3d..578442d 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -1049,6 +1049,10 @@ write_boxes_inplace__xor(struct kgem *kgem, if (dst == NULL) return; + sigtrap_assert(); + if (sigtrap_get()) + return; + do { DBG(("%s: (%d, %d) -> (%d, %d) x (%d, %d) [bpp=%d, src_pitch=%d, dst_pitch=%d]\n", __FUNCTION__, box->x1 + src_dx, box->y1 + src_dy, @@ -1076,6 +1080,8 @@ write_boxes_inplace__xor(struct kgem *kgem, and, or); box++; } while (--n); + + sigtrap_put(); } static bool upload_inplace__xor(struct kgem *kgem, @@ -1591,17 +1597,17 @@ struct kgem_bo *sna_replace__xor(struct sna *sna, } } - if (kgem_bo_is_mappable(kgem, bo)) { - dst = kgem_bo_map(kgem, bo); - if (dst) { - memcpy_xor(src, dst, pixmap->drawable.bitsPerPixel, - stride, bo->pitch, - 0, 0, - 0, 0, - pixmap->drawable.width, - pixmap->drawable.height, - and, or); - } + if (kgem_bo_is_mappable(kgem, bo) && + (dst = kgem_bo_map(kgem, bo)) != NULL && + sigtrap_get() == 0) { + memcpy_xor(src, dst, pixmap->drawable.bitsPerPixel, + stride, bo->pitch, + 0, 0, + 0, 0, + pixmap->drawable.width, + pixmap->drawable.height, + and, or); + sigtrap_put(); } else { BoxRec box;