summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-28 13:03:06 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-28 13:03:06 +0000
commit1200aae4815cdbc6a4f242c264b2736e6fe0fa12 (patch)
treef7a35bcbac8224d50978e01ff138cc96c3c10cda
parent0fb7c366a58ec9b9cdc0b330e53716ab04b24c96 (diff)
sna: Wrap image upload with sigtrap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 7e36554b..f68f5f41 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -6354,13 +6354,21 @@ struct kgem_bo *kgem_upload_source_image(struct kgem *kgem,
bo = kgem_create_buffer_2d(kgem,
width, height, bpp,
KGEM_BUFFER_WRITE_INPLACE, &dst);
- if (bo)
- memcpy_blt(data, dst, bpp,
- stride, bo->pitch,
- box->x1, box->y1,
- 0, 0,
- width, height);
+ if (bo == NULL)
+ return NULL;
+
+ if (sigtrap_get()) {
+ kgem_bo_destroy(kgem, bo);
+ return NULL;
+ }
+
+ memcpy_blt(data, dst, bpp,
+ stride, bo->pitch,
+ box->x1, box->y1,
+ 0, 0,
+ width, height);
+ sigtrap_put();
return bo;
}