etnaviv: fix resource usage tracking across different pipe_context's
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Sat, 23 Feb 2019 15:15:19 +0000 (16:15 +0100)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 1 Mar 2019 07:08:56 +0000 (08:08 +0100)
commit64813541d575c4244293c6cbcd9739b12a22a76f
tree1c38ccda0971694c7d747e6d7a50bfb38c71b731
parentf1061fa5771496ae95f195c1aa590736cd209414
etnaviv: fix resource usage tracking across different pipe_context's

A pipe_resource can be shared by all the pipe_context's hanging off the
same pipe_screen.

Changes from v2 -> v3:
 - add locking with mtx_*() to resource and screen (Marek)
Changes from v3 -> v4:
 - drop rsc->lock, just use screen->lock for the entire serialization (Marek)
 - simplify etna_resource_used() flush condition, which also prevents
   potentially flushing resources twice (Marek)
 - don't remove resouces from screen->used_resources in
   etna_cmd_stream_reset_notify(), they may still be used in other
   contexts and may need flushing there later on (Marek)
Changes from v4 -> v5:
 - Fix coding style issues reported by Guido
Changes from v5 -> v6:
 - Add missing locking in etna_transfer_map(..) (Boris)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Marek Vasut <marex@denx.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
src/gallium/drivers/etnaviv/etnaviv_context.c
src/gallium/drivers/etnaviv/etnaviv_context.h
src/gallium/drivers/etnaviv/etnaviv_resource.c
src/gallium/drivers/etnaviv/etnaviv_resource.h
src/gallium/drivers/etnaviv/etnaviv_screen.c
src/gallium/drivers/etnaviv/etnaviv_screen.h
src/gallium/drivers/etnaviv/etnaviv_transfer.c