Skip to content

Commit

Permalink
iris: Fix to release BO immediately if not busy
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21460>
  • Loading branch information
saiteja13427 authored and Marge Bot committed Mar 1, 2023
1 parent 42e8a2c commit 530ae32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gallium/drivers/iris/iris_bufmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 530ae32

Please sign in to comment.