Mesa (mesa_7_7_branch): st/xorg: On close wait on fences and then destroy the screen

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Tue Dec 29 20:09:36 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: d34fdf149d250275e819ca58554a41a8bff82785
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d34fdf149d250275e819ca58554a41a8bff82785

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Wed Dec 30 04:46:12 2009 +0100

st/xorg: On close wait on fences and then destroy the screen

---

 src/gallium/state_trackers/xorg/xorg_driver.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index ee01ba0..ccaa0c6 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -255,9 +255,19 @@ static Bool
 drv_close_resource_management(ScrnInfoPtr pScrn)
 {
     modesettingPtr ms = modesettingPTR(pScrn);
+    int i;
 
-    if (ms->screen)
+    if (ms->screen) {
+	assert(ms->ctx == NULL);
+
+	for (i = 0; i < XORG_NR_FENCES; i++) {
+	    if (ms->fence[i]) {
+		ms->screen->fence_finish(ms->screen, ms->fence[i], 0);
+		ms->screen->fence_reference(ms->screen, &ms->fence[i], NULL);
+	    }
+	}
 	ms->screen->destroy(ms->screen);
+    }
     ms->screen = NULL;
 
     if (ms->api && ms->api->destroy)



More information about the mesa-commit mailing list