summaryrefslogtreecommitdiff
path: root/src/sna/sna_trapezoids_imprecise.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_imprecise.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_imprecise.c')
-rw-r--r--src/sna/sna_trapezoids_imprecise.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/sna/sna_trapezoids_imprecise.c b/src/sna/sna_trapezoids_imprecise.c
index a354f280..ddf52c2c 100644
--- a/src/sna/sna_trapezoids_imprecise.c
+++ b/src/sna/sna_trapezoids_imprecise.c
@@ -2759,8 +2759,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;
@@ -2778,9 +2781,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);
@@ -2804,9 +2810,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);
@@ -3083,8 +3092,11 @@ imprecise_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 {