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>
This commit is contained in:
Sai Teja Pottumuttu
2023-02-22 07:02:18 +00:00
committed by Marge Bot
parent 42e8a2c1d6
commit 530ae32c5d
+1 -1
View File
@@ -1394,7 +1394,7 @@ bo_free(struct iris_bo *bo)
if (!bo->real.userptr && bo->real.map)
bo_unmap(bo);
if (bo->idle) {
if (bo->idle || !iris_bo_busy(bo)) {
bo_close(bo);
} else {
/* Defer closing the GEM BO and returning the VMA for reuse until the