anv: figure out CCS address reuse with non-destroyed images
In the following scenario :
- allocate memA
- binding imgA using CCS with memA (CCS binding succeeds)
- free memA
- allocate memB (reuse the VMA memA)
- binding imgB using CCS with memB (CCS binding fails, fallback disabling AUX)
Because imgA is not destroyed, its CCS binding is not unmapped and so cannot reuse the mapped address in AUX-TT.
This should only be a problem on TGL, since the format bits in the AUX-TT are not used anymore with MTL+.
But this could lead to issues if an image with a CCS modifier is trying to bind to the same address.
We have the following solutions (can someone think of more?) :
- don't release memory on step 3
- create a VMA object and refcount this in binding operations, VMA allocations will be released when the last user frees/destroys
Not a big fan of either and especially of the first solution, as it can keep large amounts of data unfreed.
The second solution also adds complexity to the driver.
/cc @nchery @jxzgithub