etnaviv: keep references to pending resources
authorLucas Stach <l.stach@pengutronix.de>
Fri, 9 Aug 2019 13:34:31 +0000 (15:34 +0200)
committerLucas Stach <dev@lynxeye.de>
Fri, 18 Oct 2019 17:03:25 +0000 (17:03 +0000)
commit9e672e4d20fb77e1b39aee29f9e8e76a5c2af68e
tree5c24325d2771197d93fb1f10c419b615365885ee
parent90e223646bf9541c4b751bcbd04cd81e27fb42e1
etnaviv: keep references to pending resources

As long as a resource is pending in any context we must not destroy
it, otherwise we'll hit a classical use-after-free with fireworks.
To avoid this take a reference when the resource is first added to
the pending set and put the reference when no longer pending.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
src/gallium/drivers/etnaviv/etnaviv_context.c
src/gallium/drivers/etnaviv/etnaviv_resource.c