summaryrefslogtreecommitdiff
path: root/src/sna/sna_trapezoids_precise.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-02-21 21:41:52 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-02-21 21:41:52 +0000
commitcb87b179532a9b533df458f3367fde7fc3d64d0c (patch)
tree22ee05dc9309ccbfbb6266011c8b169e37610330 /src/sna/sna_trapezoids_precise.c
parentb6fc46d63c5b7bc1347d4e03e71df9e6fdbcaaab (diff)
sna: Wrap inplace trapezoid operators with SIGBUS protection
For the moment, this still leaves open the vexing question of how to protect the multi-threaded variants, but it should provide more shelter for extreme OOM. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_trapezoids_precise.c')
-rw-r--r--src/sna/sna_trapezoids_precise.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index de95dfdc..e5bab16b 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -2757,8 +2757,11 @@ trapezoid_span_inplace__x8r8g8b8(CARD8 op,
DBG(("%s: render inplace op=%d, color=%08x\n",
__FUNCTION__, op, color));
- tor_render(NULL, &tor, (void*)&inplace,
- dst->pCompositeClip, span, false);
+ if (sigtrap_get() == 0) {
+ tor_render(NULL, &tor, (void*)&inplace,
+ dst->pCompositeClip, span, false);
+ sigtrap_put();
+ }
} else if (is_solid) {
struct pixman_inplace pi;
@@ -2776,9 +2779,12 @@ trapezoid_span_inplace__x8r8g8b8(CARD8 op,
else
span = pixmask_span_solid;
- tor_render(NULL, &tor, (void*)&pi,
- dst->pCompositeClip, span,
- false);
+ if (sigtrap_get() == 0) {
+ tor_render(NULL, &tor, (void*)&pi,
+ dst->pCompositeClip, span,
+ false);
+ sigtrap_put();
+ }
pixman_image_unref(pi.source);
pixman_image_unref(pi.image);
@@ -2802,9 +2808,12 @@ trapezoid_span_inplace__x8r8g8b8(CARD8 op,
else
span = pixmask_span;
- tor_render(NULL, &tor, (void*)&pi,
- dst->pCompositeClip, span,
- false);
+ if (sigtrap_get() == 0) {
+ tor_render(NULL, &tor, (void*)&pi,
+ dst->pCompositeClip, span,
+ false);
+ sigtrap_put();
+ }
pixman_image_unref(pi.mask);
pixman_image_unref(pi.source);
@@ -3082,8 +3091,11 @@ precise_trapezoid_span_inplace(struct sna *sna,
tor_add_edge(&tor, &t, &t.right, -1);
}
- tor_render(NULL, &tor, (void*)&inplace,
- dst->pCompositeClip, span, unbounded);
+ if (sigtrap_get() == 0) {
+ tor_render(NULL, &tor, (void*)&inplace,
+ dst->pCompositeClip, span, unbounded);
+ sigtrap_put();
+ }
tor_fini(&tor);
} else {