summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/sna_accel.c38
-rw-r--r--src/sna/sna_blt.c29
-rw-r--r--src/sna/sna_trapezoids_boxes.c2
-rw-r--r--src/sna/sna_trapezoids_imprecise.c1
-rw-r--r--src/sna/sna_trapezoids_mono.c2
-rw-r--r--src/sna/sna_trapezoids_precise.c1
6 files changed, 50 insertions, 23 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4db011f3..7cd9a0c4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2365,21 +2365,26 @@ skip_inplace_map:
assert(pixmap->devPrivate.ptr == MAP(priv->cpu_bo->map__cpu));
}
- assert(pixmap->devKind);
- if (priv->clear_color == 0 ||
- pixmap->drawable.bitsPerPixel == 8 ||
- priv->clear_color == (1 << pixmap->drawable.depth) - 1) {
- memset(pixmap->devPrivate.ptr, priv->clear_color,
- (size_t)pixmap->devKind * pixmap->drawable.height);
- } else {
- pixman_fill(pixmap->devPrivate.ptr,
- pixmap->devKind/sizeof(uint32_t),
- pixmap->drawable.bitsPerPixel,
- 0, 0,
- pixmap->drawable.width,
- pixmap->drawable.height,
- priv->clear_color);
- }
+ if (sigtrap_get() == 0) {
+ assert(pixmap->devKind);
+ sigtrap_assert_active();
+ if (priv->clear_color == 0 ||
+ pixmap->drawable.bitsPerPixel == 8 ||
+ priv->clear_color == (1 << pixmap->drawable.depth) - 1) {
+ memset(pixmap->devPrivate.ptr, priv->clear_color,
+ (size_t)pixmap->devKind * pixmap->drawable.height);
+ } else {
+ pixman_fill(pixmap->devPrivate.ptr,
+ pixmap->devKind/sizeof(uint32_t),
+ pixmap->drawable.bitsPerPixel,
+ 0, 0,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
+ priv->clear_color);
+ }
+ sigtrap_put();
+ } else
+ return false;
clear_done:
sna_damage_all(&priv->cpu_damage, pixmap);
@@ -2929,6 +2934,7 @@ move_to_cpu:
}
assert(pixmap->devKind);
+ sigtrap_assert_active();
do {
pixman_fill(pixmap->devPrivate.ptr,
pixmap->devKind/sizeof(uint32_t),
@@ -6869,6 +6875,7 @@ fallback:
assert(dst_pixmap->devPrivate.ptr);
assert(dst_pixmap->devKind);
+ sigtrap_assert_active();
do {
pixman_fill(dst_pixmap->devPrivate.ptr,
dst_pixmap->devKind/sizeof(uint32_t),
@@ -17064,6 +17071,7 @@ sna_get_image__fast(PixmapPtr pixmap,
__FUNCTION__, priv->clear_color));
assert(DAMAGE_IS_ALL(priv->gpu_damage));
assert(priv->cpu_damage == NULL);
+ sigtrap_assert_active();
if (priv->clear_color == 0 ||
pixmap->drawable.bitsPerPixel == 8 ||
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 3d8c040f..38167ff2 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -86,6 +86,11 @@ static const uint8_t fill_ROP[] = {
ROP_1
};
+static void sig_done(struct sna *sna, const struct sna_composite_op *op)
+{
+ sigtrap_put();
+}
+
static void nop_done(struct sna *sna, const struct sna_composite_op *op)
{
assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(&sna->kgem));
@@ -1005,6 +1010,7 @@ static void blt_composite_fill__cpu(struct sna *sna,
assert(op->dst.pixmap->devPrivate.ptr);
assert(op->dst.pixmap->devKind);
+ sigtrap_assert_active();
pixman_fill(op->dst.pixmap->devPrivate.ptr,
op->dst.pixmap->devKind / sizeof(uint32_t),
op->dst.pixmap->drawable.bitsPerPixel,
@@ -1024,6 +1030,7 @@ blt_composite_fill_box_no_offset__cpu(struct sna *sna,
assert(op->dst.pixmap->devPrivate.ptr);
assert(op->dst.pixmap->devKind);
+ sigtrap_assert_active();
pixman_fill(op->dst.pixmap->devPrivate.ptr,
op->dst.pixmap->devKind / sizeof(uint32_t),
op->dst.pixmap->drawable.bitsPerPixel,
@@ -1044,6 +1051,7 @@ blt_composite_fill_boxes_no_offset__cpu(struct sna *sna,
assert(op->dst.pixmap->devPrivate.ptr);
assert(op->dst.pixmap->devKind);
+ sigtrap_assert_active();
pixman_fill(op->dst.pixmap->devPrivate.ptr,
op->dst.pixmap->devKind / sizeof(uint32_t),
op->dst.pixmap->drawable.bitsPerPixel,
@@ -1065,6 +1073,7 @@ blt_composite_fill_box__cpu(struct sna *sna,
assert(op->dst.pixmap->devPrivate.ptr);
assert(op->dst.pixmap->devKind);
+ sigtrap_assert_active();
pixman_fill(op->dst.pixmap->devPrivate.ptr,
op->dst.pixmap->devKind / sizeof(uint32_t),
op->dst.pixmap->drawable.bitsPerPixel,
@@ -1086,6 +1095,7 @@ blt_composite_fill_boxes__cpu(struct sna *sna,
assert(op->dst.pixmap->devPrivate.ptr);
assert(op->dst.pixmap->devKind);
+ sigtrap_assert_active();
pixman_fill(op->dst.pixmap->devPrivate.ptr,
op->dst.pixmap->devKind / sizeof(uint32_t),
op->dst.pixmap->drawable.bitsPerPixel,
@@ -1464,6 +1474,7 @@ prepare_blt_clear(struct sna *sna,
DBG(("%s\n", __FUNCTION__));
if (op->dst.bo == NULL) {
+ op->u.blt.pixel = 0;
op->blt = blt_composite_fill__cpu;
if (op->dst.x|op->dst.y) {
op->box = blt_composite_fill_box__cpu;
@@ -1474,9 +1485,8 @@ prepare_blt_clear(struct sna *sna,
op->boxes = blt_composite_fill_boxes_no_offset__cpu;
op->thread_boxes = blt_composite_fill_boxes_no_offset__cpu;
}
- op->done = nop_done;
- op->u.blt.pixel = 0;
- return true;
+ op->done = sig_done;
+ return sigtrap_get() == 0;
}
op->blt = blt_composite_fill;
@@ -1519,8 +1529,8 @@ prepare_blt_fill(struct sna *sna,
op->boxes = blt_composite_fill_boxes_no_offset__cpu;
op->thread_boxes = blt_composite_fill_boxes_no_offset__cpu;
}
- op->done = nop_done;
- return true;
+ op->done = sig_done;
+ return sigtrap_get() == 0;
}
op->blt = blt_composite_fill;
@@ -2436,6 +2446,9 @@ prepare_blt_put(struct sna *sna,
op->box = blt_put_composite_box;
op->boxes = blt_put_composite_boxes;
}
+
+ op->done = nop_done;
+ return true;
} else {
if (alpha_fixup) {
op->u.blt.pixel = alpha_fixup;
@@ -2447,10 +2460,10 @@ prepare_blt_put(struct sna *sna,
op->box = blt_put_composite_box__cpu;
op->boxes = blt_put_composite_boxes__cpu;
}
- }
- op->done = nop_done;
- return true;
+ op->done = sig_done;
+ return sigtrap_get() == 0;
+ }
}
static bool
diff --git a/src/sna/sna_trapezoids_boxes.c b/src/sna/sna_trapezoids_boxes.c
index 9900e3f0..b41121b4 100644
--- a/src/sna/sna_trapezoids_boxes.c
+++ b/src/sna/sna_trapezoids_boxes.c
@@ -592,6 +592,8 @@ lerp32_opacity(PixmapPtr scratch,
uint32_t *ptr;
int stride, i;
+ sigtrap_assert_active();
+
ptr = (uint32_t*)((uint8_t *)scratch->devPrivate.ptr + scratch->devKind * y);
ptr += x;
stride = scratch->devKind / 4;
diff --git a/src/sna/sna_trapezoids_imprecise.c b/src/sna/sna_trapezoids_imprecise.c
index df22add5..4e90f9c4 100644
--- a/src/sna/sna_trapezoids_imprecise.c
+++ b/src/sna/sna_trapezoids_imprecise.c
@@ -2370,6 +2370,7 @@ tor_blt_lerp32(struct sna *sna,
if (coverage == 0)
return;
+ sigtrap_assert_active();
ptr += box->y1 * stride + box->x1;
h = box->y2 - box->y1;
diff --git a/src/sna/sna_trapezoids_mono.c b/src/sna/sna_trapezoids_mono.c
index 29cb58ff..5b65fa45 100644
--- a/src/sna/sna_trapezoids_mono.c
+++ b/src/sna/sna_trapezoids_mono.c
@@ -1013,6 +1013,7 @@ mono_inplace_fill_box(struct sna *sna,
box->x2 - box->x1,
box->y2 - box->y1,
fill->color));
+ sigtrap_assert_active();
pixman_fill(fill->data, fill->stride, fill->bpp,
box->x1, box->y1,
box->x2 - box->x1,
@@ -1034,6 +1035,7 @@ mono_inplace_fill_boxes(struct sna *sna,
box->x2 - box->x1,
box->y2 - box->y1,
fill->color));
+ sigtrap_assert_active();
pixman_fill(fill->data, fill->stride, fill->bpp,
box->x1, box->y1,
box->x2 - box->x1,
diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index f1532d31..c9838528 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -2386,6 +2386,7 @@ tor_blt_lerp32(struct sna *sna,
if (coverage == 0)
return;
+ sigtrap_assert_active();
ptr += box->y1 * stride + box->x1;
h = box->y2 - box->y1;