04bfe828db
TR-TT is a hardware feature supported by both i915.ko and xe.ko, which means we can now finally have Sparse Resources on i915.ko and we also have 2 options for xe.ko (and whatever is the best should be the default). In this patch we use batch commands to write the page tables and forever keep them in device memory. We maintain a mirror of both the L3 and and L2 tables because that helps us never having to read the tables that are in device memory. We still have some things to improve, but with this commit, workloads that didn't work at all due to the lack of sparse resources should at least run. This is still all disabled by default in i915.ko, you can turn it on by exporting ANV_SPARSE=1 before launching the applications. For xe.ko, switch the default with ANV_SPARSE_USE_TRTT=1. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>