From 5be695a6fe5985bea744f2877ddfc0dd46f0e42b Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Sat, 3 Dec 2011 13:55:28 +0100 Subject: [PATCH] nv50,nvc0: fix crash on screen shutdown nv50_screen_destroy deallocates fence bo (and unmaps it) and then calls nouveau_grobj_free, which tries to read fence status through flush_notify hook (nv50_default_flush_notify). Obviously it causes SIGSEGV. Let's nullify chan->user_private to prevent nv50_default_flush_notify from touching fence bo. It's 7.11-only fix - in master it was fixed by commits: 3069a7eaa5d83e7f41616347ba244c0dc0d944ae 27e77cb902b4f7f5e127dcd78951e3167f13d59c --- src/gallium/drivers/nv50/nv50_screen.c | 3 +++ src/gallium/drivers/nvc0/nvc0_screen.c | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 9606c99..8ce52bf 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -216,6 +216,9 @@ nv50_screen_destroy(struct pipe_screen *pscreen) nouveau_fence_ref (NULL, &screen->base.fence.current); } + if (screen->base.channel) + screen->base.channel->user_private = NULL; + nouveau_bo_ref(NULL, &screen->code); nouveau_bo_ref(NULL, &screen->tls_bo); nouveau_bo_ref(NULL, &screen->stack_bo); diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c index e87688e..b921887 100644 --- a/src/gallium/drivers/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nvc0/nvc0_screen.c @@ -201,6 +201,9 @@ nvc0_screen_destroy(struct pipe_screen *pscreen) nouveau_fence_wait(screen->base.fence.current); nouveau_fence_ref(NULL, &screen->base.fence.current); + if (screen->base.channel) + screen->base.channel->user_private = NULL; + nouveau_bo_ref(NULL, &screen->text); nouveau_bo_ref(NULL, &screen->tls); nouveau_bo_ref(NULL, &screen->txc); -- 1.7.8.rc3