summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2017-07-21 21:41:06 -0700
committerCharmaine Lee <[email protected]>2017-07-24 14:03:28 -0700
commitbbc29393d3beaf6344c7188547b4ff61b63946ae (patch)
tree9369b57a09847b034693409637bda46add4bcad6 /src/gallium/state_trackers/dri
parentca82ef5ac75e50abb109986b55002cca24f7c0fb (diff)
st/mesa: create framebuffer iface hash table per st manager
With commit 5124bf98239, a framebuffer interface hash table is created in st_gl_api_create(), which is called in dri_init_screen_helper() for each screen. When the hash table is overwritten with multiple calls to st_gl_api_create(), it can cause race condition. This patch fixes the problem by creating a framebuffer interface hash table per state tracker manager. Fixes crash with steam. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101876 Fixes: 5124bf98239 ("st/mesa: add destroy_drawable interface") Tested-by: Christoph Haag <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c1
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index c7df0f63327..9e0dd6bcfb3 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -158,6 +158,7 @@ dri_create_buffer(__DRIscreen * sPriv,
dPriv->driverPrivate = (void *)drawable;
p_atomic_set(&drawable->base.stamp, 1);
drawable->base.ID = p_atomic_inc_return(&drifb_ID);
+ drawable->base.state_manager = &screen->base;
return GL_TRUE;
fail:
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index 1dd7bd3ec12..59a850b1423 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -457,6 +457,9 @@ dri_destroy_option_cache(struct dri_screen * screen)
void
dri_destroy_screen_helper(struct dri_screen * screen)
{
+ if (screen->base.destroy)
+ screen->base.destroy(&screen->base);
+
if (screen->st_api && screen->st_api->destroy)
screen->st_api->destroy(screen->st_api);