Skip to content

turnip: fix a few resource leak and racy gem close with iova

Yiwei Zhang requested to merge zzyiwei/mesa:tu-fix-dmabuf-reimport into main

What does this MR do and why?

turnip: fix a few resource leak and racy gem close with iova

Summary:

  • msm backend:
  • virtio backend:
    • commit 1 fixes iova cleanup on error path of virtio backend
    • commit 2 fixes iova leak for found already imported dma-buf succeed path of virtio backend
    • commit 3 fixes racy gem close for back-2-back re-imported dma-buf of virtio backend

The racy gem close happens when the dma-buf bo is deferred to the zombie vmas for teardown while a new import with the same gem_handle occurs, and it could close the gem_handle unexpectedly when purging the zombie vmas.

Below Android 13 CTS have been tested with enabled skiavk with venus-on-turnip (msm backend):

atest CtsUiRenderingTestCases
...
arm64-v8a CtsUiRenderingTestCases: Passed: 761, Failed: 0, Ignored: 1, Assumption Failed: 0,

All tests passed!
atest CtsGraphicsTestCases
...
arm64-v8a CtsGraphicsTestCases: Passed: 3699, Failed: 0, Ignored: 3, Assumption Failed: 6,

All tests passed!

Below dEQP-VK have been tested with venus-on-turnip:

dEQP-VK.wsi.android.swapchain.simulate_oom.*

05-09 11:35:17.296 11703 11722 I dEQP    :   Passed:        11/12 (91.7%)
05-09 11:35:17.296 11703 11722 I dEQP    :   Failed:        0/12 (0.0%)
05-09 11:35:17.296 11703 11722 I dEQP    :   Not supported: 1/12 (8.3%)
05-09 11:35:17.296 11703 11722 I dEQP    :   Warnings:      0/12 (0.0%)
05-09 11:35:17.296 11703 11722 I dEQP    :   Waived:        0/12 (0.0%)
dEQP-VK.api.external.memory.android_hardware_buffer.*

05-09 11:36:30.888 11737 11757 I dEQP    :   Passed:        35/39 (89.7%)
05-09 11:36:30.888 11737 11757 I dEQP    :   Failed:        0/39 (0.0%)
05-09 11:36:30.888 11737 11757 I dEQP    :   Not supported: 4/39 (10.3%)
05-09 11:36:30.888 11737 11757 I dEQP    :   Warnings:      0/39 (0.0%)
05-09 11:36:30.888 11737 11757 I dEQP    :   Waived:        0/39 (0.0%)

/cc @Danil @robclark

Edited by Yiwei Zhang

Merge request reports