etnaviv: Use reentrant screen lock around flush
authorMarek Vasut <marex@denx.de>
Mon, 3 Jun 2019 22:22:49 +0000 (00:22 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Wed, 14 Aug 2019 08:36:36 +0000 (10:36 +0200)
commit8f97262cddc9950df6c5a8eddaff5135b2c78b9a
tree1610f3b5d6f509480f117b792ea6e05271f74dba
parent6bb4b6d07816eb116dd07884b4f593916e3daf88
etnaviv: Use reentrant screen lock around flush

The flush callback may be called on the same pipe context, and thus
the same stream, from two different threads of execution. However,
etna_cmd_stream_flush{,2}() must not be called on the same stream
from two different threads of execution as that would mess up the
etna_bo refcounting and likely have other ugly side effects.

Fix this by using a reentrant screen lock around the flush callback.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_context.c