summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-11-06 12:40:20 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-11-06 12:42:13 +0000
commit33764685cbcd01548b6a23c217c7b511c1639694 (patch)
tree83fb4565e9004d2207e0dfc27d0a6007026174a5 /src
parent97fe3c1c860978c7a649cba93a55fa497010ccc1 (diff)
sna: Wrap prefaulting with sigtrap()
Handle a potential SIGBUS due to kernel bugs when prefaulting the scanout surface. References: https://bugs.freedesktop.org/show_bug.cgi?id=85959 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/kgem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 7c572cc4..90474377 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4629,7 +4629,10 @@ static void __kgem_bo_make_scanout(struct kgem *kgem,
if (bo->map__gtt == NULL)
bo->map__gtt = __kgem_bo_map__gtt(kgem, bo);
if (bo->map__gtt) {
- *(uint32_t *)bo->map__gtt = 0;
+ if (sigtrap_get() == 0) {
+ *(uint32_t *)bo->map__gtt = 0;
+ sigtrap_put();
+ }
bo->domain = DOMAIN_GTT;
}