iris: Fix to release BO immediately if not busy
authorSai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Wed, 22 Feb 2023 07:02:18 +0000 (07:02 +0000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 1 Mar 2023 09:17:48 +0000 (09:17 +0000)
commit530ae32c5d4d803b39088160d1f8efa05754e115
tree586c986e0e8e309bcafc4e44bef675f420208514
parent42e8a2c1d6ba3cae31c9829e94b2d3c48c40ab7d
iris: Fix to release BO immediately if not busy

Currently the iris driver is adding the buffer objects to zombie list
without checking if it is busy or not. It checks for it after 1 second
which adds delay to buffer release.

This fix checks if the bo is busy or not before adding it to zombie list.

Without this fix, the applications expecting immediate buffer release would
fail.

The fix is identified while debugging below android cts tests:
android.graphics.cts.BitmapTest#testDrawingHardwareBitmapNotLeaking
android.graphics.cts.BitmapTest#testHardwareBitmapNotLeaking

Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21460>
src/gallium/drivers/iris/iris_bufmgr.c