<div dir="ltr"><div>FYI, the commit was causing crashes of qtcreator and firefox, so I reverted it.<br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 20, 2018 at 6:29 AM, Johan Klokkhammer Helsing <span dir="ltr"><<a href="mailto:johan.helsing@qt.io" target="_blank">johan.helsing@qt.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If an EGLSurface is created, made current and destroyed, and then a second<br>
EGLSurface is created. Then the second malloc in driCreateNewDrawable may<br>
return the same pointer address the first surface's drawable had.<br>
Consequently, when dri_make_current later tries to determine if it should<br>
update the texture_stamp it compares the surface's drawable pointer against<br>
the drawable in the last call to dri_make_current and assumes it's the same<br>
surface (which it isn't).<br>
<br>
When texture_stamp is left unset, then dri_st_framebuffer_validate thinks<br>
it has already called update_drawable_info for that drawable, leaving it<br>
unvalidated and this is when bad things starts to happen. In my case it<br>
manifested itself by the width and height of the surface being unset.<br>
<br>
This is fixed this by setting the pointer to NULL before freeing the<br>
surface.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=106126" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=106126</a><br>
Signed-off-by: Johan Klokkhammer Helsing <<a href="mailto:johan.helsing@qt.io">johan.helsing@qt.io</a>><br>
---<br>
src/gallium/state_trackers/<wbr>dri/dri_drawable.c | 4 ++++<br>
1 file changed, 4 insertions(+)<br>
<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/dri_drawable.c b/src/gallium/state_trackers/<wbr>dri/dri_drawable.c<br>
index e5a7537e47..02328acd98 100644<br>
--- a/src/gallium/state_trackers/<wbr>dri/dri_drawable.c<br>
+++ b/src/gallium/state_trackers/<wbr>dri/dri_drawable.c<br>
@@ -185,6 +185,7 @@ fail:<br>
void<br>
dri_destroy_buffer(__<wbr>DRIdrawable * dPriv)<br>
{<br>
+ struct dri_context *ctx = dri_context(dPriv-><wbr>driContextPriv);<br>
struct dri_drawable *drawable = dri_drawable(dPriv);<br>
struct dri_screen *screen = drawable->screen;<br>
struct st_api *stapi = screen->st_api;<br>
@@ -202,6 +203,9 @@ dri_destroy_buffer(__<wbr>DRIdrawable * dPriv)<br>
/* Notify the st manager that this drawable is no longer valid */<br>
stapi->destroy_drawable(stapi, &drawable->base);<br>
<br>
+ if (ctx && ctx->dPriv == dPriv)<br>
+ ctx->dPriv = NULL;<br>
+<br>
FREE(drawable);<br>
}<br>
<span class="HOEnZb"><font color="#888888"> <br>
-- <br>
2.17.0<br>
<br>
</font></span></blockquote></div><br></div>