panfrost: Flush resources when shadowing
authorAlyssa Rosenzweig <alyssa@collabora.com>
Sat, 23 Oct 2021 14:13:51 +0000 (10:13 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 24 Feb 2022 23:11:20 +0000 (23:11 +0000)
commit988d5aae74d61d1416b369172ef286b4aac933d0
tree306d5c487a6d1ff988d364559d252a25415c44e7
parent5536852d60e59dad52feb63e1e88150ece1fec15
panfrost: Flush resources when shadowing

When we shadow a resource, the backing BO is changed; as such,
existing references to the resource become invalid. So batches accessing the
resource need to be flushed (or otherwise have their references invalidated).

The wrong behaviour change (not flushing) was introduced when we started
tracking resources instead of BOs. The issue manifested as a severe performance
regression in glmark2's -bbuffer test, particular the subdata subtest. The issue
is magnified on slow CPUs; without the fix, the test becomes completely CPU
bound

Relevant glmark2 -bbuffer test from 43fps to 84fps.

Apparently, this causes functional issues too -- this performance-minded change
also fixes a few piglits.

Fixes: cecb889481d ("panfrost: Do tracking of resources, not BOs")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Chris Healy <cphealy@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13502>
src/gallium/drivers/panfrost/pan_resource.c
src/panfrost/ci/panfrost-g52-fails.txt