From 530ae32c5d4d803b39088160d1f8efa05754e115 Mon Sep 17 00:00:00 2001 From: Sai Teja Pottumuttu Date: Wed, 22 Feb 2023 07:02:18 +0000 Subject: [PATCH] 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 Reviewed-by: Kenneth Graunke Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/iris/iris_bufmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index 4732f803252..9ffef5b7ec3 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -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