From f57deefc3ef783fab4373df63831085fbfa2dd1b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 29 Sep 2012 16:01:58 +0100 Subject: [PATCH] sna: Release the front buffer and drop DRM master early during shutdown If we delay the dropping of DRM master we may complete a VT switch before we are ready and so prevent a second X server from reacquiring master, and dying. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55446 Signed-off-by: Chris Wilson --- src/sna/sna_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 462d9ac..1b7e817 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -736,6 +736,7 @@ static Bool sna_early_close_screen(CLOSE_SCREEN_ARGS_DECL) DBG(("%s\n", __FUNCTION__)); + xf86_hide_cursors(scrn); sna_uevent_fini(scrn); /* drain the event queues */ @@ -747,7 +748,12 @@ static Bool sna_early_close_screen(CLOSE_SCREEN_ARGS_DECL) sna->dri_open = false; } - xf86_hide_cursors(scrn); + if (sna->front) { + screen->DestroyPixmap(sna->front); + sna->front = NULL; + } + + drmDropMaster(sna->kgem.fd); scrn->vtSema = FALSE; xf86_cursors_fini(screen); @@ -764,13 +770,7 @@ static Bool sna_late_close_screen(CLOSE_SCREEN_ARGS_DECL) DBG(("%s\n", __FUNCTION__)); - if (sna->front) { - screen->DestroyPixmap(sna->front); - sna->front = NULL; - } - sna_accel_close(sna); - drmDropMaster(sna->kgem.fd); depths = screen->allowedDepths; for (d = 0; d < screen->numDepths; d++) -- 1.7.10.4