summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-12-30 04:46:12 +0100
committerJakob Bornecrantz <[email protected]>2009-12-30 05:01:09 +0100
commitd34fdf149d250275e819ca58554a41a8bff82785 (patch)
tree9d46b055daaa66d07868cef34f9dd8a5241069b2
parent5fdc4f732f6fb50dc324b60b0cff05b6eca46946 (diff)
st/xorg: On close wait on fences and then destroy the screen
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c12
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 ee01ba0dcf6..ccaa0c68ef7 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)