panfrost: Compact the bo_access readers array
authorIcecream95 <ixn@keemail.me>
Wed, 15 Jan 2020 20:51:17 +0000 (09:51 +1300)
committerMarge Bot <eric+marge@anholt.net>
Sat, 18 Jan 2020 13:58:43 +0000 (13:58 +0000)
commit5e8386c606293de4f9cbbc2666a9e9e3758b6b29
tree231b60c2bbaf7229911aa2eaa7e48558600ea9df
parentc0ba9000d21ee22a25fec0b3338ea53184dd1130
panfrost: Compact the bo_access readers array

Previously, the array bo_access->readers was only cleared when there
were no unsignaled fences, which in some situations never happened.

That resulted in the array having thousands of NULL pointers, but only
a handful of active readers.

With this patch, all the unsignaled readers are moved to the front of
the array, effectively building a new array only containing the active
readers in-place. This results in the readers array usually only having
a couple of elements.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3419>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3419>
src/gallium/drivers/panfrost/pan_job.c