[Mesa-dev] [PATCH] etnaviv: fix resource usage tracking across different pipe_context's

Lukas F. Hartmann lukas at mntmn.com
Tue Dec 11 21:40:26 UTC 2018


Hi,

I tested the patch on i.MX6QP with:
Linux reform 4.20.0-rc2-00133-g1ce80e0fe98e-dirty #10 SMP Mon Nov 26
02:02:42 CET 2018 armv7l GNU/Linux

Running a recent Xorg built from source with modesetting driver and
etnaviv.

I was getting segfaults after a few seconds of usage and tracked them
down to a corrupt pointer (probably use-after-free):

http://dump.mntmn.com/marexpatch-trace1.txt.html

After looking at your patch for a while I came up with this addition
(last line) in etna_resource.c, to remove the resource from the
used_resources set when it is destroyed.

@@ -464,6 +469,9 @@ etna_resource_destroy(struct pipe_screen *pscreen,
struct pipe_resource *prsc) {
    struct etna_resource *rsc = etna_resource(prsc);
 
+   _mesa_set_destroy(rsc->pending_ctx, NULL);
+   _mesa_set_remove_key(etna_screen(pscreen)->used_resources, rsc);

I've been running with this version for a few days and it seems stable.
The patch seems to do its job (tested qupzilla and qutebrowser, no
more corrupted tiles). Just sometimes an occassional black tile shows
up. So something is still up, but the patch is a perceived improvement.

Cheers
Lukas F. Hartmann (mntmn)
https://mntmn.com



More information about the mesa-dev mailing list