summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri/dri_drawable.c
diff options
context:
space:
mode:
authorCharmaine Lee <charmainel@vmware.com>2017-07-21 21:41:06 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2017-07-27 19:54:24 +0100
commit94e0de90eeb6407a63d4b780cd4cff6c5e7e794e (patch)
treed80074bd4847132a4d45c633a6047b4ef3b7e71e /src/gallium/state_trackers/dri/dri_drawable.c
parent3180f0fa0db6401d865b589d3bb75f2a852aad82 (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 <haagch@frickel.club> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit bbc29393d3beaf6344c7188547b4ff61b63946ae) Squashed with: st/mesa: fix unconditional return in st_framebuffer_iface_remove Noticed by James Legg @ Feral. Cc: 17.2 <mesa-stable@lists.freedesktop.org> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (cherry picked from commit 914f11e75b8ebe8a0faab76ce25fe185ab580eee) Squashed with: st/mesa: Fix inversed test in st_api_destroy_drawable Fixes a drawable leak. Fixes: bbc29393d3be ("st/mesa: create framebuffer iface hash table per st manager") Bugzilla: https://bugs.freedesktop.org/101930 Tested-by: Nick Sarnie <commendsarnex@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 57132d126f2e129fc2959dcc2c0a8126389d07ba)
Diffstat (limited to 'src/gallium/state_trackers/dri/dri_drawable.c')
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c1
1 files changed, 1 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: