summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-10-20 17:18:25 +0200
committerJakob Bornecrantz <[email protected]>2009-10-20 17:19:04 +0200
commita9f71b3bba86771be56ff1def716beb370decd22 (patch)
treeb5feb00f14ba081db38d656bafe4ab8c23ca4725
parent5f8f14e5ca994461c54ba547f6371c2f71474425 (diff)
st/xorg: Cleanly shutdown
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c5
-rw-r--r--src/gallium/state_trackers/xorg/xorg_renderer.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index 2df954f18ee..7da10427eca 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -541,6 +541,9 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
+ if (!ms->api)
+ ms->api = drm_api_create();
+
if (!ms->screen) {
ms->screen = ms->api->create_screen(ms->api, ms->fd, NULL);
@@ -774,7 +777,7 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen)
if (ms->exa)
xorg_exa_close(pScrn);
- if (ms->api->destroy)
+ if (ms->api && ms->api->destroy)
ms->api->destroy(ms->api);
ms->api = NULL;
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c
index 3dd5e6e811d..393f3fac3ed 100644
--- a/src/gallium/state_trackers/xorg/xorg_renderer.c
+++ b/src/gallium/state_trackers/xorg/xorg_renderer.c
@@ -283,13 +283,15 @@ void renderer_destroy(struct xorg_renderer *r)
if (fsbuf && fsbuf->buffer)
pipe_buffer_reference(&fsbuf->buffer, NULL);
+ if (r->shaders) {
+ xorg_shaders_destroy(r->shaders);
+ r->shaders = NULL;
+ }
+
if (r->cso) {
cso_release_all(r->cso);
cso_destroy_context(r->cso);
- }
-
- if (r->shaders) {
- xorg_shaders_destroy(r->shaders);
+ r->cso = NULL;
}
}